1

I know it is possible to open a desktop web browser with Selenium WeDriver. The following lines written in Java allows doing so:

WebDriver webDriverChrome = new ChromeDriver();
webDriverChrome.get(pagesToTest[i]);

At the same time we can debug web application on mobile browsers using inspect screen while mobile devices are connected via USB:

enter image description here

enter image description here

The question is:

Is it possible to automate the inspection of web pages via mobile browsers using real devices with Selenium WebDriver?

asked Feb 24, 2021 at 11:14
9
  • could you add more infromation on how you are debuggin mobile browser , please add the configuration infromationn Commented Feb 25, 2021 at 17:26
  • What configuration do you require? Browser versions and devices? Commented Feb 26, 2021 at 11:20
  • how are you debugging mobile browser in desktop Commented Feb 26, 2021 at 11:26
  • Via the page which is displayed on the first screen. "inspect" button. Commented Feb 26, 2021 at 11:55
  • 1
    @PDHide --- It is possible to inspect chrome running on a mobile phone. Try plugging an android phone into a laptop and going to this URL --- chrome://inspect/#devices Commented Feb 26, 2021 at 15:11

3 Answers 3

1

Answer is yes , you dont need appium .

https://chromedriver.chromium.org/getting-started/getting-started---android

Thanks for the wonderful question

You can run chrome in android device straight from selenium:

First make sure adb version is latest:

download latest from : https://developer.android.com/studio/releases/platform-tools

the adb will be inside the platform tool

Now make sure device detected

run:

adb devices

And make sure device shows in the list

enter image description here

make sure it is showing device and not unauthorized:

Now you can run below code:

python:

you can add experimental option (for any binding )

options = webdriver.ChromeOptions()
options.add_experimental_option('androidPackage', 'com.android.chrome')
driver = webdriver.Chrome('./chromedriver', options=options)
driver.get('https://google.com')
driver.quit()

You can see how to inspect from desktop here:

https://developers.google.com/web/tools/chrome-devtools/remote-debugging#troubleshooting https://developers.google.com/web/tools/chrome-devtools/remote-debugging

answered Feb 26, 2021 at 16:59
0

I think the answer you are looking for is "Appium". Appium is very similar to Selenium WebDriver, except you will need to update the desired capabilities in order to work with the mobile browser.

answered Feb 24, 2021 at 18:10
0

Yes. It is possible to automate the inspection of web pages via mobile browsers using real devices with Selenium WebDriver. Appium can help you the most.

Appium is an open source test automation framework for use with native, hybrid and mobile web apps. NO dependency on Mobile device OS. It has framework or wrapper that translate Selenium Webdriver commands into UIAutomation (iOS) or UIAutomator (Android) commands depending on the device type, not any OS type.

Appium supports all languages that have Selenium client libraries like- Java, Objective-C, JavaScript with node.js, PHP, Ruby, Python, C#, etc.

answered Feb 26, 2021 at 12:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.