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.

Wait for particular page to come avaliable

b1833b1833 Members
edited November -1 in Sahi - Open Source
I am doing a search in google. When I click on one of the results and that page loads, I want my sahi script to scrape some data. Then I want to hit the back button to the search results where I manually click on another results. I want the script to automatically scrape data again, then go into a waiting mode again. This will happen over and over.

Can you give me some directions as to how to get a script to be waiting for something on a page, until it comes up, regardless of the surfing. Then once it scrapes, can sahi hit the browser back button and go into wait mode again?

Thanks,
Duane

Comments

  • Hi b1833,

    You can use:

    _wait(timeInMilliseconds, condition) ;

    For more Details:

    http://sahi.co.in/w/_wait

    Also, if you want to click on back button you can use the following script:
    <browser>
        function goBack(){
            //history.back();
            window.history.go(-1);
        }
    </browser>
    
    _navigateTo("http://sahi.co.in/demo/");
    _call(goBack());
    

    Let me know if you are facing any problem.

    Regards
    Sumitra
  • How could I put this into a functions file to _include with my scripts?
Sign In or Register to comment.