0

I've run into the following problem while attempting to emulate a mobile browser with chrome on heroku: Selenium ERR_NAME_NOT_RESOLVED on heroku with mobile testing. Based on Josh Lewis's answer, and the python code sample at https://sites.google.com/a/chromium.org/chromedriver/mobile-emulation

from selenium import webdriver
mobile_emulation = { "deviceName": "Nexus 5" }
chrome_options = webdriver.ChromeOptions()
chrome_options.add_experimental_option("mobileEmulation", mobile_emulation)
driver = webdriver.Remote(command_executor='http://127.0.0.1:4444/wd/hub',
                  desired_capabilities = chrome_options.to_capabilities())

It may be that I need to use a command_executor (defined at https://seleniumhq.github.io/selenium/docs/api/py/webdriver_remote/selenium.webdriver.remote.webdriver.html) as

command_executor - Either a string representing URL of the remote server or a 
custom
remote_connection.RemoteConnection object. Defaults to 
‘http://127.0.0.1:4444/wd/hub'

to get my code working. How would I found this with the Heroku chrome buildpack, https://github.com/heroku/heroku-buildpack-google-chrome

edit:

You can download my project for both windows and heroku use at:

https://github.com/kc1/mobiletest

(keep in mind that if you deploy to heroku you have to set FLASK_CONFIG to production. )

user1592380
  • 34,265
  • 92
  • 284
  • 515
  • In **Solution Stage B** section of [Selenium ERR_NAME_NOT_RESOLVED on heroku with mobile testing](https://stackoverflow.com/questions/51349410/selenium-err-name-not-resolved-on-heroku-with-mobile-testing/51407493?noredirect=1#comment89940683_51407493) I have already mentioned `"deviceName": "Nexus 5"` is not a valid capability, its **`"deviceName": "Google Nexus 5"`** – undetected Selenium Jul 23 '18 at 19:51
  • Thank you, I will try this later today .could you also take a look at https://stackoverflow.com/questions/51482026/current-list-of-chrome-mobile-user-agents – user1592380 Jul 23 '18 at 20:14
  • "deviceName": "Google Nexus 5" - does not work, it gives a device not found selenium error in the logs. I have a github repo which I put at the top of the question if you don't mind looking at it. – user1592380 Jul 24 '18 at 14:37

0 Answers0