How to check an object is not visible.
Hi All,
I am a very new to autoamtion and QTP.
Within a page, there are few sections. All these sections are visible for some users. However, some sections are not visible to some users.
Let's say, A page contain sections:
1) Checking
2) Saving
3) CD
I want to check that CD section is not visible.
Could you provide me instructions/tricks of how to verify object or text is not visible on the page.
Thanks
Re: How to check an object is not visible.
Capture the CD Section in Object Repository.
check for if its a Standard Control(Frame Probablyy...)
Adda CheckPoint to the Visible Property.
Regards,
Nawab
Re: How to check an object is not visible.
- Start QTP
- Start Page
- Start recording on QTP
- Click Checking, then click Saving, then click CD.
- Stop recording
- In QTP, switch to expert view, you should see something similar.
Browser("Your_Browser").Page("Your_Page").WebButton("Checking").Click
Browser("Your_Browser").Page("Your_Page").WebButton("Saving").Click
Browser("Your_Browser").Page("Your_Page").WebButton("CD").Click
- One method you can use, modify the above and assign ("visible") to a variable, for example:
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Variable listing
varChecking = Browser("Your_Browser").Page("Your_Page").WebButton("Checking").GetROProperty("visible")
varSaving = Browser("Your_Browser").Page("Your_Page").WebButton("Saving").GetROProperty("visible")
varCD = Browser("Your_Browser").Page("Your_Page").WebButton("CD").GetROProperty("visible")
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If varCD = True Then
MsgBox "The CD button was found on this page"
Else
MsgBox "The CD button was NOT found on this page"
End If
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[QUOTE=qtplearn123;29120]Hi All,
I am a very new to autoamtion and QTP.
Within a page, there are few sections. All these sections are visible for some users. However, some sections are not visible to some users.
Let's say, A page contain sections:
1) Checking
2) Saving
3) CD
I want to check that CD section is not visible.
Could you provide me instructions/tricks of how to verify object or text is not visible on the page.
Thanks[/QUOTE]