How to fetch web elements count from Google Page which
contains letter "e"

Answers were Sorted based on User's Feedback



How to fetch web elements count from Google Page which contains letter "e"..

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

How to fetch web elements count from Google Page which contains letter "e"..

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

How to fetch web elements count from Google Page which contains letter "e"..

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

How to fetch web elements count from Google Page which contains letter "e"..

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

Post New Answer

More QTP Interview Questions

Explain runtime dynamic settings?

0 Answers  


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?

2 Answers  


What is object spy in quicktest professional?

0 Answers  


Explain features of the latest version of qtp/ uft 12.1?

0 Answers  


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?

4 Answers   Wipro,






What exactly is the difference among all the three recording modes.

2 Answers   TCS,


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

0 Answers  


How to use transactions in qtp?

0 Answers  


How to create log file in qtp?

2 Answers   AppLabs,


what are the metrics in general we use in testing

1 Answers   Tanla Solutions,


Please mail me the license key of QTP 9.5 t v.sadangi@gmail.com ????? thx

0 Answers  


Please provide specific examples of advanced/creative usage of QTP, including how impact & benefits for your project

0 Answers   T Mobile,


Categories