Skip to content
Get Free Trial

Record Tests for Mobile Browsers

Record tests for a mobile browser from a desktop browser, by giving it a phone's screen size and user agent from the Sahi Pro start page.

A test recorded in a desktop browser can fail in a mobile browser. Many applications change their layout on a small screen, or serve a different mobile page, so elements move or get different names. To record steps that match what the phone shows, make the desktop browser look like the phone: give it the phone’s screen size and user agent.

  1. From the Sahi Pro Dashboard, launch a browser, such as Chrome. It opens on the Sahi Pro start page.

  2. Set up the browser as the phone, then open your application:

    The Sahi Pro start page with Launch the Sahi Controller (Sahi Mode, Java Mode and Launch Controller) above a Start URL box with https://sahitest.com/demo/training/ and a Go button; Change Resolution and Change User Agent are ticked, with 412 and 915 in the width and height boxes and an Android phone's user agent below; numbered badges mark Change Resolution, Change User Agent, the Start URL box and Go
    1. Tick Change Resolution and enter the phone’s screen width and height in pixels, such as 412 and 915.
    2. Tick Change User Agent and enter the phone browser’s user agent string.
    3. Enter the address of your application in Start URL.
    4. Click Go.

The browser opens the mobile version of your application. Record your steps from there with the Controller, as you would for a desktop browser. To run the tests on a real phone, see Run Tests on Mobile Browsers.