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

plraymondplraymond Members
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 !


Sign In or Register to comment.