Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to Click on Mutiple Links in Web Table
#1
Hi All,

I am having error while click on Multiple Links using childobjects method.
I am calculating the link count, for click on each link i am using For loop
but it works only for first link from second link is showing General Error.
Below i am using code like this.

Code:
If Browser("Browser").Page("-- Welcome to YANG MING").Frame("right_3").WebTable("Service").Exist(10) Then Set Desc = Description.Create( ) Desc("micclass").Value = "Link" Set objLinks = Browser("Browser").Page("-- Welcome to YANG MING").Frame("right_8").WebTable("Service").ChildObjects(Desc) LinkCount = objLinks.Count ' msgbox(LinkCount) For l = 0 to LinkCount-1 objLinks(l).Click Next End If
Reply
#2
Could u please provide the snap shot of application and error u r getting.

Regards,
Sankalp
Reply
#3
Hi Sankalp,
ThankYou For your reply,
The Screen Shot is attached.

Regards,
Ranjit Kumar B


Attached Files Image(s)
   
Reply
#4
Hi,
When u click the link 1st time a new page is open , due to which reference object u have created is lost.
I implemented the same on google home page.
Below is the code, use it as a refrence.

Code:
SystemUtil.Run "iexplore.exe","www.google.co.in" Set desc=Description.Create() desc("micclass").Value="Link" desc("html tag").value="A" Set obj=Browser("Google").Page("Google").ChildObjects(desc) MsgBox(obj.Count) For i=0 to obj.Count-1 Set odesc=Description.Create() odesc("micclass").Value="Link" odesc("html tag").value="A" Set obj1=Browser("Google").Page("Google").ChildObjects(odesc) obj1(i).Click 'Browser("Google").Page("Google").Link("Search").Click Browser("Google").Close SystemUtil.Run "iexplore.exe","www.google.co.in" Next


Regards,
Sankalp
Reply
#5
Hi,

Can you please us that after clicking first link, will a new browser will open ?


Hi ,
Pls try the below code and let us know the result

Code:
SystemUtil.Run "iexplore.exe","www.google.co.in" Set desc=Description.Create() desc("micclass").Value="Link" Set obj=Browser("Browser").Page("Page").WebTable("ATable").ChildObjects(desc) For i=0 to obj.Count-1 Set obj1=Browser("Browser").Page("Page").WebTable("ATable").ChildObjects(desc) val = obj1(i).GETroProperty("text") Print val obj1(i).Click Wait(2) Browser("Browser").Back Next
Reply
#6
Hi sankalp,
Thank you very much,
The code is working perfectly.
Reply
#7
Glad to hear it worked 4 U

Regards,
Sankalp
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can QTP handle slick grid table in a web page qtplearner88 2 5,242 10-01-2019, 10:44 AM
Last Post: shilpi952
  unable to rowcount in web table manoj84monu 1 3,449 06-13-2016, 04:46 PM
Last Post: Anu1234
  How to click on all links dynamically in UFT? Rohan 9 19,883 02-25-2016, 10:42 AM
Last Post: vinod123
  I want to click on all the links in the webtable. These links are nothing but some co abhideshpande001 0 2,971 07-22-2015, 09:36 AM
Last Post: abhideshpande001
  Unable to click on the WebButton with specified Index srach84 2 4,953 03-31-2015, 04:36 AM
Last Post: srach84

Forum Jump:


Users browsing this thread: 1 Guest(s)