1. I need more of a stack trace than that. What method is calling wait?

2. I need to see more code. If you are locating an element with
`title: /Select Colour/` then it doesn't make sense to wait for the
title to include that value, clicking on it will automatically wait
for that condition to be true.

Did you take a screenshot at the point of the exception to verify that
the page is in the condition you need it to be in?


On Mon, Aug 6, 2018 at 4:47 PM NaviHan <[email protected]> wrote:
>
> Still having issues with wait
>
>   def select_variation_group(color)
>     variation_groups_elements.map do |element|
>       element.wait_until { |el| el.title.include? color }
>       element.click
>     end
>   end
>
> Error
> Watir::Wait::TimeoutError: timed out after 10 seconds, waiting for true 
> condition on #<Watir::Anchor: located: true; {:title=>/Select Colour:/, 
> :tag_name=>"a", :index=>0}>
>
>
>
> On Friday, 3 August 2018 15:12:45 UTC+10, NaviHan wrote:
>>
>> I have a functionality where I click an a link from an email a voucher gets 
>> added to the shopping cart and a pop up appears with a message. Im trying to 
>> assert the text in the popup
>> I have defined the element as
>>
>> div(:cta_description, :css => '.homepage-clicktoactiavte-description')
>>
>> Tried to use a mix of Watir and Pageobejct to read the text. The below code 
>> works 5 out of 10 times.
>>
>> @rewards_popup_txt = Watir::Wait.until{cta_description_element}.text
>> @rewards_popup_txt = @rewards_popup_txt.gsub(/[^$,.A-Za-z0-9]/," ")
>> return @rewards_popup_txt
>>
>>
>> Tried using, which doesnt even set the @reward_popup_txt and shows error
>>
>>
>> if (Watir::Wait.while {cta_description_element.visible?})
>>   @rewards_popup_txt = cta_description_element.text
>> end
>> @rewards_popup_txt = @rewards_popup_txt.gsub(/[^$,.A-Za-z0-9]/," ")
>> return @rewards_popup_txt
>>
>> Error
>> NoMethodError: undefined method `gsub' for nil:NilClass
>> ./features/support/pages/Frontend/Cotton_On/Loyalty_Page.rb:22:in 
>> `rewards_popup_description'
>>
>> Any stable way to do the job?
>
> --
> --
> Before posting, please read 
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
> 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.

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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