[wtr-general] Re: Watir-webdriver throws 'not clickable' error even when element is visible, present

2016-08-17 Thread Super Kevy

This seems to work for me.
Use send keys :end to drive the browser scroll to the bottom of the page

Reference: # 
http://watir-techniques.blogspot.com/2013/02/scroll-down-using-sendkeys-space.html


ie = Watir::Browser.new( :chrome)
ie.window.maximize()
ie.goto('shop.coles.com.au/online/mobile/national')
puts ie.link(:text,'Full website').exists?
puts ie.link(:text,'Full website').visible?
puts ie.link(:text,'Full website').present?
# Send a special key to the browser 
ie.send_keys( :end )   
ie.link(:text,'Full website').wait_until_present(30)
ie.link(:text,'Full website').parent.click



On Tuesday, August 16, 2016 at 9:51:46 PM UTC-5, Jon Franchi wrote:
>
> Deepak -- I tried your suggestion when running into the same problem.  I 
> only had the issue in Firefox and not IE, so I tried in firefox and it now 
> worked correctly, but broke IE "undefined method 'value' for :click:Symbol"
>
> On Friday, June 3, 2016 at 9:14:11 AM UTC-5, Deepak Subudhi wrote:
>>
>> please use @browser.element.fire_event :click
>>
>> On Tuesday, 19 April 2016 16:38:52 UTC+5:30, Awesome Possum wrote:
>>>
>>> I am trying to automate tests in Ruby using the latest Watir-Webdriver 
>>> 0.9.1, Selenium-Webdriver 2.53.0 and Chrome extension 2.21. However the 
>>> website that I am testing has static headers at the top or sometimes static 
>>> footers at the bottom. Hence since Watir auto-scrolls an element into view 
>>> before clicking, the elements get hidden under the static header or the 
>>> static footer. I do not want to set desired_capabitlites 
>>> (ElementScrollBehavior) to 1 or 0 as the websites I am testing can have 
>>> both - static header or static footer or both.
>>>
>>> Hence the question are 1) Why does Watir throw an exception 'Element not 
>>> clickable' even when the element is visible and present? See ruby code ( I 
>>> have picked a random company website for an example) and the results below.
>>>
>>> 2) How can I resolve this without resorting to ElementScrollBehaviour?
>>> Ruby code:
>>>
>>> require 'watir-webdriver'
>>>
>>> browser = Watir::Browser.new :chrome
>>> begin
>>>   # Step 1
>>>   browser.goto "shop.coles.com.au/online/mobile/national"
>>>
>>>   # Step 2 - click on 'Full Website' link at the bottom
>>>   link = browser.link(text: "Full website")
>>>
>>>   #check if link exists, present and visible?
>>>   puts link.exists?
>>>   puts link.present?
>>>   puts link.visible?
>>>
>>>   #click on link
>>>   link.click
>>> rescue => e
>>>   puts e.inspectensure
>>>   sleep 5end
>>>
>>> puts browser.url
>>> browser.close
>>>
>>> Result:
>>>
>>> $ ruby link_not_clickable.rb
>>>
>>> true 
>>>
>>> true 
>>>
>>> true
>>>
>>> Selenium::WebDriver::Error::UnknownError: unknown error: Element is not 
>>> clickable at point (460, 1295). Other element would receive the click: div 
>>> class="shoppingFooter"...div
>>>
>>> (Session info: chrome=50.0.2661.75) (Driver info: 
>>> chromedriver=2.21.371459 
>>> (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Mac OS X 10.10.5 
>>> x86_64)>http://shop.coles.com.au/online/mobile/national
>>>
>>> thanks!
>>>
>>>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Watir-webdriver throws 'not clickable' error even when element is visible, present

2016-08-16 Thread Jon Franchi
Deepak -- I tried your suggestion when running into the same problem.  I 
only had the issue in Firefox and not IE, so I tried in firefox and it now 
worked correctly, but broke IE "undefined method 'value' for :click:Symbol"

On Friday, June 3, 2016 at 9:14:11 AM UTC-5, Deepak Subudhi wrote:
>
> please use @browser.element.fire_event :click
>
> On Tuesday, 19 April 2016 16:38:52 UTC+5:30, Awesome Possum wrote:
>>
>> I am trying to automate tests in Ruby using the latest Watir-Webdriver 
>> 0.9.1, Selenium-Webdriver 2.53.0 and Chrome extension 2.21. However the 
>> website that I am testing has static headers at the top or sometimes static 
>> footers at the bottom. Hence since Watir auto-scrolls an element into view 
>> before clicking, the elements get hidden under the static header or the 
>> static footer. I do not want to set desired_capabitlites 
>> (ElementScrollBehavior) to 1 or 0 as the websites I am testing can have 
>> both - static header or static footer or both.
>>
>> Hence the question are 1) Why does Watir throw an exception 'Element not 
>> clickable' even when the element is visible and present? See ruby code ( I 
>> have picked a random company website for an example) and the results below.
>>
>> 2) How can I resolve this without resorting to ElementScrollBehaviour?
>> Ruby code:
>>
>> require 'watir-webdriver'
>>
>> browser = Watir::Browser.new :chrome
>> begin
>>   # Step 1
>>   browser.goto "shop.coles.com.au/online/mobile/national"
>>
>>   # Step 2 - click on 'Full Website' link at the bottom
>>   link = browser.link(text: "Full website")
>>
>>   #check if link exists, present and visible?
>>   puts link.exists?
>>   puts link.present?
>>   puts link.visible?
>>
>>   #click on link
>>   link.click
>> rescue => e
>>   puts e.inspectensure
>>   sleep 5end
>>
>> puts browser.url
>> browser.close
>>
>> Result:
>>
>> $ ruby link_not_clickable.rb
>>
>> true 
>>
>> true 
>>
>> true
>>
>> Selenium::WebDriver::Error::UnknownError: unknown error: Element is not 
>> clickable at point (460, 1295). Other element would receive the click: div 
>> class="shoppingFooter"...div
>>
>> (Session info: chrome=50.0.2661.75) (Driver info: 
>> chromedriver=2.21.371459 
>> (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Mac OS X 10.10.5 
>> x86_64)>http://shop.coles.com.au/online/mobile/national
>>
>> thanks!
>>
>>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Watir-webdriver throws 'not clickable' error even when element is visible, present

2016-06-03 Thread Deepak Subudhi
please use @browser.element.fire_event :click

On Tuesday, 19 April 2016 16:38:52 UTC+5:30, Awesome Possum wrote:
>
> I am trying to automate tests in Ruby using the latest Watir-Webdriver 
> 0.9.1, Selenium-Webdriver 2.53.0 and Chrome extension 2.21. However the 
> website that I am testing has static headers at the top or sometimes static 
> footers at the bottom. Hence since Watir auto-scrolls an element into view 
> before clicking, the elements get hidden under the static header or the 
> static footer. I do not want to set desired_capabitlites 
> (ElementScrollBehavior) to 1 or 0 as the websites I am testing can have 
> both - static header or static footer or both.
>
> Hence the question are 1) Why does Watir throw an exception 'Element not 
> clickable' even when the element is visible and present? See ruby code ( I 
> have picked a random company website for an example) and the results below.
>
> 2) How can I resolve this without resorting to ElementScrollBehaviour?
> Ruby code:
>
> require 'watir-webdriver'
>
> browser = Watir::Browser.new :chrome
> begin
>   # Step 1
>   browser.goto "shop.coles.com.au/online/mobile/national"
>
>   # Step 2 - click on 'Full Website' link at the bottom
>   link = browser.link(text: "Full website")
>
>   #check if link exists, present and visible?
>   puts link.exists?
>   puts link.present?
>   puts link.visible?
>
>   #click on link
>   link.click
> rescue => e
>   puts e.inspectensure
>   sleep 5end
>
> puts browser.url
> browser.close
>
> Result:
>
> $ ruby link_not_clickable.rb
>
> true 
>
> true 
>
> true
>
> Selenium::WebDriver::Error::UnknownError: unknown error: Element is not 
> clickable at point (460, 1295). Other element would receive the click: div 
> class="shoppingFooter"...div
>
> (Session info: chrome=50.0.2661.75) (Driver info: chromedriver=2.21.371459 
> (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Mac OS X 10.10.5 
> x86_64)>http://shop.coles.com.au/online/mobile/national
>
> thanks!
>
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Watir-webdriver throws 'not clickable' error even when element is visible, present

2016-04-22 Thread Chuck van der Linden
On Tuesday, April 19, 2016 at 4:08:52 AM UTC-7, Awesome Possum wrote:
>
> Hence the question are 1) Why does Watir throw an exception 'Element not 
> clickable' even when the element is visible and present? See ruby code ( I 
> have picked a random company website for an example) and the results below.
>
> 
>
> Selenium::WebDriver::Error::UnknownError: unknown error: Element is not 
> clickable at point (460, 1295). Other element would receive the click: div 
> class="shoppingFooter"...div
>
> (Session info: chrome=50.0.2661.75) (Driver info: chromedriver=2.21.371459 
> (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Mac OS X 10.10.5 
> x86_64)>http://shop.coles.com.au/online/mobile/national
>
> thanks!
>
> The answer to your question is right in the error message.   "Other 
element would receive the click"  That's the cause of the issue, there is 
some other element that is on top of the thing you are trying to click.

The solution depends on the situation, as there are two possibles.

1) Some other statically positioned element such as a header or footer, or 
maybe a dialog box/modal, is 'over' and obscuring the thing you want to 
click.   "but why is visible true?"  Because visible is checking attributes 
of the object, not evaluating if a user could actually see it, but rather 
making sure that the DOM or CSS styling is not hiding it.  The solution 
here is to scroll the element fully into view, see the answer talking about 
watir-scroll.

2) Some outer container is 'over' the element  even if not obscuring it. 
 In this case you can see the thing visually, but the container would get 
the click.. Which is OK because that's what would happen when a real user 
tried to click the thing.  In this case, experiment to discover the 
container and try clicking it.  See the answer from Super Kevy.

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Watir-webdriver throws 'not clickable' error even when element is visible, present

2016-04-20 Thread Super Kevy
Consider something like this.

browser.link(text: "Full website").parent.click

Ref: 
http://stackoverflow.com/questions/19251356/how-to-access-the-following-link-element-using-watir

On Tuesday, April 19, 2016 at 6:08:52 AM UTC-5, Awesome Possum wrote:
>
> I am trying to automate tests in Ruby using the latest Watir-Webdriver 
> 0.9.1, Selenium-Webdriver 2.53.0 and Chrome extension 2.21. However the 
> website that I am testing has static headers at the top or sometimes static 
> footers at the bottom. Hence since Watir auto-scrolls an element into view 
> before clicking, the elements get hidden under the static header or the 
> static footer. I do not want to set desired_capabitlites 
> (ElementScrollBehavior) to 1 or 0 as the websites I am testing can have 
> both - static header or static footer or both.
>
> Hence the question are 1) Why does Watir throw an exception 'Element not 
> clickable' even when the element is visible and present? See ruby code ( I 
> have picked a random company website for an example) and the results below.
>
> 2) How can I resolve this without resorting to ElementScrollBehaviour?
> Ruby code:
>
> require 'watir-webdriver'
>
> browser = Watir::Browser.new :chrome
> begin
>   # Step 1
>   browser.goto "shop.coles.com.au/online/mobile/national"
>
>   # Step 2 - click on 'Full Website' link at the bottom
>   link = browser.link(text: "Full website")
>
>   #check if link exists, present and visible?
>   puts link.exists?
>   puts link.present?
>   puts link.visible?
>
>   #click on link
>   link.click
> rescue => e
>   puts e.inspectensure
>   sleep 5end
>
> puts browser.url
> browser.close
>
> Result:
>
> $ ruby link_not_clickable.rb
>
> true 
>
> true 
>
> true
>
> Selenium::WebDriver::Error::UnknownError: unknown error: Element is not 
> clickable at point (460, 1295). Other element would receive the click: div 
> class="shoppingFooter"...div
>
> (Session info: chrome=50.0.2661.75) (Driver info: chromedriver=2.21.371459 
> (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Mac OS X 10.10.5 
> x86_64)>http://shop.coles.com.au/online/mobile/national
>
> thanks!
>
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Watir-webdriver throws 'not clickable' error even when element is visible, present

2016-04-19 Thread Titus Fortner
It is practically impossible to always calculate exactly how to 
automatically scroll a website such that the desired element is not hidden 
by static objects overlaid on top.

Use watir-scroll to help you - https://github.com/p0deje/watir-scroll

Titus


On Tuesday, April 19, 2016 at 4:08:52 AM UTC-7, Awesome Possum wrote:
>
> I am trying to automate tests in Ruby using the latest Watir-Webdriver 
> 0.9.1, Selenium-Webdriver 2.53.0 and Chrome extension 2.21. However the 
> website that I am testing has static headers at the top or sometimes static 
> footers at the bottom. Hence since Watir auto-scrolls an element into view 
> before clicking, the elements get hidden under the static header or the 
> static footer. I do not want to set desired_capabitlites 
> (ElementScrollBehavior) to 1 or 0 as the websites I am testing can have 
> both - static header or static footer or both.
>
> Hence the question are 1) Why does Watir throw an exception 'Element not 
> clickable' even when the element is visible and present? See ruby code ( I 
> have picked a random company website for an example) and the results below.
>
> 2) How can I resolve this without resorting to ElementScrollBehaviour?
> Ruby code:
>
> require 'watir-webdriver'
>
> browser = Watir::Browser.new :chrome
> begin
>   # Step 1
>   browser.goto "shop.coles.com.au/online/mobile/national"
>
>   # Step 2 - click on 'Full Website' link at the bottom
>   link = browser.link(text: "Full website")
>
>   #check if link exists, present and visible?
>   puts link.exists?
>   puts link.present?
>   puts link.visible?
>
>   #click on link
>   link.click
> rescue => e
>   puts e.inspectensure
>   sleep 5end
>
> puts browser.url
> browser.close
>
> Result:
>
> $ ruby link_not_clickable.rb
>
> true 
>
> true 
>
> true
>
> Selenium::WebDriver::Error::UnknownError: unknown error: Element is not 
> clickable at point (460, 1295). Other element would receive the click: div 
> class="shoppingFooter"...div
>
> (Session info: chrome=50.0.2661.75) (Driver info: chromedriver=2.21.371459 
> (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Mac OS X 10.10.5 
> x86_64)>http://shop.coles.com.au/online/mobile/national
>
> thanks!
>
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.