ie.link(:text, "Next").click

C

curious

I am navigating through web page using WATIR..

and as you know, many web pages has "Next" link that allows us to go to
the next page by clicking this "Next" link.

Now when the page reaches the last page, although "Next" is present,
but it is no longer a link.

At this point, if my code still goes to:

ie.link:)text, "Next").click

then I get the error message..

Is there anyway I can have WATIR check whether "Next" is link or not,
and if it is a link, then go to

ie.link:)text, "Next").click,

and if it is just plain text, do not go to ie.link:)text,
"Next").click??

thanks.
 
B

Bret Pettichord

Is there anyway I can have WATIR check whether "Next" is link or not,
and if it is a link, then go to

ie.link:)text, "Next").click,

and if it is just plain text, do not go to ie.link:)text,
"Next").click??

if ie.link:)text, "Next").exists?
ie.link:)text, "Next").click
end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top