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.
Sahi V35 -Time out message when running scripts for child window
Hi,
I created a script in sahi v3 which clicks and opens up a child window, and then verifies the child window elements. It was working fine in V3. Recently I moved on to sahi V35, it times out after opening child window. But If I click pause, step, play button in this sequence, it succeeds.
[In my application child window opens very fast, no wait needed.] Still I tried with _wait, changing sahi config, but it fails.
Suite also fails at this point, I could not use the latest version.
_click(_link("Settings"));
_log("on the user settings ","custom1");
//following is for child window, sahi waits for a long time and then fails
_assertExists(_span("User Settings"));
msg on log
Step >_sahi._log("on the user settings ","custom1");< did not complete in 150 seconds. at
thanks
Zeren
I created a script in sahi v3 which clicks and opens up a child window, and then verifies the child window elements. It was working fine in V3. Recently I moved on to sahi V35, it times out after opening child window. But If I click pause, step, play button in this sequence, it succeeds.
[In my application child window opens very fast, no wait needed.] Still I tried with _wait, changing sahi config, but it fails.
Suite also fails at this point, I could not use the latest version.
_click(_link("Settings"));
_log("on the user settings ","custom1");
//following is for child window, sahi waits for a long time and then fails
_assertExists(_span("User Settings"));
msg on log
Step >_sahi._log("on the user settings ","custom1");< did not complete in 150 seconds. at
thanks
Zeren
Comments
These are the steps which fails intermittently for sahi v35. In my case, child window is not a new browser.
In sahi V3, it is stable.
_click(_link("Settings"));
_log("on the user settings ","custom1");
//following is for child window, sahi waits for a long time and then fails
_assertExists(_span("User Settings"));
Kindly help me:
1. I have a window-A - I fill all the details and Click on Submit button.
2. A new window-B open up.
Expected Result - I have to capture the URL of new window-B (this is dynamic URL everytime).
Issue: It gives me the URL of Window-A instead of Window-B (it is focusing it to Parent Window not to Child Window)
How to point on Child Window - any command or solution.
************Script Written*********
_click(_link("Data Grapher"));
_setValue(_textbox("beginDate"), "2011-12-20");
_setValue(_textbox("endDate"), "2011-12-20");
_setValue(_textarea("servers"), "A/B/C");
_click(_submit("Submit"));
_wait(1000);
var $pageURL = _eval('window.location.href');
_alert($pageURL);
After filling the details and Click on Submit button, if a new window B is opened, then the actions performed on new window B will be prefixed with _popup("identifier").
Ctrl+Hover on any element on the popup window and check what the element is prefixed with.
Use the identifier in _selectWindow
Your script should be:
Check if this solves your issue.
Regards
Sumitra
Not resolved my issue - in alert message it is still giving me the Parent window's URL.
This is not a pop-up window. its a complete new window opening with dynamic URL.
I can't use _selectWindow("popWin") or _navigate as i don't know the URL.
Actually when I clicked on the Submit button on current window , a new window open with dynamic URL.
Now this window always come with new or dynamic URL and I have to capture this new URL so that using this URL i can further work on my sahi script.
but as of now i am getting the parent window's URL.
Kindly let me know without knowing the URL of Child's window how SAHI can run the window.location.href and provide me the URL of Child's window.
please help me on this.
Sorry for the wrong code mentioned above.
The code should be:
Check if this solves your issue.
Regards
Sumitra
getting following error in Log:
_click(_submit("Submit")); at Dec 22, 2011 6:14:26 PM
_wait(1000); at Dec 22, 2011 6:14:27 PM
_popup("popWin")._sahi.setServerVar('\$pageURL', document.location.href);
Window/Domain not found: popupNameFromStep=popWin; derivedName=;
windowName=; windowTitle=Distributed Native Tools - DNT Portal; wasOpened=0;
domain=dnt.bankofamerica.com at Dec 22, 2011 6:14:49 PM
This time alert is also not coming. Just let me know how to point or focus to new window and read the new window's URL.
Please do the needful, I am very thankful to you for your spontaneous response.
*script****
_click(_link("Data Grapher"));
_setValue(_textbox("beginDate"), "2011-12-20");
_setValue(_textbox("endDate"), "2011-12-20");
_setValue(_textarea("servers"), "A\B\C\D");
_click(_submit("Submit"));
_wait(1000);
_selectWindow("popWin"); //selects the child window
_set($pageURL, document.location.href); //stores the pageURL
_alert($pageURL);
_selectWindow(); //Selects the base window
Here is an example which i tried and works for me.
Also, try using _selectWindow("/popWin/"); and check if this solves your issue.
Check if you can find some idea as how to get the url of the new window opened.
Also, check if you are able to identify elements on the new window?
What version of Sahi are you using? If you are still facing issue then we can have a desktop sharing to see what is happening.
Regards
Sumitra
Thanks for your support.
Just one help - do we have any function so that i can scroll down in a window at a particular point. simply scrolling down in the window.
Regards,
Vijay
You can use
_call(window.scrollTo(xpos, ypos));
Regards,
dkulkarni