How to check two possible resulting pages?

Advanced programming using WinTask scripting language

How to check two possible resulting pages?

Postby Kerm on Wed Oct 21, 2015 9:42 am

Hi,
When I click submit on a first page, there are two possible resulting pages. I would like to check for specific strings in specific places in the text. Is there a way to cleanly do this. Something like:

If PageContains(“Stringone”) then
Else if PageContains(“Stringtwo”) then
Else
‘Error or new situation
End if
Kerm
 
Posts: 27
Joined: Tue Oct 18, 2005 4:27 pm

Re: How to check two possible resulting pages?

Postby TechSupport on Fri Oct 23, 2015 9:51 am

Hello,

The best way is to use ExistHTMLElement function. You Spy the first element which tells that first string is there and use the generated HTML descriptor in ExistHTMLElement. Same for the second string, and then you can use an If block:
If ExistHTMLElement("descriptor string1") = 1 then
'I'm on page with string1
EndIf

Regards.
WinTask Tech Support
TechSupport
 
Posts: 805
Joined: Thu Nov 16, 2006 9:58 am


Return to Scripts programming

Who is online

Users browsing this forum: No registered users and 3 guests

cron