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.

Browser refresh and browser.close

AkshadaAkshada Members
edited November -1 in Sahi - Open Source
Hi All,

I am using centOs, firefox browser, Latest sahi jar.
On browser.close(), for every script, the browser does not close.So i have to run a single script and test.

There is a script which requires, Login> logout> login, For which on first logout the script doesnot login again.
I have tried refreshing the page using,

Browser.execute("top.location.reload()")
Browser.execute("history.go(0)")

But it is not refreshing the page.

PLease suggest the solution.
Thanks in advance,

Regards,
Akshada

Comments

  • Hi Akshada,

    1.If you are using a suite, Sahi will automatically close windows after a test.

    Could you please post the <browserTypes> contents by clicking on the Configure on the dashboard.
    Also, have a look at : http://sahi.co.in/forums/viewtopic.php?id=2272

    2.Try with

    Browser.execute("history.go(-1)");

    This might help you.

    Regards,
    Theeran.
  • HI Theeran,

    For firefox:10.0.2, Windows 7, the refreshing is not working.
    I tried with what u suggested still not refreshing. On manual refresh(pressing F5), the url gets reloaded and the script works.

    Thanks a lot for the reply.

    Regards
    Akshada
  • globalwormingglobalworming Moderators
    edited March 2012
    Hi

    you could try _navigateTo(document.location.href, true);
    Documentation says this would reload the page.

    http://sahi.co.in/w/browser-action-apis

    Regards
    Wormi
  • Hi Globalworming,

    I tried that too but it does not work.
    I have found a workaround for this problem, i am closing the browser itself and opening it again.
    Although it is not a good approach but time being i can live with it.

    Any more suggestions are welcome.

    Thanking you,
    Akshada
  • Hi,

    I tried editing "firefox.sh" to "firefox". Still my browser does not close on its own after every single script.
    I have to comment all scripts and run a single script everytime.

    Thanks in advance.

    Regards,
    Akshada
  • Hi All,

    If i try to run the same script on windows (windows 7, latest sahi jar, Firefox 10), the browser closes and opens up for every script in the test suite.
    Just on Centos, firefox 3.6 i am facing this issue. Firefox prompt is displayed, saying "Close existinf firefox to open a new one".

    How to go ahead with this? As i have written a test suite which contains around 50 scripts. It gets tedious to comment each script for testing scripts.
    Does it have something to do with the Operating system?

    One more request. Some spams are observed (Just the one above my comment). Please delete the spam.
    Thanks and regards,
    Akshada
Sign In or Register to comment.