you can also use the "Exist" method. A lot of time the text checkpoint
have issue where if the text in UI have leading and/or trailing
spaces, the checkpoint fails.
What i normally do is the following:
congratSorry = Browser("Browser").Page("Congrats").WebElement
("innertext:=Congrats").Exist(0)
If congratSorry Then
'if you want to add text verification
congrats = Browser("Browser").Page("Congrats").WebElement
("innertext:=Congrats").GetROProperty("innertext")
Trim congrats
If congrats = "Congrats" Then
Reporter.ReportEvent micPass, "The Congrats text
displayed as expected, congrats
Else
Reporter.ReportEvent micFail, "The Congrats text did
not display as expected, congrats
End If
Step X
Else
'if you want to add text verification
sorry = Browser("Browser").Page("Sorry").WebElement
("innertext:=Sorry").GetROProperty("innertext")
Trim sorry
If sorry = "Sorry" Then
Reporter.ReportEvent micPass, "The Sorry text
displayed as expected, sorry
Else
Reporter.ReportEvent micFail, "The Sorry text did
not display as expected, sorry
End If
Step Y
End If
On May 5, 4:08 am, Daim Phillips <[email protected]> wrote:
> Thanks
>
> On Thu, Apr 30, 2009 at 8:46 PM, Praveena <[email protected]> wrote:
>
> > Hi,
>
> > You can insert the text check while recording the script.
> > So, while recording your script, Go to QTP window, Insert - Text check
> > point.
> > Select the desired Text "Congrats or Sorry".
>
> > Thanks,
> > Praveena.
>
> > On Apr 28, 1:09 am, Daim Phillips <[email protected]> wrote:
> > > Thanks
>
> > > On Sun, Apr 26, 2009 at 3:00 AM, Roman Zilber <[email protected]> wrote:
> > > > object.GetROproperty("innerText")
>
> > > > for more infohttp://
> > msdn.microsoft.com/en-us/library/ms533054(VS.85).aspx<http://msdn.microsoft.com/en-us/library/ms533054%28VS.85%29.aspx>
> > <http://msdn.microsoft.com/en-us/library/ms533054%28VS.85%29.aspx>
>
> > > > On Fri, Apr 24, 2009 at 8:31 PM, Daim <[email protected]> wrote:
>
> > > >> Yes. It is a web application.
>
> > > >> I have gone through tutorials. That is why I at least know that It
> > > >> will be achieved through text checkpoint. But I am not sure how to
> > > >> capture that text so that I can use it in the If else condition
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
-~----------~----~----~----~------~----~------~--~---