So, it looks like there are a couple things going on here.
> wait_until with present flag will wait until the element is present and then
> clicks it
I think you just misspoke here, but to clarify just in case, `#click`
method will automatically wait for the element it is clicking to be
present
You are right. It works with pure Watir.
Unfortunately my company insists Pageobejct :-)
With a fresh mind wait_while and wait_until is so confusing
For instance wait_until with present flag will wait until the element is
present and then clicks it and I clearly do not understand why its should
Ok, I see, you're passing in a variable for the color... And by calling
title it isn't waiting for the element to actually be present.
I wish PO made it easier to pass in parameters to element definitions. It's
so straightforward with just Watir syntax.
browser.link(title: "Select Colour:
The html source is
https://xxx.com/AU/show-variation/?pid=2003013originalPid=2003013-05;
title="Select Colour: BLACK" data-attribute-type="color">
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
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
There are several reasons why tests can pass locally but fail
remotely. Sometimes the code is run at a different resolution. The
debugging process is going to be the same. Read the error message to
see what specifically is failing, and look at the full stack trace
(use `--backtrace`) to see the
I just posted an article on the History of the Watir project.
http://watir.com/history/
Titus
--
--
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.
Thanks Titus
The script again failed in Jenkins box but it passed in local machine. What
could be the reason? Im yet to get the details of the box like OS etc. Used
the same code snippet
cta_description_element.wait_until(&:present?).text.gsub(/[^$,.A-Za-z0-9]/," ")
Also while working on a