Unable to validate text in website Popup

Ranorex Spy, Recorder, and Studio.
darin
Posts: 3
Joined: Thu Jun 06, 2013 9:40 pm

Unable to validate text in website Popup

Post by darin » Thu Jun 06, 2013 10:24 pm

I am having trouble with validation of text in a popup from a web application. Please let me know what information would be help to anyone desiring to assist me.

Thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Unable to validate text in website Popup

Post by Support Team » Fri Jun 07, 2013 7:01 am

Hello,

Could you please provide more information concerning this issue?
Additionally, could you please post a snapshot file and specify which text you want to validate?
Thank you!

Regards,
Bernhard
.
Image

darin
Posts: 3
Joined: Thu Jun 06, 2013 9:40 pm

Re: Unable to validate text in website Popup

Post by darin » Wed Jun 12, 2013 5:59 pm

We have certain error responses to incorrect actions in areas of our web applications. I want to be able to execute the action and verify the proper error response is given.

I hope I created the snapshot correctly. I noticed that the images of the popup are not shown in it. I also attached a jpg of a screen shot.
Attachments
Popup.jpg
Popup.jpg (171.04 KiB) Viewed 1351 times
Popup_snapshot.rxsnp
Ranorex Snapshot
(216.59 KiB) Downloaded 175 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Unable to validate text in website Popup

Post by Support Team » Thu Jun 13, 2013 4:27 pm

Hello,

Thank you for the Ranorex Snapshot file. You can validate the text using the attribute "InnerText".
The RanoreXPath of the specific element is the following.
/dom[@domain='ufcw1439benefits.rehn.local']//label[#'_popup__lblPopupMessage']
If the message occurs randomly I would recommend to use the "PopupWatcher class".
Please read the section "Handling unexpected Dialogs" in order to get more information how to use this class.
Please let me know if you need more information or assistance.

Regards,
Bernhard
.
Image

darin
Posts: 3
Joined: Thu Jun 06, 2013 9:40 pm

Re: Unable to validate text in website Popup

Post by darin » Wed Jul 24, 2013 8:44 pm

Hi Bernhard. Forgive the late response to your post. I do see the path to the element but do not see how to reference the attribute "InnerText". When I inspect the element it shows the inner text.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Unable to validate text in website Popup

Post by Ciege » Wed Jul 24, 2013 9:33 pm

Just get an object variable pointed to the element then get the text from object.innertext
i.e.

Code: Select all

string strMyString = myLabelObject.InnerText;
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...