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?
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.
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.
Please sign in to leave a comment.