Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using static descriptive programming how to count no. of objects on any webpage
#1
Not Solved
Hi,
I wanted to count no. of objects on Google homepage using static programming, i mean without creating object first(the way we do in dynamic one).


Pls tell me what is wrong in below statement


Code:
Set P = Browser(creationtime=0).page(tile=Google).WebButton(type=submit, html tag=INPUT)

MsgBox P.Count()




Pls help

Thanks
Reply
#2
Not Solved
Try this. Might Help.

Code:
Set P = Browser(creationtime=0).page(tile=Google).Chieldobjects(WebButton(type=submit, html tag=INPUT))

MsgBox P.Count()
Reply
#3
Not Solved
Hi,
Thanks, I tried this,

Code:
Set P = Browser("creationtime:=0").page("title:=Google").Childobjects(WebButton("type:=submit", "html tag:=INPUT"))

MsgBox P.Count()

It gives count as 62. And we obviously don't have 62 webbuttons on Google homepage, When I also added property value "name:=Google Search" still gave count as 62 when only one 'Google Search' button is thr on google homepage. Is above code giving total no. of all child objects on homepage. pls see attachment

So, how to retrieve count specifically for any object like webbutton, links etc using static programming.

Thanks for the help!


Attached Files Image(s)
   
Reply
#4
Not Solved
Hi Guys,
Pls help!
Reply
#5
Not Solved
Hi,
Here is my approach, Dont know other logic.
Code:
Set p=browser("CreationTime:=0").page("micClass:=Page").ChildObjects(WebButton("micClass:=WebButton"))
i=0
For x=0 to p.count-1 step 1
If p(x).getroproperty("micClass") = "WebButton" Then
    i=i+1
End If
Next
msgbox "Count :" &i
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Dynamic descriptive Programming issue in Terminal Emulator cprasad 1 1,938 04-25-2019, 08:17 PM
Last Post: Ankur
  Capture All text from webpage and copy it... mpatra 3 5,206 07-25-2018, 05:33 PM
Last Post: vimlesh
  UFT Tool support with Descriptive programming laks 1 1,766 07-05-2018, 05:31 PM
Last Post: Ankur
  UFT Descriptive Programming objects not identified in a secure & private intranet env bugfinder2 1 1,813 06-07-2017, 01:41 PM
Last Post: Ankur
  UFT descriptive programming Browser("creationtime:=-1") not always working SOUMYADEEP 0 3,079 01-20-2017, 01:53 AM
Last Post: SOUMYADEEP

Forum Jump:


Users browsing this thread: 1 Guest(s)