Troubleshooting mobile web tests

In case you would like to reproduce a failed test run on a given emulated mobile device, you can to the Test Details page, click edit info from the pencil icon at the top, and temporarily change the default device setting to a device you want to troubleshoot. Then, you can click Edit steps and launch the Trainer to replay the test steps one by one with an emulated experience of the target device.

In certain cases, you may notice that a test passed on a mobile device because mabl managed to click on a target element which is present in the page DOM but not visible within the current viewport. For example, you may see mabl click on a menu item without fully opening the menu due to lack of hover actions on the mobile device. If you run into such a case with your application, it is best to create a dedicated mobile web test and use the duplicated test to validate that part of the mobile user experience.

23942394

Example logs indicating that mabl attempted to click on the target element using several strategies before succeeding.

📘

Hover steps

Mabl treats hover steps as supporting test actions and therefore, will not fail the step and respectively the test. Even if the target element is not present on the page, mabl will do a hover action on the page.

User agent strings
In addition to viewport size, mabl relies on a user agent strings to emulate the mobile device experience in the desktop version of the Chrome browser. The user agent string is passed as an HTTP header value on network requests during test runtime. If you would like to see what some of those user agent values look like, you can open your Chrome browser DevTools, toggle the device toolbar and select a mobile device to emulate. Then, you can open the Console panel of DevTools and type navigator.userAgent to the see the user agent string value of the selected device.

12801280

Chrome browser console.

You can also review the Chrome documentation on user agent strings.

🚧

Mobile web testing limitations

The following limitations exist currently:

  • Mobile web testing works only with the Chrome browser.
  • You will not see element screenshots on the Test Details page if test was only run on emulated mobile devices.
  • Local ad hoc runs will only use the default device configuration, which is selected at the test level. If you are unsure what a test's default device configuration is, you can go to the Test Details page and click on the Edit icon at the top of the page. In the "Update test information" you can find the default device configuration for the test.

On rare occasions, you may see slightly different results when running a test in mabl using an iOS-based device such as an iPhone compared to using Chrome on an actual physical device due to differences in rendering engines. Apple requires Chrome to use Apple’s WebKit rendering engine on iOS devices which is different from the Blink rendering engine Chrome uses on desktop and Android.