Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Verify that a dropdown Element is in Readonly mode with QTP.
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
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.


Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Could you please paste the snapshot of object spy for that object?
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
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.
Reply
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
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.
Reply
#5
Solved: 11 Years, 3 Months, 4 Weeks ago
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
Reply
#6
Solved: 11 Years, 3 Months, 4 Weeks ago
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How do you Change Run mode mid script? Caleytown 6 7,233 03-25-2021, 08:27 AM
Last Post: RB26578
  Different Type of Dropdown Selector zunebuggy 6 3,425 05-01-2018, 06:46 PM
Last Post: zunebuggy
  Page element keep changing chong67 4 4,640 11-08-2016, 09:17 PM
Last Post: Paul Rammone
  [UFT] [WPF] Verify if the cell contains an image robertosalemi 0 1,902 10-25-2016, 06:57 PM
Last Post: robertosalemi
  Choosing element from array marvson 1 1,908 06-29-2016, 02:55 PM
Last Post: Ankesh

Forum Jump:


Users browsing this thread: 1 Guest(s)