Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are valid deviceNames for Chrome emulation testing with Protractor?

The common web consensus seems to be that if you see a name in your chrome emulator, you can use it as-is in your protractor config ... so I tried Apple iPad:

    {
      browserName: 'chrome',
      chromeOptions: {
        mobileEmulation: {
          deviceName: 'Apple iPad'
        }
      }
    }

enter image description here

But I had to muck around until trial & error yielded the correct deviceName to be: Apple iPad 3 / 4

Now I've searched here: https://developer.chrome.com/devtools/docs/device-mode#enable-device-mode and here: https://sites.google.com/a/chromium.org/chromedriver/mobile-emulation but I can't find a list of all the valid deviceNames. Any ideas where to get it?

On https://code.google.com/p/chromium/codesearch I found: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json&q=%22Apple%20iPad%22&sq=package:chromium&type=cs&l=643

But that's not really the source code that matters.

Maybe the source code for chrome webdriver somewhere else may have an enumerated list but I couldn't find it, any help is appreciated!

like image 362
pulkitsinghal Avatar asked Jul 28 '15 15:07

pulkitsinghal


2 Answers

So I found some sources but they seemed to referencing links that didn't exist anymore. This seems to be the best result I could find?

https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/devtools/front_end/emulation/OverridesUI.js&l=338

EDIT: This list seems like the master list https://code.google.com/p/chromium/codesearch#chromium/src/chrome/test/chromedriver/chrome/mobile_device_list.cc

like image 120
BarretV Avatar answered Sep 19 '22 09:09

BarretV


This code contains supported devices:

https://cs.chromium.org/chromium/src/chrome/test/chromedriver/chrome/mobile_device_list.cc?type=cs&q=%22Apple+iPhone+6%22&sq=package:chromium&l=12

For the moment it contains:

Laptop with touch
BlackBerry Z30
Google Nexus 6
Google Nexus 7
Google Nexus 4
Google Nexus 5
Apple iPad
Laptop with HiDPI screen
Samsung Galaxy Note II
Nokia N9
Samsung Galaxy S4
Nokia Lumia 520
BlackBerry PlayBook
Apple iPhone 5
Apple iPhone 4
Apple iPhone 6
LG Optimus L70
Apple iPhone 6 Plus
Apple iPad Mini
Amazon Kindle Fire HDX
Samsung Galaxy S III
Laptop with MDPI screen
Samsung Galaxy Note 3
Google Nexus 10
like image 41
Ali Avatar answered Sep 22 '22 09:09

Ali