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 |
How to execute a WinRunner Script in QTP?
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.
how do check the links in a webpage ?
suppose i opened 6browsers and i want re-open the 4browser what is code for this..pls help me..
Hai anyone please "Explain about Framework in QTP?"
can u Give Procedure to Handle Pop Window & write Code for that
IF we use batch testing.the result shown for last action only.in that how can i get result for every action.
How we can test a Frame in a web page?
Why VB scripts are used in QTP and TSL in Winrunner, is there any advantage of using VB Scripts
what is profile tool?
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
How to find the length of the string in qtp?