Sunday, November 21, 2010

Beware of setting value in webedit using DOM

If you set value in a disabled webedit, QTP will throw the below error.


But do not enter value in webedit using DOM. The problem is: You can set value in web text box even it is disabled.
We have a work around for this.

Set obj=Browser("name:=Google").Page("title:=Google").WebEdit("index:=1").Object
If Not obj.disabled Then
obj.Value ="qtp"
End If
I always use DOM to retrieve text or count no. of objects. I hope this is helpful.

No comments:

Post a Comment