Micro Focus QTP (UFT) Forums
WebElement - 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: WebElement (/Thread-WebElement)

Pages: 1 2


RE: WebElement - rajpes - 07-14-2011

spy it and check which is the row number, column number for the objects you want to perform
Or use
Code:
"Browser("").Page("").WebTable("WebTable").ChildItem(1,1,"WebEdit",0).Highlight
and see where it highlights to make sure the row,col numbers used are correct.

And if there are many such fields to be set you can use a loop to iterate over rows and columns using
Code:
Browser("").Page("").WebTable("WebTable").Rowcount
Browser("").Page("").WebTable("WebTable").Columncount (row)[hr]
By the way if it is throwing error in that line,either the row/col numbers are not correct or the object is not webedit but something else, check it!


RE: WebElement - Langxii - 07-15-2011

I still got run error on object
Code:
(Browser("").Page("").WebTable("WebTable").ChildItem(2,5,"Webedit",0).set"1.1"
1) I checked row column postion is correct (by putting for loop and use getcelldata).
2) Also I can get index of cells is 0 , it means that there is one webedit object .
I am not sure why throwing error but I can't find out.
Would you help please? Thanks.


RE: WebElement - rajpes - 07-15-2011

Then it doesnt seem to be a webedit object itself! spy it to check whether it shows webedit or webelement or anything else


RE: WebElement - Langxii - 07-19-2011

Code:
Set ob1 = Browser("").Page("").WebTable("WebTable").ChildItem(2,5,"WebElement",0)
ob1.click  ----> this one works
but
ob1.set "ABC"  -> object doesn't support this property "set"

2)
Code:
webelmno=  Browser("").Page("").WebTable("WebTable").ChildItemCount(2,5,"WebElement",0)  (it returns to 1)
but i change to webedit  ->       Browser("").Page("").WebTable("WebTable").ChildItemCount(2,5,"WebEdit",0) , it returns to 0

I knew that Webedit is embeddded to WebElement if i spied i use Ctrl- Click it shows Webedit.

Would you let me know how to set value to grid (2,5)

Thanks.
3) I am sure there is no webedit on the webtable
but not understand when i am using ctrl- click on the grid and spied it shows me webedit.

Would you let me know?


RE: WebElement - rajpes - 07-19-2011

did you check what code it is generating in recording to set that webedit in webelement?


RE: WebElement - Langxii - 07-19-2011

1) Yes, if i enter a value to first grid, it generated webedit(webedit)
If i enter a value to the second grid, it generated same webedit(webedit)
Browser("").Page("").WebEdit("WebEdit")
When it played back , doesn't enter values.....

2) The way i tried to find cell data (row, column) enter value into cell data doesn't work. As you saw that Browser("").Page("").WebTable("WebTable").ChildItemCount(2,5,"WebEdit",0) (it returns to 0)
3) When I spied grids has same name property (webedit). How can I isolate each webedit?
Thanks,




RE: WebElement - rajpes - 07-20-2011

I hope you used descriptive programming for this webelement properly.
As you said, during recording it is creating a webedit object, copy the same properties of that webedit to this webelement
Code:
Browser("...........").Page("....").Webelement("prop1:=prop1_value_in_object_repos","prop2:=prop2_value_in_object_repos").Click



RE: WebElement - prachi.aug23 - 07-20-2011

Have you tried 'Type' instead of 'Set'?



RE: WebElement - rajpes - 07-20-2011

You can't use 'Type' in Web applications