Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
similar links
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
I have multi-page tabular data that I am going through. At the bottom of the table is a list of pages (starting from 1 and going through 10). There is also a link "..." which means go to the next set of ten pages. So it
looks like this



1 2 3 4 5 6 7 8 9 10 ...

If you click on ... you get the next set with dots on each side (forward and backward):

... 11 12 13 14 15 16 17 18 19 20 ...

etc. At some point there will be no more pages forward so only the link to go backwards

... 21 22 23 24 25 26 27


I use the following to get the link number:
Code:
Dim obj_ChkDesc
Set obj_ChkDesc=Description.Create
obj_ChkDesc("Class Name").value = "Link"

I have a value for the current page which I increment and set like this

Code:
page=page+1
Obj_ChkDesc("name").value=page
If Browser("xALI Web").Page("xALI Web").link(obj_ChkDesc).Exist(1) then
    Browser("xALI Web").Page("xALI Web").Link(obj_ChkDesc).Click

if the page doesn't exist I set obj_ChkDesc("name") = "\.\.\." to get the
... link, and click.

This works as long as there is only one link with ...
(1 2 3 4 5 6 7 8 9 10 ...) but on pages where the ... is on both sides
(... 11 12 13 14 15 16 17 18 19 20 ... ) and I want to go forwards it tells me there are multiple links with the same value (...) and to give more properties.

How can I specify I want the right link of ... and not the left link? I did
google searches but it did not help.

As an aside when I get to
... 21 22 23 24 25 26 27

there is only one link but I do not want to click it because it will take me
back. I guess in the case of only 1 link I can see if there is a link '1' and if not, assume I am at the end.

But how can I disambiguate for the case

... 11 12 13 14 15 16 17 18 19 20 ...

?
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Is not foolishness. I just don't know how to differentiate the two links.
What I did was add an index obj_chkDots("index").value=1. This works
as long as there is a ... link for next. But at the end it will click on the
... going back. So I was getting in an infinite loop since it couldn't find the page it would go ahead and then back and then ahead and then back.

I made a variable pagecnt and set to 0. Every time I successfully clicked on a page link it would set it to 0. When I clicked on a ...
it would add 1 to it. If it got to 2 then I knew it couldn't find the page
and so I ended the program.

Kind of kludgy but works. Would still be interested in other's ideas though.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)