Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, windows and java based applications. Get your 30 day free trial.
Discuss your Sahi Pro usage patterns, best practices, problems and solutions. Help others solve their problems and seek help from the community when needed. If you need specific support on your application, please email support @ sahipro.com
Discuss your Sahi Pro usage patterns, best practices, problems and solutions. Help others solve their problems and seek help from the community when needed. If you need specific support on your application, please email support @ sahipro.com
facing Error while trying to retrieve some data from popup window!!!!
Akss004
Members
Hi Narayan,
I am facing some issue while dealing with popup window. I am able to click on button and enter value in text box of popup window.
but when i am trying to use some _exists,_isvisible or _getText kind of function to verify some data or retrieve some data from pop up window.
Execution is getting failed and sahi log file giving error like
"JSERROR
TypeError: Cannot call method "_getText" of undefined"
Some portion of my script which is getting failed is as below.
"
_click(_popup("DailyPunchEntries")._button("Edit Punches"));
var $temp = _popup("LongJump")._getText(_textbox("PunchNote"));
"
take a note that i am able to set the value of _textbox("PunchNote")....but can not retrive it. And also if i copy paste same in sahi controler and "TEST" it from there its working fine. but problem occurs while executing this two lines as script.
Can you please take a look at this ??
Suggest me if is there any work around this issue and also if i m doing something wrong with above code....
I am facing some issue while dealing with popup window. I am able to click on button and enter value in text box of popup window.
but when i am trying to use some _exists,_isvisible or _getText kind of function to verify some data or retrieve some data from pop up window.
Execution is getting failed and sahi log file giving error like
"JSERROR
TypeError: Cannot call method "_getText" of undefined"
Some portion of my script which is getting failed is as below.
"
_click(_popup("DailyPunchEntries")._button("Edit Punches"));
var $temp = _popup("LongJump")._getText(_textbox("PunchNote"));
"
take a note that i am able to set the value of _textbox("PunchNote")....but can not retrive it. And also if i copy paste same in sahi controler and "TEST" it from there its working fine. but problem occurs while executing this two lines as script.
Can you please take a look at this ??
Suggest me if is there any work around this issue and also if i m doing something wrong with above code....
Comments
or
Regards,
Narayan
Thanx for you quick help this things has worked here in my case And problem has been solved.
One more thing i would like to ask that this command you have suggested "_selectWindow();" is not found on SAHI 's website.
"http://sahi.co.in/w/sahi"
Can i know is there any other wiki kind of thing exist for SAHI command?
Cause that will help me and other users a lot if they found such all command at one place.
We sometimes release some APIs but wait for feedback from selective users before we disclose them publicly. _selectWindow has been recently added. We will be updating the online docs soon.
Regards,
Narayan
you can use feature suggested by Narayan in above post.
for e.g.
_selectWindow("PopUp window name");
.
.
.
_selectWindow();
in between this two command you can write your normal sahi command(without adding 'PopUp()' prefix) to fill the textbox of popup window.....or get some text from the same.
for e.g.
_selectWindow("PopUp window name");
_getText(_textbox("BoxName"));
_selectWindow();
now this _textbox("BoxName" ) is on popup window but after using above
_selectWindow("PopUp window name");
command you can use this command as you perform in normal window or browser.