Browser automation on a mobile device ?


#1

Hello,

Most of our clients require us to test the mobile version of their web sites. We were wondering if it’s possible or if it’s in the works to automate browsers on mobile devices?


#2

Thanks for the tip, will give it a try! :slight_smile:


#3

Oh wow, that’s quite awesome! I suppose it will be a bit tricky since the xpath of elements will probably not be the same on the desktop and mobile version of the site, but i will give it a go.

Do you have any suggestions and tips on how to most easily adapt a desktop-recorded web test to run on a mobile device?


#4

So a test script recorded on a desktop can be directly executed on a mobile device, nothing special required? Not even the chrome plugin? Katalon will run the browser on the device, go to the required site and execute the steps inside the mobile browser?


#5

Yes, we have Android and iOS devices that we use to manually test the mobile version of the clients’ sites.

But we would like to automate these “mobile web” tests, just like normal aumated web (desktop) tests, but they have to run on a mobile device instead. Is that possible?


#6

Hi there,

The xpath will not be different between a real web browser and mobile web browser. They should be the same in all cases :slight_smile:

My only suggestions related to your scenario is you can utilize ‘mobileEmulation’ options in Chrome. It simulates the same device screen and behaviors when you execute your test script on Chrome web browser.

Example

Settings: http://prnt.sc/f0o5f7 => Execution result: http://prnt.sc/f0o63y


#7

Hi Dobromir,

Yes that’s right. Of course Chrome application (on Android device) and Safari application ( on iOS device) must be installed on the device so that execution can happen properly.

Thanks


#8

Hi there,

Yes you can do that. Execute the same test script and select either ‘Android’ or ‘iOS’ item accordingly.

Thanks


#9

Hi there,

Do you have any mobile devices available from your side? If so then you need to connect your device into your machine and then execute your test scripts in connected device :slight_smile:

Thanks


#10

Hi guys,
I tried the settings mentioned for @Vinh Nguyen on the custom settings for ‘mobileEmulation’ , but so far has not work at all. It still running the test cases on normal web browser, any ideas what else should i configure in order to run it on any browser emulation device from chrome?

Hi there,

The xpath will not be different between a real web browser and mobile web browser. They should be the same in all cases :slight_smile:

My only suggestions related to your scenario is you can utilize ‘mobileEmulation’ options in Chrome. It simulates the same device screen and behaviors when you execute your test script on Chrome web browser.

Example

Settings: http://prnt.sc/f0o5f7 => Execution result: http://prnt.sc/f0o63y


#11

anahi galuba-garcia said:

Hi guys,

I tried the settings mentioned for @Vinh Nguyen on the custom settings for ‘mobileEmulation’ , but so far has not work at all. It still running the test cases on normal web browser, any ideas what else should i configure in order to run it on any browser emulation device from chrome?

Hi there,

The xpath will not be different between a real web browser and mobile web browser. They should be the same in all cases :slight_smile:

My only suggestions related to your scenario is you can utilize ‘mobileEmulation’ options in Chrome. It simulates the same device screen and behaviors when you execute your test script on Chrome web browser.

Example

Settings: http://prnt.sc/f0o5f7 => Execution result: http://prnt.sc/f0o63y

Hi,

I did manage to get this working.

The screenshots from Vinh Nguyen are admittedly vague, but the information is available in the ChromeDriver docs https://sites.google.com/a/chromium.org/chromedriver/mobile-emulation:

I set it up like this:

Driver name:
Chrome

Inside the Preferences field apply the following:
Name=mobileEmulation
Type=Dictionary
Inside the Value field apply the following:
Name: deviceName
Value Type: String
Value: your chrome device name (‘iPhone 6’ in my case)

see link: https://developers.google.com/web/tools/chrome-devtools/device-mode/?utm_source=dcc&utm_medium=redirect&utm_campaign=2016q3


#12

I’m trying to solve a similar problem, ie. leverage Katalon to test a responsive web app across devices. For certain use-cases, our web app detects what client the user is on and if it detects a phone it displays information differently than it does if the client is a tablet or desktop browser. When the client is a desktop browser (Chrome) in phone emulation mode, our code still detects it as a desktop browser. My hope was that Katalon offered a phone emulator (or maybe Kobiton) that our code would detect as an actual phone so we can test our custom phone experience.


#13

Vinh Nguyen said:

Hi there,

The xpath will not be different between a real web browser and mobile web browser. They should be the same in all cases :slight_smile:

My only suggestions related to your scenario is you can utilize ‘mobileEmulation’ options in Chrome. It simulates the same device screen and behaviors when you execute your test script on Chrome web browser.

Example

Settings: http://prnt.sc/f0o5f7 => Execution result: http://prnt.sc/f0o63y

hay vinh nguyen

i want to ask how to set the size of this emulation , how to set width and height of this cause its always run in 100% zoom and i want to decrease it

wait for your answer very soon


#14

Dear mate,

I am able to put emulation in place, but how to do that for landscape mode for any device., Please the attached settings that i have done, but no succcess. Please help configuring it.


#15

Please elaborate more about the test and also the settings. Based on your screenshots, issues happen in both test execution and on record/spy session, so which is the real issue you need assistant?


#16

Hi Vinh,

Goal: automate mobile webversion of website. So i want to create script in landscape mode and run that on browser stack. So how to do that?