[wtr-general] Re: Is there an autogenerated method in page-object that tell if the element is present?

2019-04-16 Thread NaviHan
named "accessor_methods" Could you please explain a bit about the accessor_methods to define additional methods that will be created for the page object? Is that a feature of Ruby? On Friday, 1 February 2019 00:11:33 UTC+11, NaviHan wrote: > > I have an element de

[wtr-general] Re: What is the default element and page wait in Watir. Do we have to explicitly set PageObject.default_element_wait?

2019-04-16 Thread NaviHan
ntil(&:present?).class returning Watir::Div? This should have been calling the wait_until methods of PageObject calss and returned PageObject::Div? On Monday, 15 April 2019 09:29:57 UTC+10, NaviHan wrote: > > The automation code in our project uses PageObject and yesterday's nightly

[wtr-general] Re: What is the default element and page wait in Watir. Do we have to explicitly set PageObject.default_element_wait?

2019-04-16 Thread NaviHan
t after 10 seconds. The 10 seconds because I was using defualt_element_wait.Which doesn't match PageObject.default_element_wait=(10) On Monday, 15 April 2019 09:29:57 UTC+10, NaviHan wrote: > > The automation code in our project uses PageObject and yesterday's nightly > build shows a fail

[wtr-general] Re: What is the default element and page wait in Watir. Do we have to explicitly set PageObject.default_element_wait?

2019-04-16 Thread NaviHan
return PageObject::Div? On Monday, 15 April 2019 09:29:57 UTC+10, NaviHan wrote: > > The automation code in our project uses PageObject and yesterday's nightly > build shows a failure. > > [31m timed out after 10 seconds, waiting for true condition on > #"sl

[wtr-general] Re: What is the default element and page wait in Watir. Do we have to explicitly set PageObject.default_element_wait?

2019-04-15 Thread NaviHan
I check for an elements existence like *element.exists? * As watir doesnt wait here do you suggest leaving default_element_wait to say 30 seconds? Cheers Navi On Monday, 15 April 2019 09:29:57 UTC+10, NaviHan wrote: > > The automation code in our project uses PageObject and yesterday's nightly

[wtr-general] Re: Using .nil? to check the presence of an element

2019-04-15 Thread NaviHan
I have attached the html of the two line items on cart The issue:- *How do we check the presence of a button which can only be identified by a custom attribute when the button itself is not there.* On Monday, 15 April 2019 16:03:51 UTC+10, NaviHan wrote: > > The shopping cart has two pr

[wtr-general] Re: Using .nil? to check the presence of an element

2019-04-15 Thread NaviHan
2002690-02" *using the preceding_sibling? remove_line_items_elements.find{|el| el.value == "9351785508221"}.preceding_sibling.present? Doesnt work though. If that the case I could have solved the original issue with this code.. On Monday, 15 April 2019 16:03:51 UTC+10, NaviHan wrote: >

[wtr-general] Using .nil? to check the presence of an element

2019-04-15 Thread NaviHan
The shopping cart has two products, normal product and personalised product Against each normal product there is a "move to wishlist" button and there is no "move to wishlist" button for personalised product. The test needs to validate the absence of the "move to wishlilist" button for the

[wtr-general] What is the default element and page wait in Watir. Do we have to explicitly set PageObject.default_element_wait?

2019-04-14 Thread NaviHan
The automation code in our project uses PageObject and yesterday's nightly build shows a failure. [31m timed out after 10 seconds, waiting for true condition on #"slide-dialog-container-cart-page", :tag_name=>"div"}> (Watir::Wait::TimeoutError) [0m On checking hooks I found a statement

[wtr-general] Re: Cant capture alert using "alert" method of Page Object

2019-04-12 Thread NaviHan
our our application. Cheers Navi On Thursday, 11 April 2019 12:23:16 UTC+10, NaviHan wrote: > > Im trying to capture the alert text and dismiss the alert using the > "alert" method > > def test > @browser.div(:class => 'address-details', :index =>0)

[wtr-general] Re: Cant capture alert using "alert" method of Page Object

2019-04-10 Thread NaviHan
;1).click puts @browser.alert.text @browser.alert.ok This worked. But I would like to know why the PageObject method alert is not working as expected. May be wait for Justin :-) On Thursday, 11 April 2019 12:23:16 UTC+10, NaviHan wrote: > > Im trying to capture the alert text and

[wtr-general] Re: Cant capture alert using "alert" method of Page Object

2019-04-10 Thread NaviHan
On Thursday, 11 April 2019 12:23:16 UTC+10, NaviHan wrote: > > Im trying to capture the alert text and dismiss the alert using the > "alert" method > > def test > @browser.div(:class => 'address-details', :index =>0).click > alert_text = alert do &

[wtr-general] Cant capture alert using "alert" method of Page Object

2019-04-10 Thread NaviHan
Im trying to capture the alert text and dismiss the alert using the "alert" method def test @browser.div(:class => 'address-details', :index =>0).click alert_text = alert do @browser.div(:class => 'select-checkbox', :index =>1).click end sleep 10 puts alert_text

[wtr-general] Re: How to keep the Watir browser run on the backend?

2019-04-10 Thread NaviHan
args = ['--window-position=-3000,0'] browser = Watir::Browser.new :chrome, options: {args: args} Doesnt work either. Can the OP confirm if it works for him? On Wednesday, 10 April 2019 22:42:13 UTC+10, watirQ wrote: > > Experts > > Each time when use .goto or open a new tab, the browser

[wtr-general] Re: Is there a way to duplicate a tab using Watir

2019-04-10 Thread NaviHan
I want to duplicate the browser in a new tab. Not open a blank new tab. And are we sure that javascript is the only way to open a new tab? On Wednesday, 10 April 2019 13:39:32 UTC+10, NaviHan wrote: > > Is there a way to duplicate a tab using Watir? > > (in chrome, right click on t

[wtr-general] Re: How to keep the Watir browser run on the backend?

2019-04-10 Thread NaviHan
Tried this, browser didnt minimize args = ['--allow-running-insecure-content --window-position=-3000, 0'] browser = Watir::Browser.new :chrome, options: {args: args} Titus is this correct? On Wednesday, 10 April 2019 22:42:13 UTC+10, watirQ wrote: > > Experts > > Each time when use .goto or

[wtr-general] Re: How to keep the Watir browser run on the backend?

2019-04-10 Thread NaviHan
Try this after you open the browser browser.window.move_to(-3000, 0) This will minimize the window On Wednesday, 10 April 2019 22:42:13 UTC+10, watirQ wrote: > > Experts > > Each time when use .goto or open a new tab, the browser window will lump > to the frontend of the screen. How to keep

[wtr-general] Is there a way to duplicate a tab using Watir

2019-04-09 Thread NaviHan
Is there a way to duplicate a tab using Watir? (in chrome, right click on tab>Duplicate tab) I know we can use the javascript to open a new tab? Even if its new tab is there a Watir way to do that? @browser.execute_script("window.open('http://www.google.com', '_blank')") -- -- Before

[wtr-general] Re: Trouble undersatnding "Around" hook

2019-04-04 Thread NaviHan
Thanks Justin I have posted the query in Cukes mailing list. Cheers Navi On Friday, 29 March 2019 16:33:14 UTC+11, NaviHan wrote: > > Im trying to understand how the around hooks work > > Im sorry if the question is very basic. I cant find the implementation of > "Around&q

[wtr-general] Re: Trouble undersatnding "Around" hook

2019-04-03 Thread NaviHan
rder is fluctuating.. Is this true? On Friday, 29 March 2019 16:33:14 UTC+11, NaviHan wrote: > > Im trying to understand how the around hooks work > > Im sorry if the question is very basic. I cant find the implementation of > "Around" in Cucumber API docs as well (checked &g

[wtr-general] Trouble undersatnding "Around" hook

2019-03-28 Thread NaviHan
Im trying to understand how the around hooks work Im sorry if the question is very basic. I cant find the implementation of "Around" in Cucumber API docs as well (checked *Cucumber::RbSupport::RbDsl* in *Around **do *|*scenario*, *block*| puts *"About to run *#{*scenario*.name} *"

[wtr-general] Re: How to check if a collection is present in PageObject?

2019-03-27 Thread NaviHan
returns false Cheers NaviHan On Wednesday, 27 March 2019 11:08:54 UTC+11, NaviHan wrote: > > Hi > > I have a collections of buttons defined as is the element > > > buttons(:products_on_wishlist, :class => 'product-quick-add') > > > > Basically they represent

[wtr-general] Re: How to check if a collection is present in PageObject?

2019-03-26 Thread NaviHan
ednesday, 27 March 2019 11:08:54 UTC+11, NaviHan wrote: > > Hi > > I have a collections of buttons defined as > > buttons(:products_on_wishlist, :class => 'product-quick-add') > > > > Basically they represent the products on wishlist > > The page can have

[wtr-general] Re: Which is better in PageObject model, using id, class, name to identify elements or using css to identify elements

2019-03-26 Thread NaviHan
better? And then use product_names_elements[0] and product_name_elemets[1] to access links? On Sunday, 24 March 2019 17:15:53 UTC+11, NaviHan wrote: > > I have seen in my project using css to identify elements using PageObject. > I always use attributes like id, class and name to identify e

[wtr-general] How to check if a collection is present in PageObject?

2019-03-26 Thread NaviHan
Hi I have a collections of buttons defined as buttons(:products_on_wishlist, :class => 'product-quick-add') Basically they represent the products on wishlist The page can have 1. No products (no buttons) 2. One product (1 button) 3. More than one products (more than 1 button) I need to

[wtr-general] Re: Which is better in PageObject model, using id, class, name to identify elements or using css to identify elements

2019-03-26 Thread NaviHan
/Frontend/Cotton_On/Wishlist_Page.rbT14> + span(:remove_all_link, :css=> ".wishlist-remove-all span") Heavy use of css. I cant tell them why they should use css :-) Could you please let me know the disadvantage here? On Sunday, 24 March 2019 17:15:53 UTC+11, NaviHan wrote: >

[wtr-general] Re: Which is better in PageObject model, using id, class, name to identify elements or using css to identify elements

2019-03-24 Thread NaviHan
Thanks Titus. But what if someone ask, why cant I use the css or xpath. If you use them what is issue and how we avoid that with attributes like is, class or data-set? On Sunday, 24 March 2019 17:15:53 UTC+11, NaviHan wrote: > > I have seen in my project using css to identify elements

[wtr-general] Which is better in PageObject model, using id, class, name to identify elements or using css to identify elements

2019-03-24 Thread NaviHan
I have seen in my project using css to identify elements using PageObject. I always use attributes like id, class and name to identify elements. Which is the better way and why? -- -- Before posting, please read

[wtr-general] New books on Cucumber, Pageobjects, Watir and Selenium etc

2019-02-20 Thread NaviHan
Hi All Just wondering if any recent books have been written on Cucumber, Pageobjects, Watir, Selenium etc Books I have already read 1. Cucumber and Cheese by Jeff Morgan 2. Watirways by Justin Ko 3. Collection of books on Automation written by Zhimin Zhan Cheers.. -- -- Before posting,

[wtr-general] Re: Is there an autogenerated method in page-object that tell if the element is present?

2019-02-01 Thread NaviHan
ion for such cases On Friday, 1 February 2019 00:11:33 UTC+11, NaviHan wrote: > > I have an element defined as > > div(:reward_history, :class => 'reward-history-header') > > > The page-object gem generated four methods for this element which are > > > 'reward_history', 'reward_h

[wtr-general] Re: Usage of block in hooks.rb

2019-02-01 Thread NaviHan
; + time @browser.screenshot.save_stitch("./screenshots/#{screenshot_path}.png", browser, opts) end end On Tuesday, 29 January 2019 16:47:10 UTC+11, NaviHan wrote: > > Hi all > > Im just looking for some good documentation which explains the usage of >

[wtr-general] Re: Usage of block in hooks.rb

2019-01-31 Thread NaviHan
fter Hook Or is it Before Hook iteration 1 -> Scenario Steps iteration 2 -> Scenario Steps iteration 3 -> Scenario Steps After Hook Also what is the difference between Before do @browser = browser end and Before do |scenario| @browser = browser end On Tuesday, 29 January 2019 16:47:

[wtr-general] Re: Is there an autogenerated method in page-object that tell if the element is present?

2019-01-31 Thread NaviHan
way to do this. By the way Im confused how the script know it has to give priority to standard_methods in the monkypatch.rb rather in the actual PageObject module? On Friday, 1 February 2019 00:11:33 UTC+11, NaviHan wrote: > > I have an element defined as > > div(:reward_his

[wtr-general] Is there an autogenerated method in page-object that tell if the element is present?

2019-01-31 Thread NaviHan
I have an element defined as div(:reward_history, :class => 'reward-history-header') The page-object gem generated four methods for this element which are 'reward_history', 'reward_history_element', and 'reward_history?' The fourth method 'reward_history?' check if the element exists in

[wtr-general] What happened to "cheezy"

2019-01-31 Thread NaviHan
Just curious , whats Jeff Morgan doing these days? There has been no posts on his website cheezyworld since March 2017. Missing his articles on Test Automation. Is there anyone Automation Gurus we can follow for day to day reading? -- -- Before posting, please read

[wtr-general] Re: Usage of block in hooks.rb

2019-01-29 Thread NaviHan
$counter +=1 end end After do |scenario| take_screenshot(@browser, scenario) end On Tuesday, 29 January 2019 16:47:10 UTC+11, NaviHan wrote: > > Hi all > > Im just looking for some good documentation which explains the usage of > blocks in hooks.rb > > For example "Before&qu

[wtr-general] Usage of block in hooks.rb

2019-01-28 Thread NaviHan
Hi all Im just looking for some good documentation which explains the usage of blocks in hooks.rb For example "Before", "After" , "AfterStep" etc... Thanks in advance -- -- Before posting, please read

[wtr-general] Re: populate_page_with data_for using data_magic is not working for a select_list?

2019-01-13 Thread NaviHan
te_country.to_s == 'au') page.auth_to_leave_list="Leave out of the weather" end On Monday, 14 January 2019 14:58:25 UTC+11, NaviHan wrote: > > My order_details.yml files looks like this > > order_details: > site: au > products: > - 9351785586540 > - 9

[wtr-general] populate_page_with data_for using data_magic is not working for a select_list?

2019-01-13 Thread NaviHan
My order_details.yml files looks like this order_details: site: au products: - 9351785586540 - 9350486827327 qty: - 2 - 5 coupons_bag: [] vouchers_bag: [] email_add: ~randomize ['cottononqa+orderthruau...@gmail.com','cottononqa+orderthruau...@gmail.com'] first_name: ~first_name

[wtr-general] Re: Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {Alert text : Bad response - parser error!}

2018-12-06 Thread NaviHan
uot;:{"message":"unexpected alert open: {Alert text : Couldn't load credit card!}\n (Session info: chrome=70.0.3538.110)\n (Driver info: chromedriver=2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 6.1.7601 SP1 x86_64)"}} Selenium::WebDriv

[wtr-general] Re: Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {Alert text : Bad response - parser error!}

2018-12-06 Thread NaviHan
_definitions/Checkout_Page_steps.rb:1448:in `/^Thankyou page is shown with details for the user$/' ./features/Giftcards-AU.feature:269:in `Then Thankyou page is shown with details for the user' The hard thing is I dont see any alert when I do this test manually. Is there any way i

[wtr-general] Re: Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {Alert text : Bad response - parser error!}

2018-12-04 Thread NaviHan
t to the driver to see exactly what is causing the alert (`Selenium::WebDriver.logger.level = :info`)". Could you please a bit more clear.. On Wednesday, 5 December 2018 13:31:56 UTC+11, NaviHan wrote: > > Im having a tough time with this intermittent error I get on checkout &

[wtr-general] Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: {Alert text : Bad response - parser error!}

2018-12-04 Thread NaviHan
Im having a tough time with this intermittent error I get on checkout page once all the details are filled and customer hits payment button. Sometimes Selenium::WebDriver::Error::UnhandledAlertError: unexpected alert open: { Alert text : Bad response - parser error!} (Session info:

[wtr-general] Re: Issue with watir index or Am I doing something wrong

2018-11-25 Thread NaviHan
Hi Justin I cant remember what I did wrong with the collection, Im pretty sure I used " applied_gift_cards_elements[index.to_i].div_element(:index => 0).text" Anyways this absolutely works fine now. Thanks a lot :-) On Friday, 23 November 2018 13:06:07 UTC+11, NaviHan wrot

[wtr-general] Re: Issue with watir index or Am I doing something wrong

2018-11-23 Thread NaviHan
Hi Justin The collection was the first thing I tried. But the issue is when there is only one gift card applied, meaning only one div with class > Having trouble using index. > > I have a section of a page as below. > > > Card > Amount Taken > > ="display:

[wtr-general] Re: Issue with watir index or Am I doing something wrong

2018-11-22 Thread NaviHan
Oops my understanding was wrong here :-( I can achieve this by using return applied_gift_cards_element.children[index.to_i].children[0].text Is there a a better way? On Friday, 23 November 2018 13:06:07 UTC+11, NaviHan wrote: > > Having trouble using index. > > I have a secti

[wtr-general] Issue with watir index or Am I doing something wrong

2018-11-22 Thread NaviHan
Having trouble using index. I have a section of a page as below. Card Amount Taken ...163867647149 $20.00 ...169169063156 $25.90

[wtr-general] Hiddenfield, Is there a limitation in PageObject

2018-10-24 Thread NaviHan
Found this really confusing behavior while dealing with this element. Basically I want to get the value I have declared the pageobect as below hidden_fields(:test, :name => 'pid') And trying to print the value actually prints the pageobject instead of the value. puts test_elements.find

[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-10-02 Thread NaviHan
completely disappeared. I know we need to do wait_while but how do we combine s.present? && s.style( 'overflow') == 'visible' to evaluate to false ? Cheers On Tuesday, 25 September 2018 14:41:15 UTC+10, NaviHan wrote: > > Its been some days I found this issue untill I understood t

[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-26 Thread NaviHan
this mean, s.style('overflow') == 'visible', and where can we verify that On Tuesday, 25 September 2018 14:41:15 UTC+10, NaviHan wrote: > > Its been some days I found this issue untill I understood today the cause > of failure. > > The behavior is > a. The user enters the email on

[wtr-general] Re: How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-25 Thread NaviHan
contradictory. What do you think? On Tuesday, 25 September 2018 14:41:15 UTC+10, NaviHan wrote: > > Its been some days I found this issue untill I understood today the cause > of failure. > > The behavior is > a. The user enters the email on check out page > b. A pop up sk

[wtr-general] How to handle behavior while pop up loads, is sleep is the only solution?

2018-09-24 Thread NaviHan
Its been some days I found this issue untill I understood today the cause of failure. The behavior is a. The user enters the email on check out page b. A pop up skids in from the top of the page c. The user clicks a "continue as guest "button on the pop up d. The pop up skids back in and

[wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-24 Thread NaviHan
ity to launch, which fails with "Invalid Parameter" error as expected. As a workaround, I just modified the order of PATH variable as SET "PATH=C:\Program Files\ImageMagick-6.9.10-Q8;%PATH%;C:\Ruby24-x64\bin" Good God!!! On Thursday, 20 September 2018 21:14:17 UTC+1

[wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-24 Thread NaviHan
(MiniMagick::Error) ./features/support/hooks.rb:86:in `take_screenshot' ./features/support/hooks.rb:71:in `After' On Thursday, 20 September 2018 21:14:17 UTC+10, NaviHan wrote: > > Hi > > I have put this code in the hooks which takes scresnshot when a test > fails. The issue is that

[wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-24 Thread NaviHan
with error: [0m [31m Invalid Parameter - 1920x1957 [0m [31m (MiniMagick::Error) [0m [31m ./features/support/hooks.rb:86:in `take_screenshot' [0m [31m ./features/support/hooks.rb:71:in `After' [0m [36mScenario Failed ! [0m On Thursday, 20 September 2018 21:14:17 UTC+10, NaviHan wrote: > &

[wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-21 Thread NaviHan
UTC+10, NaviHan wrote: > > Hi > > I have put this code in the hooks which takes scresnshot when a test > fails. The issue is that Im not getting the full browser screen. Its chops > off at the bottom > > After do |scenario| > take_screenshot(@browser, scenario) &

[wtr-general] Re: Maybe look in an iframe? error when clicking button

2018-09-21 Thread NaviHan
Hi Justin and Titus tap(&:click) did the trick Now its successfully removing the second voucher as well Thanks for the detailed explanation.. Cheers Navi -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. In

[wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-21 Thread NaviHan
imit => 5000} screenshot_path = "#{scenario_name}" + "_failure_" + time @browser.screenshot.save_stitch(screenshot_path, browser, opts) On Thursday, 20 September 2018 21:14:17 UTC+10, NaviHan wrote: > > Hi > > I have put this code in the hooks which takes

[wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-20 Thread NaviHan
Hi Sam Thanks for reaching out. I will try that out tomorrow from office. Will let you know the outcome :-) On Thursday, 20 September 2018 21:14:17 UTC+10, NaviHan wrote: > > Hi > > I have put this code in the hooks which takes scresnshot when a test > fails. The issue is that

[wtr-general] Re: Maybe look in an iframe? error when clicking button

2018-09-20 Thread NaviHan
Ok, Titus, but why use click on self? Just searched the web for documentation on tap, couldnt find it. Could you please point me to if any? On Thursday, 20 September 2018 20:50:21 UTC+10, NaviHan wrote: > > I have a bag page where I have applied two coupons. Once the coupons are >

[wtr-general] Re: Maybe look in an iframe? error when clicking button

2018-09-20 Thread NaviHan
Sure Justin, Let me try that But what does tap(&:click)do? On Thursday, 20 September 2018 20:50:21 UTC+10, NaviHan wrote: > I have a bag page where I have applied two coupons. Once the coupons are > applied the source looks like this > > > > Applied codes: > &g

[wtr-general] Re: Maybe look in an iframe? error when clicking button

2018-09-20 Thread NaviHan
Hi Justin The button collection is defined as buttons(:delete_coupon, :id => 'delete-coupon') On Thursday, 20 September 2018 20:50:21 UTC+10, NaviHan wrote: > > I have a bag page where I have applied two coupons. Once the coupons are > applied the source looks like this > >

[wtr-general] How to take full screen, screenshots after test fails

2018-09-20 Thread NaviHan
Hi I have put this code in the hooks which takes scresnshot when a test fails. The issue is that Im not getting the full browser screen. Its chops off at the bottom After do |scenario| take_screenshot(@browser, scenario) end def take_screenshot(browser, scenario) time =

[wtr-general] Maybe look in an iframe? error when clicking button

2018-09-20 Thread NaviHan
I have a bag page where I have applied two coupons. Once the coupons are applied the source looks like this Applied codes: 9840150120702065 Remove autotest_order Remove There is a remove link(button) against each coupon. Basically my test clicks these buttons to

[wtr-general] Re: How often to get element reference, best practice?

2018-09-13 Thread NaviHan
Got you, Titus The fundamental aspects are clear now. I will get back if I find a real case in my project that is not working as per my understanding Thanks a million for taking time to clarify things. really appreciate it :-) Cheers Navi On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan

[wtr-general] Re: How often to get element reference, best practice?

2018-09-13 Thread NaviHan
Oh no Titus. Havent encountered such a scenario in my project. I just wanted to make my understanding clear. Except this dynamic "here" thingy everything regarding Watir waits is clear now.. :-) On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote: > > This is somethi

[wtr-general] Re: How often to get element reference, best practice?

2018-09-13 Thread NaviHan
; from "not-here" then wait_while_present will locate it. I hope you see where the confusion is. We never talks about the dynamic action which changes the class back to "here" On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote: > This is something that keeps

[wtr-general] Re: How often to get element reference, best practice?

2018-09-13 Thread NaviHan
rk" To conclude wait_while_present will successfully wait when the class transition as "here" to "not-here" to "here" Cheers On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote: > > This is something that keeps me a bit sceptic when I write and read the > a

[wtr-general] Re: How often to get element reference, best practice?

2018-09-13 Thread NaviHan
Yes Titus, I got that. But for that fresh retry from scratch to work, the class of the element has to go back to "here" from "not-here" isnt it? On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote: > > This is something that keeps me a bit sce

[wtr-general] Re: How often to get element reference, best practice?

2018-09-13 Thread NaviHan
has changed to "not-here" how the wait_while_present is going to work, basically the identifier has changed? Or did you mean that the class has changed from "here" to "not-here" and again it changed back to "here" ?? Cheers Navi On Tuesday, 11 September 2018 14:

[wtr-general] Re: How often to get element reference, best practice?

2018-09-12 Thread NaviHan
, 11 September 2018 14:52:33 UTC+10, NaviHan wrote: > > This is something that keeps me a bit sceptic when I write and read the > automation code in my project. > This used PageObjects. > > I have seen extensive use of element referces, for example > > button(:add_t

[wtr-general] Re: How often to get element reference, best practice?

2018-09-12 Thread NaviHan
;:present?). This is my theory. Is that correct? Cheers Navi On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote: > > This is something that keeps me a bit sceptic when I write and read the > automation code in my project. > This used PageObjects. > > I have seen extensive

[wtr-general] Re: How often to get element reference, best practice?

2018-09-11 Thread NaviHan
why we should ever use wait_until(&:present?) at all. Sorry if I sound stupid, becasue there is so much cinfusion around waits :-( Cheers Navi On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote: > > This is something that keeps me a bit sceptic when I write and read the >

[wtr-general] Re: How often to get element reference, best practice?

2018-09-11 Thread NaviHan
n action. Thanks On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote: > > This is something that keeps me a bit sceptic when I write and read the > automation code in my project. > This used PageObjects. > > I have seen extensive use of element referces, for example &g

[wtr-general] Re: How often to get element reference, best practice?

2018-09-11 Thread NaviHan
ading the notes I understood that they are different. Arent both waiting for deafult of "30" seconds for the element to be present? What is the difference between the two? On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote: > > This is something that keeps me a bit sceptic when I write a

[wtr-general] Re: How often to get element reference, best practice?

2018-09-11 Thread NaviHan
"add_to_bag_element.when_present.click" instead of "add_to_bag"? And is the wait the default of 30 seconds? Can you give an example where we have to explicitly wait? Cheers On Tuesday, 11 September 2018 14:52:33 UTC+10, NaviHan wrote: > > This is something that keeps me

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

2018-09-10 Thread NaviHan
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 shop

[wtr-general] wait_for_ajax method in PageObject gem, how to use in hooks?

2018-09-10 Thread NaviHan
We did discuss this previously. Im trying to find a way to use wait_for_ajax for each and every element. Titus or Justin has earlier suggested to move this to the hooks.rb file. Could you guys tell me how to use it in hooks? -- -- Before posting, please read

[wtr-general] How often to get element reference, best practice?

2018-09-10 Thread NaviHan
This is something that keeps me a bit sceptic when I write and read the automation code in my project. This used PageObjects. I have seen extensive use of element referces, for example button(:add_to_bag, :css => '#add-to-cart') add_to_bag.element.when_present.click instead of add_to_bag

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

2018-08-13 Thread NaviHan
All Even javascript is failing with same reason. So this again passed in Local machine but failed with the same reason on the Jenkins box. WTF!!! def rewards_popup_description #return cta_description_element.when_present.text.gsub(/[^$,.A-Za-z0-9]/," ") return

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

2018-08-09 Thread NaviHan
I posted the issue in stackoverflow :-( https://stackoverflow.com/questions/51777433/element-not-found-exception-in-jenkins-box-while-script-passing-in-local 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

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

2018-08-08 Thread NaviHan
the homepage without the popup... 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 >

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

2018-08-08 Thread NaviHan
) * watir (6.12.0) * watir-scroll (0.2.0) * watir-webdriver (0.9.9) * yard (0.9.15) * yard-cucumber (4.0.0) * yml_reader (0.7) 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

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

2018-08-08 Thread NaviHan
text.gsub(/[^$,.A-Za-z0-9]/," ") end end 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 i

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

2018-08-08 Thread NaviHan
THE TEXT end cheers 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 defi

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

2018-08-08 Thread NaviHan
.gsub(/[^$,.A-Za-z0-9]/," ") end def rewards_popup_expiration return cta_expiry_element.when_present(timeout = 10).text.gsub(/[^$,.A-Za-z0-9]/," ") end 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

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

2018-08-07 Thread NaviHan
b:Watir::Wait. until {search_field_element}.when_present.clear ./features/support/pages/Frontend/COG/Search_Page.rb:Watir::Wait. until {search_field_element}.when_present.click ./features/support/pages/Frontend/COG/Search_Page.rb:Watir::Wait. until {search_field_element}.when

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

2018-08-07 Thread NaviHan
ers Navi 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 e

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

2018-08-07 Thread NaviHan
Hi Titus I found a good deal of documentation from PageObject wiki so was able to substitue the waits with PageObject equivalent. https://github.com/cheezy/page-object/wiki/Ajax-Calls Still the issue with spinner(Loader.bg) holds and Im working this around using "Watir::Wait.until(timeout: 30)

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

2018-08-07 Thread NaviHan
Yes Titus. I actually meant click after the wait. The stale element issue is resolved with Watir upgrade. I used jquery statement and managed to fix the issue. But what is the page object way to do that? Also could you please clarify the difference between wait.until(&:present?) and

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

2018-08-06 Thread NaviHan
ome=68.0.3440.84) (Driver info: chromedriver=2.36.540470 (e522d04694c7ebea4ba8821272dbef4f9b818c91),platform=Windows NT 6.1.7601 SP1 x86_64) 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 ad

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

2018-08-06 Thread NaviHan
ber:23:in `load' C:/Ruby24-x64/bin/cucumber:23:in `' features/Store_Stock_Finder-AU.feature:155:in `And the user selects the co lor "black"' 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 &

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

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

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

2018-08-06 Thread NaviHan
click if el.attribute('title').include? "#{color}" end Im so much confused about the Watir::Wait.until, wait_until, wait_while methods. Putting a sleep instead gives more favorable outputs. Thanks in advance But putting a sleep before works fine. How are both different On Friday, 3 August

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

2018-08-05 Thread NaviHan
Thanks Titus Just wondering the difference between wait_until and wait_while. Do they bot do the same thing? 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

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

2018-08-05 Thread NaviHan
what is the difference between "(&:present?)" and "(present)?" Cheers 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 me

[wtr-general] Re: Watir Website Updates

2018-08-04 Thread NaviHan
Great news Titus. I never knew about this blog. Splendid content at first glance. Will definitely give feedback once I have a detailed look. Great to see experts like you contributing to the QA world. On Saturday, 4 August 2018 14:10:51 UTC+10, Titus Fortner wrote: > > I've been doing a good

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

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

[wtr-general] Re: Trouble clicking a nested radio button under a unordered list and list item using PageObject

2018-07-25 Thread NaviHan
lass: ['swatches', 'instore']` Thanks a lot for taking time to assist :-) On Wednesday, 25 July 2018 13:51:06 UTC+10, NaviHan wrote: > > Banging my head over this. > I have a section of page with a paren unordered list , list item and child > radio buttons > > "true"

[wtr-general] Re: Trouble clicking a nested radio button under a unordered list and list item using PageObject

2018-07-25 Thread NaviHan
set.radio(value: "XS").label.visible?) puts "visible" else puts "Not Visible" end Thanks On Wednesday, 25 July 2018 13:51:06 UTC+10, NaviHan wrote: > > Banging my head over this. > I have a section of page with a paren unordered list , list item and child > r

  1   2   >