18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Chrome browser options proxy settings on Mac

beemanbeeman Members
edited November -1 in Sahi - Open Source
Hi:

Trying to run a test suite from the MAC terminal. The browser options don't seem to be recognized.

OS Name: OS X Version 10.6.8
Browser Name and Version: Chrome 13.0.782.218
Sahi Build: Sahi V3.5

The command below has the browser options with the proxy settings specific but Chrome does not start at all.
Mac:~/workspace/project/sahi/userdata/bin$ java -cp ../../lib/ant-sahi.jar net.sf.sahi.test.TestRunner scripts/test.suite "open -a 'Google Chrome' " ht tp://localhost:3000 default localhost 9999 1 "Google Chrome" "--user-data-dir=../browser/chrome/profiles/sahi0 --proxy-server=localhost:9999 --disable-popup-blocking"

suiteName = scripts/test.suite
base = h ttp://localhost:3000
sahiHost = localhost
port = 9999
threads = 1
browser = open -a 'Google Chrome' 
browserOption = --user-data-dir=../browser/chrome/profiles/sahi0 --proxy-server=localhost:9999 --disable-popup-blocking
browserProcessName = Google Chrome
this.isSingleSession == false
Added shutdown hook.
h ttp://localhost:9999/_s_/dyn/Suite_start?suite=scripts%2Ftest.suite&base=http%3A%2F%2Flocalhost%3A3000&threads=1&sahisid=sahi_c1a7f223032ff04ab40aae600eea30395ae9&browser=open+-a+%27Google+Chrome%27+&browserProcessName=Google+Chrome&browserOption=--user-data-dir%3D..%2Fbrowser%2Fchrome%2Fprofiles%2Fsahi0+--proxy-server%3Dlocalhost%3A9999+--disable-popup-blocking&html=

If the command does not have the browser options, Chrome starts but doesn't connect with the sahi proxy server because of the missing proxy settings.
Mac:~/workspace/project/sahi/userdata/bin$ java -cp ../../lib/ant-sahi.jar net.sf.sahi.test.TestRunner scripts/test.suite "open -a 'Google Chrome' " h ttp://localhost:3000 default localhost 9999 1 "Google Chrome"

suiteName = scripts/test.suite
base = h ttp://localhost:3000
sahiHost = localhost
port = 9999
threads = 1
browser = open -a 'Google Chrome' 
browserOption = 
browserProcessName = Google Chrome
this.isSingleSession == false
Added shutdown hook.
h ttp://localhost:9999/_s_/dyn/Suite_start?suite=scripts%2Ftest.suite&base=http%3A%2F%2Flocalhost%3A3000&threads=1&sahisid=sahi_541a1a3e09119041f70b61408e1514efa785&browser=open+-a+%27Google+Chrome%27+&browserProcessName=Google+Chrome&browserOption=&html=

If the Chrome proxy settings are set in Chrome Preferences in Under the Hood, the script runs correctly. But that is a manual step setting and not practical.

Is there a problem with my command?

Thanks

Bryan

Comments

  • narayannarayan Administrators
    Hi Bryan,

    Could you please try the options as given here: http://sahi.co.in/w/mac-xml

    It would look something like:
    java -cp ../../lib/ant-sahi.jar net.sf.sahi.test.TestRunner scripts/test.suite "open -n -a 'Google Chrome' " ht tp://localhost:3000 default localhost 9999 1 "Google Chrome" "--args --user-data-dir=../browser/chrome/profiles/sahi$threadNo --proxy-server=localhost:9999 --disable-popup-blocking"
    

    I would also recommend you to use testrunner.sh and the browserType, instead of passing in individual browser parameters.

    Regards,
    Narayan
  • beemanbeeman Members
    edited September 2011
    Hi Narayan:

    I tried your suggestion with using testrunner.sh and browserType first. Chrome did not start.
    
    Mac:~/workspace/project/sahi/userdata/bin$ ./testrunner.sh test.suite h ttp://localhost:3000 Chrome
    test=scripts/test.suite
    browserType=Chrome
    baseURL=h ttp://localhost:3000
    host=localhost
    port=9999
    threads=5
    useSingleSession=false
    
    suiteName = scripts/test.suite
    base = h ttp://localhost:3000
    sahiHost = localhost
    port = 9999
    threads = 5
    browserType = Chrome
    this.isSingleSession == false
    Added shutdown hook.
    h ttp://localhost:9999/_s_/dyn/Suite_start?suite=scripts%2Ftest.suite&base=http%3A%2F%2Flocalhost%3A3000&threads=5&sahisid=sahi_b4756936061fc04d2b09fab034385c49aedb&browserType=Chrome&html=
    

    *Updated* I then went back to the command line and tried the command below. This command worked! The default Chrome profile location was used because when the sahi0 profile was used, Chrome did not start.
    Mac:~/workspace/project/sahi/userdata/bin$ java -cp ../../lib/ant-sahi.jar net.sf.sahi.test.TestRunner scripts/test.suite "open -n -a 'Google Chrome' " h ttp://localhost:3000 default localhost 9999 1 "Google Chrome" "--args --user-data-dir=/Users/name/Library/Application\ Support/Google/Chrome --proxy-server=localhost:9999 --disable-popup-blocking"
    
    suiteName = scripts/test.suite
    base = h ttp://localhost:3000
    sahiHost = localhost
    port = 9999
    threads = 1
    browser = open -n -a 'Google Chrome' 
    browserOption = --args --user-data-dir=/Users/name/Library/Application\ Support/Google/Chrome --proxy-server=localhost:9999 --disable-popup-blocking
    browserProcessName = Google Chrome
    this.isSingleSession == false
    Added shutdown hook.
    http://localhost:9999/_s_/dyn/Suite_start?suite=scripts%2Ftest.suite&base=http%3A%2F%2Flocalhost%3A3000&threads=1&sahisid=sahi_00542bfe0e16704ad20b23e0f805db38ee9a&browser=open+-a+%27Google+Chrome%27+&browserProcessName=Google+Chrome&browserOption=--args+--user-data-dir%3D%2FUsers%2Fname%2FLibrary%2FApplication%5C+Support%2FGoogle%2FChrome+--proxy-server%3Dlocalhost%3A9999+--disable-popup-blocking&html=
    


    Thanks
    Bryan
Sign In or Register to comment.