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

can we do load testing , by using QTP......?

1 Answers  


Diff b/w Test Design and Test case design? What is the Design Review's and Code Review's. When will you conduct tese reviews?

1 Answers  


Can anybody let me know how to test the Drag and drop feature of the column in a .net application...eg..i hav to test the drag and drog feature of a table(swftable) in a application..plze help!!

0 Answers  


can we run the scripts of qtp 8.2 in the qtp7.0?

2 Answers  


what will be the stmt if record any edit box in the Web application ?

2 Answers   eSymbiosis,


describe some problems that u had with automating testing tool?

0 Answers  


Can we directly automate testscripts accrdoing to requirements? WHY ?

1 Answers  


Can the mode of object repository be change during run time? Eg. if the mode is per-action during design time can i change it to shared and vice-versa? Any scripting possible?

2 Answers  


what type of run time errors you get while you ar edoing rpg program?

0 Answers  


How can we perfom Action and Component parameter.?

1 Answers   EDS,


How to make arguments optional in a function?

1 Answers   IBM,


How can you send user defined messages to test report?

0 Answers  


Categories