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.

Sahi Recordings work on Firefox but does not work on Chrome

goureya_thankargoureya_thankar Members
edited November 2013 in Sahi - Open Source
Hi All

I am using Sahi Open Source 4.4

My Chrome and Browser Setting is as follows

<browserType>
<name>chrome</name>
<displayName>Chrome</displayName>
<icon>chrome.png</icon>
<path>C:/Users/Bunty.singhal/AppData/Local/Google/Chrome/Application/chrome.exe</path>
<options>--user-data-dir=C:\\Users\\Bunty.singhal\\sahi\\userdata\\browser\\chrome\\profiles\\sahi0 --proxy-server=localhost:9999 --disable-popup-blocking</options>
<processName>chrome</processName>
<capacity>5</capacity>
</browserType>


<browserType>
<name>firefox</name>
<displayName>Firefox</displayName>
<icon>firefox.png</icon>
<path>C:/Program Files (x86)/Mozilla Firefox/firefox.exe</path>
<options>-profile "C:/Users/Bunty.singhal/sahi/userdata/browser/ff/profiles/sahi0" -no-remote</options>
<processName>firefox</processName>
<capacity>5</capacity>
</browserType>


Script Recorded are as follows

_navigateTo("http://192.168.0.176:8100/Explic8/home.jsp";);
var $data = _readCSVFile("../../data/login.csv");
_dataDrive(login, $data);
_setRecovery(recoverFromError);

_assertExists(_image("Home"));
_assert(_isVisible(_image("Home")));
_click(_image("Home"));

_click(_span("System User Management"));
_click(_span("Add User"));
_click(_submit("Done"));
_click(_listItem("Tracker"));
_click(_listItem("License"));
_click(_listItem("System"));
_click(_submit("Done"));
_click(_reset("Cancel"));


Scripts are placed at different sah files and are called using following Java Code

FileLineIterator flIt = new FileLineIterator(input.getTestSuitePath());
String autom8HomePath = System.getenv("AUTOM8_HOME");
String loginStatus = singleSessionTestRunner.executeSingleTest(autom8HomePath +"/"+ LOGIN_SCRIPT);
System.out.println(loginStatus);
while(flIt.hasNext()) {
String filePath = flIt.next();
System.out.println("Starting Test Case :: " + filePath);

System.out.println("Starting Test Case :: " + autom8HomePath +"/"+ filePath);
String testCaseStatus = singleSessionTestRunner.executeSingleTest(autom8HomePath +"/"+ filePath);
System.out.println(filePath +" :: " + testCaseStatus);
if("FAILURE".equalsIgnoreCase(testCaseStatus)) {
SahiTestCaseStatus status = new SahiTestCaseStatus(filePath, testCaseStatus);
output.addFailedTestCases(status);

}

System.out.println(autom8HomePath +"/"+ RECOVER_AFTER_COMPLETION);
String refreshStatus = singleSessionTestRunner.executeSingleTest(autom8HomePath +"/"+ RECOVER_AFTER_COMPLETION);
System.out.println("Refresh Status :: " + refreshStatus);
}

String suiteStatus = singleSessionTestRunner.stop();
output.setStatus(suiteStatus);

The above code works well for Firefox and but does not work at all for Chrome where page does not load at all after login script. But if I record the same flow in Chrome it plays back correctly.

Please help me out here.

Regards
Goureya

Answers

  • Hi All

    Can anyone please help me in this ?

    Regards
    Goureya
  • globalwormingglobalworming Moderators
    edited December 2013
    Is the protocol switching to https after login? When you manually login, is the icon next to your URL showing certificate errors?
  • Hi

    There is no protocol switching. Somehow I have managed to get it work on chrome. If I set the URL from code, the scripts does not work. But if I set the URL manually, then everything works fine. But this works only in chrome but not in IE.

    Could there be some problem with navigateToURL() call?

    Regards
    Goureya
Sign In or Register to comment.