Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to count no of weblist on the page
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi I am trying to count total no of weblist on the web page.
But i am geting error.
The script i have is

Code:
Systemutil.Run"IExplore","http://www.google.co.in"
wait(1)
Dim obj_DescChk
Set obj_DescChk=Description.Create
obj_DescChk("html tag").value="select"
obj_DescChk("ClassName").value="weblist"
Browser("title:=Google").Page("title:=Google").link("innerhtml:=Preferences").Click
Dim AllChkBoxes
Set AllChkBoxes=Browser("title:=Preferences").Page("title:=Preferences").ChildObjects(obj_DescChk)
msgbox AllChkBoxes.count

Can anybody correct the error
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi ,

Try with the below code.

Code:
Systemutil.Run"IExplore","http://www.google.co.in"
wait(1)
Dim obj_DescChk
Set obj_DescChk=Description.Create
obj_DescChk("Micclass").value="WebList"
Browser("title:=Google").Page("title:=Google").link("innerhtml:=Preferences").Click
Dim AllChkBoxes
Set AllChkBoxes=Browser("title:=Preferences").Page("title:=Preferences").ChildObjects(obj_DescChk)
msgbox AllChkBoxes.count
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Still I am getting following error.

The test run cannot continue due to an unrecoverable error.

General run error.

Line (8):
Code:
"Set AllChkBoxes=Browser("title:=Preferences").Page("title:=Preferences").ChildObjects(obj_DescChk)".
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi ,

Just keep some syncronization points(wait,exist,waitproperty) after the given below statement (such as):

way1:

Code:
Browser("title:=Google").Page("title:=Google").link("innerhtml:=Preferences").Click
wait(3)
Dim AllChkBoxes
Set AllChkBoxes=Browser("title:=Preferences").Page("title:=Preferences").ChildObjects(obj_DescChk)
msgbox AllChkBoxes.count



way2:

Code:
Browser("title:=Google").Page("title:=Google").link("innerhtml:=Preferences").Click
if Browser("title:=Preferences").Page("title:=Preferences").exist then
   Dim AllChkBoxes
Set AllChkBoxes=Browser("title:=Preferences").Page("title:=Preferences").ChildObjects(obj_DescChk)
msgbox AllChkBoxes.count
End if

way3:

Code:
Browser("title:=Google").Page("title:=Google").link("innerhtml:=Preferences").Click
Browser("title:=Preferences").Page("title:=Preferences").waitProperty "Visible",True,"20000"
Dim AllChkBoxes
Set AllChkBoxes=Browser("title:=Preferences").Page("title:=Preferences").ChildObjects(obj_DescChk)
msgbox AllChkBoxes.count
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
No Sreekanth , It sstill gives same error.
Reply
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
Code:
change obj_DescChk("Micclass").value="WebList" to be obj_DescChk("micclass").value="WebList"
Reply
#7
Solved: 11 Years, 3 Months, 3 Weeks ago
Use micclass instead of Class Name
by the way, r u looking for chkboxs or for weblists !!!
Reply
#8
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi

Try the below script....It would fetch the checkbox count

Code:
Browser("Google").Page("Google").Link("Preferences").Click
Set obj_ChkDesc = Description.Create
obj_ChkDesc("html tag").value = "INPUT"
obj_ChkDesc("type").value = "checkbox"
Set AllChkBoxes = Browser("Google").Page("Google").ChildObjects(obj_ChkDesc)
msgbox AllChkBoxes.count

Thanks
Reply
#9
Solved: 11 Years, 3 Months, 3 Weeks ago
General run error. is coming on execution
Reply
#10
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi sarveshqtp,
The script posted by QTPgrd is working for me.. If possible, can you please post your script you are using? so that I may try to identify the error.
Thanks,
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Webtable objects recognise as weblist in UFT 12.5 Sharad Kumar 0 1,152 12-06-2018, 04:57 PM
Last Post: Sharad Kumar
  QTP identifying WebList as WebEdit and an Element passion77 3 8,422 01-27-2014, 10:21 PM
Last Post: supputuri
  How to populate data in weblist using excel vijifun 1 3,295 12-05-2013, 12:06 PM
Last Post: basanth27
Exclamation Identify the WebList Unleash Rajesh 3 6,798 01-03-2012, 06:41 PM
Last Post: sundari_msls
  GWT Weblist Not Getting Detected in QTP 10 aravind07 0 2,542 11-25-2011, 09:48 AM
Last Post: aravind07

Forum Jump:


Users browsing this thread: 1 Guest(s)