Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is the best way to validate text in a web page using QTP
#1
Not Solved
Hi,
Open Gmail login page and click sign-in without entering credentials. Error message will be shown as "Enter your email address.". I want to validate this error message. What is the best way to automate this.
Please dont write oneliner that use regualr expression. Please write the code if regexp is required or not required. I tried the following and it is working. But i dont think it si the better way . If you have a better solution, please do sent it.
Code i used.
<<<<<<<<<<
Code:
Dim ExpectedString, Entirestring
ExpectedString = "Enter your email address."
Entirestring= Browser("Gmail: Email from Google").Page("Sign_In Page").GetROProperty("innertext")
If (InStr(1, Entirestring, ExpectedString,1) >1) Then
    msgbox("Text found")
    
Else
    msgbox("Text Not found")
End if
>>>>>>>

Thanks
krish
Reply
#2
Not Solved
Obviously no one will write oneliner for you as - "use regular expression" instead i may write "try using checkpoints"

btw, why do you think that its not a better way. it seems ok to me.

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  click each web link in a page using Index or other method in QTP smeijer 13 24,820 04-29-2017, 04:53 PM
Last Post: kowshik
  How to validate mandatory filed (*) in web application using balak89 1 4,150 09-13-2015, 12:54 AM
Last Post: ADITI1992
  Need to Validate Text filed is blank after clicking on the Text box balak89 3 4,974 09-13-2015, 12:06 AM
Last Post: ADITI1992
  VB Script to count number of links in a web page. Suma Parimal 4 25,377 07-01-2015, 12:59 PM
Last Post: govind
Smile Need to validate a .txt file and .jpeg image. aman8604 0 2,384 04-09-2015, 11:33 AM
Last Post: aman8604

Forum Jump:


Users browsing this thread: 1 Guest(s)