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

What is Test Fusion Report in QTP?

0 Answers  


In real time whenever we found bug , after that where you send to that bug. send to T.Lead or Directly Developer. Plz explain me?

2 Answers  


In what situations QTP will not recognize the Objects?

6 Answers   Wipro,


How to Compare two database tables by using QTP?Please give me code details.

1 Answers  


How to create an instance in QTP?

1 Answers   Collabera,






Is there is any method how to connect remote desk throw QTP if yes please answer with a example?

3 Answers   HP,


Can any give an example(if possible templates) how to test web application using QTP. thanks in advance

0 Answers  


Shared Object Repository is preferable while dealing with dynamic objects ok? descriptive prog also same? ok but why descriptive?(only for w/o application)

2 Answers   IBM,


can any body clearly explain about hybridframework with the explanation for files what ever we come acros in this frame work?

4 Answers   Wipro,


When testing a web application, the url for each page changes, so using QTP how do u handle this scenario. If anyone knows please answer in detail about the whole procedure. Thanks a lot.

3 Answers  


Which version of QTP is using by companies nowadays?

4 Answers  


I am Facing Issues with learing datepicker 1)when i first learn datepicker as current system date . 2)if i wanna runtime datepicker value it gives error

0 Answers  


Categories