You are lacking a verification that the page is ready or the object exists.

  b.button(:class => "ga_Finder_Load_More").wait_until_present(60)
  b.button(:class => "ga_Finder_Load_More").click
     or 
  b.button(:class => "ga_Finder_Load_More").when_present(60).click



On Monday, December 7, 2015 at 8:10:34 AM UTC-6, abhiram impossible itself 
wrote:
>
> I tried to click a button to load more content in a webpage, for that I 
> used the following code,
>                                 b = Watir::Browser.new
>                                 b.goto "https://www.example.com/";
>                                 b.button(:class => 
> "ga_Finder_Load_More").click
> This code is running fine in linux(ubuntu) and I can load the data in the 
> webpage by clicking the button. But when I run the same code in window 10 I 
> am getting the following error,
>
>       
>  C:/Ruby200/lib/ruby/gems/2.0.0/gems/watir-webdriver-0.9.1/lib/watir-       
>      webdriver/elements/element.rb:508:in `assert_exists' from 
> C:/Ruby200/lib/ruby/gems/2.0.0/gems/watir-webdriver-0.9.1/lib/watir-webdriver/elements/element.rb:114:in
>  
> `click' from leafly_v1.3.rb:70:in `block (2 levels) in <main>' from 
> leafly_v1.3.rb:67:in `each' from leafly_v1.3.rb:67:in `block in <main>' 
> from 
> C:/Ruby200/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.6.4-x86-mingw32/lib/nokogiri/xml/node_set.rb:187:in
>  
> `block in each' from 
>
> Ruby version - 2.0.0
> watir-webdriver - 0.9.1
>
> Can anyone please help me to fix this or can any one suggest me alternate 
> method to click a button.
>
> Thanks.
>
>

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

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to