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

How to execute a WinRunner Script in QTP?

1 Answers   Crea,


Hi All, I wanted know how does QTP identifies a DataCombo. While recording I clicked on the data combo and selected a value from the list. The click of Data Combo is recorded but the selection of the value from the list is not recorded. My application is based on VB and SQL server as the database. Please let me know as how do I record the action of selecting a value from a DataCombo list. The list is being loaded from the Database Record set.

0 Answers  


how do check the links in a webpage ?

7 Answers   Accenture, Wipro,


suppose i opened 6browsers and i want re-open the 4browser what is code for this..pls help me..

2 Answers   Core Logic,


Hai anyone please "Explain about Framework in QTP?"

0 Answers  






can u Give Procedure to Handle Pop Window & write Code for that

2 Answers   CTS,


IF we use batch testing.the result shown for last action only.in that how can i get result for every action.

2 Answers  


How we can test a Frame in a web page?

1 Answers   eMids,


Why VB scripts are used in QTP and TSL in Winrunner, is there any advantage of using VB Scripts

2 Answers  


what is profile tool?

0 Answers   ITC Infotech, TCS,


How to extract the data in the below scenario and dump it in the excel? Link1 Link2 Link3 Link4 numberlink1 text text text numberlink2 text text text numberlink3 text text text numberlink4 text text text So, Here is my question? -- It is a matrix but is not a web table(QTP does not recognize it as a web table) -- Link1, link2 and link3 are links under which text is available -- numberlink1 to numberlink4 are again LINKS -- All the others displayed are text only I want to extract the data in the above scenario and dump it into an excel in the same scenario as it is displayed above. Kindly help.. Thank you

0 Answers  


How to find the length of the string in qtp?

0 Answers  


Categories