Question

I have question. I want to automate testing in android browser.

My requirements:

I have JS Test Driver maven project which needs to be tested in android browser.

So what I want to do is

in maven pom.xml file instead of pointing to chrome as

<browser.command>C:\Program Files (x86)\Google\Chrome\Application\chrome.exe</browser.command>

Create bat file which will run command that launch URL link in android emulator browser and point it to that bat file.

My problem is I don't know what command to write that will lunch particular URL in android emulator browser from command line.

Any suggestions?

Was it helpful?

Solution

Using the adb shell tool in combination with the am command, you should be able to launch the browser on your Android device, and point it to an url of choice.

Something like (don't have a device with me at the moment, so cannot test):

adb shell am start -a "android.intent.action.VIEW" -d "http://your.url.here"

Put that in your bat-file and run it. It should automatically find a connected device. If you would also like to wait for a device to become available, check the adb documentation: this can also be done.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top