Re: [wtr-general] Re: Trouble reading the text from Popup , Using Watir and Pageobject

2018-08-06 Thread Titus Fortner
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

[wtr-general] Re: Trouble reading the text from Popup , Using Watir and Pageobject

2018-08-06 Thread NaviHan
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

[wtr-general] Re: Trouble reading the text from Popup , Using Watir and Pageobject

2018-08-06 Thread Titus Fortner
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:

[wtr-general] Re: Trouble reading the text from Popup , Using Watir and Pageobject

2018-08-06 Thread NaviHan
The html source is https://xxx.com/AU/show-variation/?pid=2003013originalPid=2003013-05; title="Select Colour: BLACK" data-attribute-type="color">

Re: [wtr-general] Re: Trouble reading the text from Popup , Using Watir and Pageobject

2018-08-06 Thread Titus Fortner
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

[wtr-general] Re: Trouble reading the text from Popup , Using Watir and Pageobject

2018-08-06 Thread NaviHan
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

Re: [wtr-general] Re: Trouble reading the text from Popup , Using Watir and Pageobject

2018-08-06 Thread Titus Fortner
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

[wtr-general] Watir History

2018-08-06 Thread Titus Fortner
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.

[wtr-general] Re: Trouble reading the text from Popup , Using Watir and Pageobject

2018-08-06 Thread NaviHan
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