Hi guys
I wanted to give an update on this issue.
A lot had changed in the project which now gives a stable run.
The jenkins box was running slow because the Java SE binary was eating 90%
of memory all the time. Once I killed and reinstalled it the tests are
running at lightning speed.This has fixed a lot of issues.
With this pop up , the time it stays open was driven by a timer in the
code. I have increased the timer and that gives the script enough time to
read the text. I also found sometimes the scripts still fails to read the
text, 1 out of 20 times. I suspect the focus is lost so Im thinking of
making the focus to the pop up before reading the text.
With the above changes Im getting stable runs now.
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.