18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
Bug - Sahi not executing for web app where server delays response.
I'll explain the scenario for which SAHI is not able to automate web application.
I've a GWT application and here is what is happening:
In our application, we made an enhancement where we send an ajax request to server and server hold that request for certain amount of time.
So here is the exact order of things:
1. Open a URL (eg. http://SERVER_IP/callcenter) and login page appears.
2. Enter username/password and click login button.
3. Just after login, client application sends multiple Ajax request to server and server holds that request. The home page appears but SAHI is not able to detect anything on that page (such as textbox, hyperlinks).
We performed a test to see till what time SAHI is not able to detect any element on home page and SAHI took 3 minutes to detect a hyperlink.
CAUSE:
We suspect that the reason why SAHI took 3 minutes is that it starts its execution only after our client app has finished sending all Ajax request and the moment SAHI sees that there are no more pending request, it then starts its automation process.
I've also tested that when we remove our feature (which enables our server to hold request) then SAHI executes everything smoothly.
MY DOUBT:
I have no clue right now why SAHI is taking 3 minutes to start its automation process on my web page. It seems SAHI is not able to handle our feature (holding ajax request).
Kindly let me know how can we make SAHI execute successfully in a scenario I've just explained?
Thanks,
Nitesh
I've a GWT application and here is what is happening:
In our application, we made an enhancement where we send an ajax request to server and server hold that request for certain amount of time.
So here is the exact order of things:
1. Open a URL (eg. http://SERVER_IP/callcenter) and login page appears.
2. Enter username/password and click login button.
3. Just after login, client application sends multiple Ajax request to server and server holds that request. The home page appears but SAHI is not able to detect anything on that page (such as textbox, hyperlinks).
We performed a test to see till what time SAHI is not able to detect any element on home page and SAHI took 3 minutes to detect a hyperlink.
CAUSE:
We suspect that the reason why SAHI took 3 minutes is that it starts its execution only after our client app has finished sending all Ajax request and the moment SAHI sees that there are no more pending request, it then starts its automation process.
I've also tested that when we remove our feature (which enables our server to hold request) then SAHI executes everything smoothly.
MY DOUBT:
I have no clue right now why SAHI is taking 3 minutes to start its automation process on my web page. It seems SAHI is not able to handle our feature (holding ajax request).
Kindly let me know how can we make SAHI execute successfully in a scenario I've just explained?
Thanks,
Nitesh
Comments
You are right in saying that Sahi waits for AJAX requests to finish, and since one of the requests is not finished, it keeps waiting.
It is possible to specify to Sahi to not wait for some AJAX requests.
1) Open sahi/htdocs/spr/concat.js
2) Search for
Sahi.prototype.isComet = function(u){
return /\/comet[\/.]/.test(u);
}
3) Add your URL pattern to it.
For example if your URL was http://server/xxx/mylongreq.jsp?ydasda
you could exclude any URL with "mylongreq" in it.
For that change the above code to
Sahi.prototype.isComet = function(u){
return /mylongreq|\/comet[\/.]/.test(u);
}
4) Restart Sahi, clear browser cache and check.
If you are unsure of the pattern to add, reply with your URL and I will suggest you the right pattern.
Regards,
Narayan
The change you recommended worked for me