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.

Will sahi automatically wait for the page load ?

vijaikmvijaikm Members
edited November 2013 in Sahi - Open Source
I am using sahi open source version 4.4,

I have the following statements:

_click(_submit("Search"));
_wait(10000);
_click(_link("Simple Task_1[2]"));

I want to eliminate this wait, as the search will some time take 10 sec and some time may take 50 sec depends on the data.

I have also tried wait with a condition _wait(10000, _link("Simple Task_1[2]")). In this case which ever happen first will be executed.

can Wait statement be completely avoided? Which version of sahi will automatically wait for the page load?

I just want two statements for this,

_click(_submit("Search"));
_click(_link("Simple Task_1[2]"));

is this possible?

I am getting a failure when I use this, particularly when the data is huge.


Best Answers

  • Generally sahi internally waits for page loads, or u Can try changing this in sahi.properties file:-
    script.max_cycles_for_page_load, but this might affect in all the places rather than if u want only in this particular search u can standardize a wait time and use _wait($standardtime, _exists(_link(""))
    or _wait($standardtime, _isVisible(_link(""));

    Regards,
    Bhavitha
  • Thanks Ashokan
  • Answer ✓
    thanks

Answers

  • Hi Bhavitha,

    Can you pleae let me know what is default wait time for sahi for page load?
    i.e if a page doesnot load forever does sahi wait forever or does the script fail after some time? if it fails after some time can you please tell me after how much time?
  • Default time is 150 seconds, if not then time out error will appear as : step < did not complete in 150 seconds.
  • can you please tell me where is the time set to 150 sec ? i mean is it set in the userdata.properties file or some where else?
  • Sorry in sahi.properties file or some where else?
  • it's in sahi.properties file.
    To set page load time, either increase script.max_cycles_for_page_load or script.time_between_steps. here is the formule below
    #Time spent is (script.max_cycles_for_page_load x script.time_between_steps) milliseconds
    -Thanks
    Ashokan P
  • closing the discussion
This discussion has been closed.