Micro Focus QTP (UFT) Forums
Verify that a dropdown Element is in Readonly mode with QTP. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Verify that a dropdown Element is in Readonly mode with QTP. (/Thread-Verify-that-a-dropdown-Element-is-in-Readonly-mode-with-QTP)



Verify that a dropdown Element is in Readonly mode with QTP. - nilanjans - 06-18-2012

How to verify a dropdown value is in Read only mode using QTP?

Here in my application there is a dropdownlist whose value is set to "Yes" as per the Test cases.

Now after submitting the form that consists that dropdown , we have to open the form again(via any link that has stored in some inventory) and have to check that the dropdown exists and its value is set to "Yes" and it is no more editable.(read-only mode)

But at the time of opening the form back again we found that , it is no more dropdown list element, rather than it is a webelement. And I checked the GetRoProperties too, but did not find any suitable property to verify that.

So now what should the appropriate way to verify such scenario?

Can anyone please help me out with their knowledge?


Regards,
Nilanjan.





RE: Verify that a dropdown Element is in Readonly mode with QTP. - Ankesh - 06-18-2012

Could you please paste the snapshot of object spy for that object?


RE: Verify that a dropdown Element is in Readonly mode with QTP. - Ankesh - 06-20-2012

Okay...Go ahead with the validation. If it is no more a weblist, dont worry abt it. Check whether it is a webelement or not instead. Usually Webelemts are read only/static values only. So you can validate this.
Do post if you find any alternate solution for this.


RE: Verify that a dropdown Element is in Readonly mode with QTP. - nilanjans - 06-22-2012

Yes..I just thought that only..as it is webelement so it is supposed to be in read-only mode.
Still added that web-element in the repository (shared), and took the "innertext" and "outertext" via getROProperty and stored in two variables.

And then checked as both are "Yes", so proper value got saved and in read-only mode.

Please let me know if u found any better.

Thanks,
Nilanjan.


RE: Verify that a dropdown Element is in Readonly mode with QTP. - Ankesh - 06-22-2012

One alternate way would be using the error handling method.

You can try to set the value in the object. and check for error. If any error is thrown, the object is read only.
Code:
On Error Resume Next
Browser("").Page("").WebElement("").Object.text=<Some Value>
IF Err.Number<>0 Then
msgbox "Object is read only"
Else
msgbox "Values set successfully"
End If

You can try the above method.

Regards,
Ankesh



RE: Verify that a dropdown Element is in Readonly mode with QTP. - nilanjans - 07-02-2012

Hi Ankesh,

Sorry for being reply ,checked this bit late. Your solutions seems the better one.

Verified it on my application and it worked fine.

Thanks for your help.

Regards,
Nilanjan.