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.

How to refresh sahi browser?

shashi007shashi007 Members
edited August 2013 in Sahi Pro
Hi All,
How to refresh sahi browser? Because after logout, sahi stops playing and when i manually refresh the browser it again starts playing.
Issue persist for chrome browser. In firefox, sahi automatically refreshes the browser
Thanks in advance.

Best Answers

  • Hi Shashi,
    Please try using the following command:
    _execute(location.reload());
    

    Regards
  • Hi Shashi,
    Try using :
    browser.execute("location.reload()");
    
    OR
    browser.executeStep("location.reload()");
    

    Let me know if it works for you.
    Regards.

Answers

  • Hi Pratyush,
    Thanks for replying.
    If possible, can you please write using java.

    Thanks
  • Hi Pratyush,
    browser.execute("location.reload()"); is working fine for refrsh.

    But in my case after logout, sahi stops playing and even refresh command does not work.
    When i manually refresh the browser it again starts playing.

    Thanks.
  • Hi,
    Can you provide the URL of your page and your script?

    Regards.
  • shashi007shashi007 Members
    edited August 2013
    Hi,
    url is : http://www.explic8.com

    Code:

    Browser browser=null;
    for(int i=0;i<2;i++){
    browser= new Browser("firefox");
    // browser= new Browser("chrome");
    // browser= new Browser("opera");

    browser.open();
    browser.navigateTo("http://www.explic8.com ");
    browser.execute("location.reload()");

    try {
    Thread.sleep(4700);
    } catch (InterruptedException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }

    browser.execute("location.reload()");
    browser.close();
    }

    For firefox, above code is working fine but for chrome it is not working.

    Thanks.
Sign In or Register to comment.