How to fetch web elements count from Google Page which
contains letter "e"
Answers were Sorted based on User's Feedback
Answer / aiswaryan
Set googlePage = Browser("title:=Google").Page
("title:=Google")
Set objDesc = Description.Create
objDesc("micclass").value = "WebElement"
objDesc("innertext").value = ".*e.*"
weCount = googlePage.childobjects(objDesc).count
msgbox weCount
Is This Answer Correct ? | 9 Yes | 0 No |
Answer / gyanesh ranjan rout
Set oBrowser=Browser("name:=Google").Page("title:=Google")
Set objDesc=Description.Create()
objDesc("MicClass").value="WebElement"
objDesc("innertext").value = ".*e.*"
set tot=oBrowser.ChildObjects(objDesc)
x=tot.count
msgbox(x)
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / aiswaryan
'Try below code
Set oelement=description.Create
oelement("micclass").value="WebElement"
set elements=Browser("Title:=Google").page
("Title:=Google").ChildObjects(oelement)
cnt= elements.count
For i= 0 to cnt-1
elementname=Browser("Title:=Google").page
("Title:=Google").WebElement
("micclass:=WebElement","index:="&i).getROproperty
("innertext")
Next
Is This Answer Correct ? | 1 Yes | 2 No |
Answer / bibhu
Thanks Aiswaryan,
How ever I was trying another way instead of using Regular Expression. --
Set oelement=description.Create
oelement("micclass").value="WebElement"
Set elements=Browser("Title:=Google - Windows Internet Explorer").page("Title:=Google").ChildObjects(oelement)
cnt= elements.count
For i= 0 to cnt-1
elementname=elements(i).getROproperty("innertext")
Next
My approach was here to store all webements in variable elementname & then using instring ot mid to fetch the count.
But I am getting a 'General Run Error' at the GetRoproperty line.
Is This Answer Correct ? | 0 Yes | 2 No |
Explain runtime dynamic settings?
In a webtable, lets say there are 10 records and 1 column. let say "image" is available for 1st,2nd and 3rd records and 4th onwards image is not available. How to recognise for that cell image is available or not?
What is object spy in quicktest professional?
Explain features of the latest version of qtp/ uft 12.1?
How to convert non-reusable action into reusable action in QTP?(i know by default QTP will take it as a non-reuable action )(Chandana) plz urgent?
What exactly is the difference among all the three recording modes.
write a script to verify links on any web page by using descriptive method by creating a description object (give a filter condition only link) ... need to verify expected like name by reading
How to use transactions in qtp?
How to create log file in qtp?
what are the metrics in general we use in testing
Please mail me the license key of QTP 9.5 t v.sadangi@gmail.com ????? thx
Please provide specific examples of advanced/creative usage of QTP, including how impact & benefits for your project