Answered

Get_Web_Value boolean calls

I have a GET_WEB_Value call which I have set up to return a boolean value.   The call is being made to a page in a second tab.    The purpose of the call is to determine whether the new page is a login page or a logged into page.

Normally if I use a GET_WEB_Value call which returns a boolean, if the item I am looking for is present the test passes and it returns a true.  If the item is not there, the test passes and it returns a false.

I am using "Popup" indicator in my locator to point me to the potential login page.   If I issue the GET_WEB_Value call and the login page is present, the the call passes and returns a true.   If the login page is not present but the logged in page is, the GET_WEB_Value call Fails and nothing is returned.

Am I using GET_WEB_Value incorrectly, or is this a bug?

0
5 comments
Avatar
William Smith

The difference in behavior appears to be when the Popup indicator in the locator is used.

 

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi William,

Just to confirm, are you using only Popup field in the web locator form and the remaining fields are blank?

In other words, you are only using the web locator to find the page name using Popup field, not find an actual element?

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
William Smith

No, I am using the Popup field to specify the page, and the XPath field to find the element.  I suspect that what is happening is that the popup field is not finding the page and I never get to the element search.   That is probably the reason for the Failed call.

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Wiliam,

Yes that's exactly what would happen. To work around that, you can use Switch_Window with index (whole test case option enabled) instead of using Popup field. This will always direct you to the page that opens next and you can try finding the web locator. When it's not found, you'll get the 'false' value. If after that you would like to close the popup with Close_Popup command, you can add another Switch_Window to return to Main.

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
William Smith

I thought about that, but I don't always know for sure that the page will be tab2.  It might be tab3.  

What I did do was pre-set the result value variable to false.  Then execute the get-web command with an always pass option.   If the get_web passes then the variable is set to true.  If it fails, then the item is not set to a new value. 

That works well, and if for some reason the web page is not in one of the two states expected, additional testing down the line will fail.

 

0
Comment actions Permalink

Please sign in to leave a comment.