問題描述
常見的網(wǎng)絡共識似乎是,如果您在 chrome 模擬器中看到一個名稱,您可以在量角器配置中按原樣使用它......所以我嘗試了 Apple iPad
:
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'
}
}
}
但我不得不在審判之前混日子錯誤產(chǎn)生了正確的 deviceName 為:Apple iPad 3/4
But I had to muck around until trial & error yielded the correct deviceName to be: Apple iPad 3 / 4
現(xiàn)在我在這里搜索過:https://developer.chrome.com/devtools/docs/device-mode#enable-device-mode 和這里:https://sites.google.com/a/chromium.org/chromedriver/mobile-emulation但我找不到所有有效設備名稱的列表.任何想法在哪里得到它?
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?
在 https://code.google.com/p/chromium/codesearch我發(fā)現(xiàn):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.
也許其他地方的 chrome webdriver 的源代碼可能有一個枚舉列表,但我找不到它,感謝任何幫助!
Maybe the source code for chrome webdriver somewhere else may have an enumerated list but I couldn't find it, any help is appreciated!
推薦答案
所以我找到了一些來源,但它們似乎引用了不再存在的鏈接.這似乎是我能找到的最好結果?
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
這個列表似乎是主列表https://code.google.com/p/chromium/codesearch#chromium/src/chrome/test/chromedriver/chrome/mobile_device_list.cc
這篇關于使用 Protractor 進行 Chrome 模擬測試的有效設備名稱是什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!