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

I hav installed QTP8.2, im working on webapplication, while running the script giving error msg like "QTPro.exe generated errors and will be closed by windows. You will restart the program. An error log is being created". Pls anybody what is the problem, what i have to do for this? Thanks...

0 Answers  


It is given in the help of QTP 9.2 that we cant debug the scripts. Is there any other way to VIEW, PAUSE and make modifications in the scripts during execution???

0 Answers  


Subj: realtime example of Database check point, Can any one please detail on how the Database check point is utilized/implemented in a real time project. I already know how to make one by creating DSN/ODBC and writing the required query manually and other steps...I wanted the actual concept of implementation...couple of live examples will be highly appreciated. Thank you in advance

0 Answers  


we add library file used in test via settings or through "ExecuteFile" command. when we implement framework do we make common library file and load the same for all the test cases execution?

0 Answers  


In QTP TEST DIRECTOR COMBINATION WHAT IS THE PURPOSE OF TEST DIRECTOR? In Somebody says to store test cases and design test cases.?ok fine , but In test director 5.0 , QTp not launching. what u do?

0 Answers  






In a web site, Protocal has been changed http: to https: what is your approach?

2 Answers  


What is active screen?

0 Answers  


I have an application running in Linux server. I am reaching the application through emulators like telnet. My operating system at the client side is Windows XP. Using emulator I am connecting the Linux server and working on the application. Can I automate the testing of the software running in Linux server using QTP. In short, does QTP support the applications running in Linux servers.

1 Answers  


There is web page with the webtable,this contains some data, how do you manipulate the data.

2 Answers   Tech Mahindra,


How to make arguments optional in a function?

1 Answers   IBM,


Is the provision for integrating QTP with QC ,available from the version 9.0 onwards only or even 8.2 version has such provisions?

1 Answers  


Hoe can we do retesting using functions please give the code for it using login page

0 Answers  


Categories