Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to click all the links
#1
Not Solved
Hi All,


Below is the updated code

******************************************************

Code:
Set oLink = Description.Create()
oLink("micclass").Value = "Link"

Set all_Links = Browser("micclass:=Browser").Page("micclass:=Page").ChildObjects(oLink)

For i = 1 To all_Links.Count-1
    all_Links(i).click()
    wait 1
Next

******************************************************

Here the problem while clicking the 2nd link

it is working upto to click the FIRST link, but when it clicks the SECOND link it is showing error like General Error

kindly find the attachment for the screen shot

kindly let me know the issue why it is not able to click from second link

Thanks in advance


Thanks & Regards,
Sivakumar S


Attached Files Image(s)
   
Reply
#2
Not Solved
Start the loop from i=0

Code:
For i = 0 To all_Links.Count-1
all_Links(i).click()
wait 1
Next

Correct me if wrong

Regards,
Sankalp
Reply
#3
Not Solved
Hi,

That is not an issue we can start i value as i=0 or i=1, its depend on the requirement

if we start from i=0, then it will start clicking the link from 1st link
if we start from i=1, then it will start clicking the link from 2nd link

Regards,
Gaveyom
Reply
#4
Not Solved
How many links are there??
Just check, it might be the case when its going beyond the specified range.
if there are two links only and u r starting from i=1 than it will click on 2nd link only. it will skip the first link and will show the error when loop for the next.

Correct me if wrong.

Regards,
Sankalp
Reply
#5
Not Solved
34 links are there, so there is no chance to get the error what have u said
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to click on all links dynamically in UFT? Rohan 9 17,884 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,562 07-22-2015, 09:36 AM
Last Post: abhideshpande001
  VB SCRIPT to click on specific links on webpage and store related data ACCBAJPA 1 9,816 04-02-2013, 01:33 PM
Last Post: ACCBAJPA
  Unable to Click on Mutiple Links in Web Table branjitk 6 4,513 06-12-2012, 05:49 PM
Last Post: sshukla12
  How to click links with same name in a webtable? qtplearner88 4 4,907 06-06-2012, 07:00 PM
Last Post: Jeffm33

Forum Jump:


Users browsing this thread: 1 Guest(s)