Identifying a wpfedit object in QTP 11
I'm having difficulty identifying a WPFEdit object in QTP 11. I can use the Add Objects to Local button to add it into the Object Repository, but when I use it's properties to script for it in MY Object Repository it does not recognize the object.
This is the User Name Text box in my application. It works perfectly fine for the password text box, but has an issue when it comes to the User Name text box.
Can someone help me out here?
Can u attach your screentshot.
did you try descriptive programming.?
I am using descriptive programming. I have defined an object in a library file which I have created.
"Set obj_txtUsername = obj_winYakidooDocView.WpfEdit("name:=", "devname:=UserName")"
Then I use the defined object to set a value to it.
The problem is when I check the existence of obj_txtUsername it returns False.
I used the same technique to define the password text box and to set a value to it and it worked perfectly fine.
I checked all the properties of the object against the properties in the local object repository after capturing it and there is no difference in the attribute properties.
Do you have the definition for all Objects in the Library file? Can you check for the existence of the Parent Object of obj_txtUsername?
Originally Posted by HishSingalaxana
Use obj_txtUsername.RefreshObject before checking exist
Did you guys observed, there no value for "name" property. I hope this is causing the problem?
Set obj_txtUsername = obj_winYakidooDocView.WpfEdit("name:=", "devname:=UserName")
I used the below script for textbox input using descriptive programming.
Set odesc = Description.Create()
odesc("slvtypename").value = "edit"
Set pge = Browser("name:=Goods Inward Note Module").Page("title:=Goods Inward Note Module").SlvWindow("slvtypename:=window").ChildObj ects(odesc)
ct_val = pge.count
For j = 0 to ct_val-1
Vendor_val = pge(j).getroproperty("attached text")
If Vendor_val = "DC No : " Then
dc_val = myxlsheet.cells(i,2).value 'Excel file Input assigned to one variable
Check any property, name, devname, attached text anything. but in your code name property value is null. so the object is not identified some time.