Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ with your query.

Mobile testing with Sahi

Recently I have struggled a bit trying to test a web application using a mobile device user agent with Sahi. Eventually I found out that chrome would accept a change of user agent as a command line argument. I tried to add the --user-agent argument to my chrome batch file using different user agent strings without much success. I noticed that the user agent strings used semicolons or commas as delimiters, it seems that these delimiters were in conflict with java. So I tried to replace the delimiters with a dot ('.'). I also replaced all spaces in my user agent string with dots. Here's what my Browser Options line looks like:

SET BROWSER_OPTION=--user-data-dir=$userDir\browser\chrome\profiles\sahi$threadNo --proxy-server=localhost:9999 --disable-popup-blocking --user-agent="Mozilla/5.0.("

And it worked ! I am now able to test my web application as if I was using an iPhone.

Hope this is as helpful for you as it was for me !


  • Hi Raymond,

    This definitely helps! Thanks for sharing.

  • Hi ,
    can you tell we where exactly to change the property for adding user agent.

  • Hi Narayan

    How to record mobile apps script using SAHI (Not on the i-Phone or mobile)


  • **********************************
    HI all,
    I am trying to run scripts on iphone6s/6s+ , however I couldn't, As I successfully done for iphone5/5c
    Could you plz let me know as i need on urgent basis.

    Is sahi compatible to playback on latest versions of iphone and android.?????????

Sign In or Register to comment.