Click on link not working with ie #watir-webdriver

Greetings,

I can see that there is a -tag in my html. I am able to click it on
firefox by using the code on
Loading...

but I am not able to click the same link when I am on ie. I mean I start
browser on irb using watir-webdriver codes.

I am doing something like:
require ‘watir-webdriver’
b = Watir::Browser.start ‘bit.ly/watir-webdriver-demo’
l = b.link :text => ‘Google Docs’
l.exists?
l.click

I can see everything goes fine till 2nd last statement, it shows that
there is the element.

but when I do l.click on irb, nothing happens and I get an output: []

but this works fine if I start a ff browser.

Any idea? solution?

What does this output?

b.links.each {|l| puts l.text}

Joel P. wrote in post #1086430:

What does this output?

b.links.each {|l| puts l.text}
that will be ok as I am able to flash also to the right link, I see that
first focus and then click works. but the problem is I am using
multithreading, so when it is focused and goes to another window, the
link loses its focus so again its not working actually… any solution?

Found this on another forum, does it help?

Have you made sure that Internet Options -> Security has the same
Protected Mode setting (on or off, it doesn’t matter as long as it is
the same value) for all zones? That’s a requirement for the IE driver
functioning correctly.

Joel P. wrote in post #1086484:

Found this on another forum, does it help?

Have you made sure that Internet Options -> Security has the same
Protected Mode setting (on or off, it doesn’t matter as long as it is
the same value) for all zones? That’s a requirement for the IE driver
functioning correctly.

could you pour some more light over what you said? I didnt get by all
zones.

On 26 Nov 2012, at 06:44, ajay paswan [email protected] wrote:

It’s an IE feature:

https://www.google.co.uk/search?hl=en&client=safari&tbo=d&q=internet+explorer+security+zones&oq=internet+explorer+security+zones&gs_l=mobile-gws-serp.12..0l5.34019.36955.0.38499.19.18.0.0.0.8.242.2023.7j10j1.18.0.les%3B..0.0...1ac.1.6XViBW7CTwY

https://www.google.co.uk/search?hl=en&client=safari&tbo=d&q=internet+explorer+security+zones+watir&oq=internet+explorer+security+zones+watir&gs_l=mobile-gws-serp.3...6190.9560.0.9978.10.9.1.0.0.0.296.1640.1j4j4.9.0.les%3B..0.0...1ac.1.cULLTmGOcz0

The second one there may be super useful.

Jams

Try this:

require ‘watir-webdriver’
b = Watir::Browser.start ‘bit.ly/watir-webdriver-demo’
l = b.link :text => ‘Google Docs’
b.goto l.href

I uchecked protected mode for all zones. still not working.

Joel P. wrote in post #1086486:

Try this:

require ‘watir-webdriver’
b = Watir::Browser.start ‘bit.ly/watir-webdriver-demo’
l = b.link :text => ‘Google Docs’
b.goto l.href

Did you give this a go?

Joel P. wrote in post #1086687:

Joel P. wrote in post #1086486:

Try this:

require ‘watir-webdriver’
b = Watir::Browser.start ‘bit.ly/watir-webdriver-demo’
l = b.link :text => ‘Google Docs’
b.goto l.href

Did you give this a go?

I wasn’t doing that because I have to deal with submit buttons also, so
as href property is not there in case of submit button, I am not using
it.

If there’s a submit button on a form, you can usually get around it by
sending “\n” to the last field in the form, or possibly to the button
itself.
I know that IE has trouble with webdriver, I’m just trying to give you
alternative ways of looking at the problem, rather than only one option
(wait for either Microsoft or the awesome volunteers who write IE’s
interface for Watir to find a solution) :slight_smile:

Joel P. wrote in post #1086806:

If there’s a submit button on a form, you can usually get around it by
sending “\n” to the last field in the form, or possibly to the button
itself.
I know that IE has trouble with webdriver, I’m just trying to give you
alternative ways of looking at the problem, rather than only one option
(wait for either Microsoft or the awesome volunteers who write IE’s
interface for Watir to find a solution) :slight_smile:
Got this fantastic article
Home - Watir-Melon
. but there are so many solutions, no solid solution, do you think that
we can get a solid solution compiled from all the solutions mentioned in
article.

If so lets write a solid solution for all. Because I know how much its
frustrating when ur goal is a noometer apart from you but you cannot see
it. :frowning: