[wtr-general] Re: Next release?

2020-08-27 Thread Justin Ko
Titus released v6.17.0 last night. Watir still has active support. This mailing list, Stack Overflow and Slack usually get a response. Active development will vary based on how much free time the developers have - eg this past year has been pretty bad. If there's something you need, feel free t

Re: [wtr-general] Re: Elements - Multiple locators for same element

2019-12-04 Thread Justin Ko
Hi Andrei, Do you have an example of where an OR evaluation is useful? As Titus said, it's not usually the way to go. That said, I'm pretty sure I've done it before. The solution usually depends on what you are trying to do and the page. For example: - If you wanted to match elements with

[wtr-general] Re: Watir Changing Element Collection if Negated Attribute Present

2019-09-24 Thread Justin Ko
I cannot think of why the collection would change automatically, but here are some things that might help debug the issue: 1. Share the webdriver logs for the scenario (enable using Selenium::WebDriver.logger.level = :info) 2. Is "errors" a custom method or variable? The smalls accessor

Re: [wtr-general] Re: Click succeeds but action as the result of that click is not triggered

2019-08-12 Thread Justin Ko
Manually (ie as a person, not automated by Watir) doing the steps, I am able to reproduce the problem. It happened frequently in Firefox, but could also be seen occasionally in Chrome. As the problem can be seen manually, this does not seem to be a Geckodriver, Watir or Selenium problem. To me,

[wtr-general] Re: how to convert selenium element into watir element

2019-06-20 Thread Justin Ko
There is an :element locator that takes the Selenium object: element = driver.find_element(id: 'something') watir_element = browser.element(element: element) Justin On Thursday, June 20, 2019 at 3:28:45 AM UTC-4, rajagopalan madasami wrote: > > I know how to convert WATIR element into selenium

[wtr-general] Re: How to call the custom tags?

2019-05-29 Thread Justin Ko
;> >>> Justin, >>> >>> Can you please help me to write this code in watir? >>> >>> b.span(xpath: >>> "//label[@title='Subject']/following-sibling::div/lf-select/div/span").click >>> >>> >>

[wtr-general] Re: How to call the custom tags?

2019-05-28 Thread Justin Ko
For custom elements, you will need to use the #element method: b.element(tag_name: 'lf-select') Justin On Tuesday, May 28, 2019 at 1:15:05 AM UTC-4, rajagopalan madasami wrote: > > Hi, > > I have a custom tag named `lf-select` > > Can't I call in WATIR like > > b.lf_select() > > Or something li

Re: [wtr-general] Re: New warning is showing up now

2019-05-10 Thread Justin Ko
It does not look like Selenium-WebDriver provides a mechanism for ignoring specific deprecations. You will have to monkey-patch the error away: require 'selenium-webdriver' module Selenium module WebDriver module Error # rubocop:disable Metrics/ModuleLength def self.const_missing(con

[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 Justin Ko
Hi Navi, 1) It would depend on who is calling the method - ie a Watir::Element vs a PageObject::Element. Generally you would be working with PageObject::Element, so you would be calling the Page-Object version. The recent versions of Page-Object forward missing methods directly to the Watir br

[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 Justin Ko
Page-Object introduces its own couple of waits (https://github.com/cheezy/page-object/blob/master/lib/page-object.rb#L87-L113): - default_page_wait which has a default of 30 and - default_element_wait which has a default of 5 The default_element_wait will impact the Element methods #check_

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

2019-04-11 Thread Justin Ko
Hi Navi, At this point, I would say there is a design flaw in Page-Object's #alert method, which does: if @browser.alert.exists? value = @browser.alert.text @browser.alert.ok end The conditional check is likely the cause of your problem. I don't know the history of how we got here, but my

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

2019-04-10 Thread Justin Ko
The --window-position arguments should be without a space - eg: args = ['--window-position=-3000,0'] browser = Watir::Browser.new :chrome, options: {args: args} Note that this is just positioning it off-screen; not actually minimizing. Justin On Wednesday, April 10, 2019 at 12:33:41 PM UTC-4,

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

2019-04-04 Thread Justin Ko
Sorry Navi, I'm not too familiar with the inner workings of Cucumber. I abandoned it long ago for RSpec. While people on this mailing list can likely help with how to use Cucumber, understanding the internal workings is likely better suited in Cucumber's mailing list (or whatever they use). For

Re: [wtr-general] Re: Action Builder

2019-04-04 Thread Justin Ko
nium > click? > > On Wed, 3 Apr, 2019, 9:45 PM Justin Ko, > > wrote: > >> There is nothing directly provided for working with the ActionBuilder. If >> you need to call the ActionBuilder, you will need to access the >> Selenium::WebDriver and

[wtr-general] Re: Action Builder

2019-04-03 Thread Justin Ko
There is nothing directly provided for working with the ActionBuilder. If you need to call the ActionBuilder, you will need to access the Selenium::WebDriver and convert the Watir::Element using #wd - eg: browser.driver.action.click(your_watir_element.wd).perform Note that there are methods tha

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

2019-03-27 Thread Justin Ko
If there are no matching elements, you should get an empty Array: p page.products_on_wishlist_elements.class #=> Array p page.products_on_wishlist_elements #=> [] Justin On Wednesday, March 27, 2019 at 8:18:45 AM UTC-4, NaviHan wrote: > > Hi Titus > > I read a wondeful article about the enumera

[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 Justin Ko
s => "wishlist-remove-all") > span(:remove_all_link){ wishlist_remove_all_element.span } > > Justin is there an easier way to do this in PO gem? > > > > > > On Tuesday, March 26, 2019 at 11:39:39 AM UTC-5, Justin Ko wrote: >> >> In most cases, it is si

[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 Justin Ko
In most cases, it is simply a matter of personal preference. There is usually no technical difference between between using CSS/XPath vs attributes. To me, the most important thing is to be consistent as an organization so that code is consistent, which makes the code easier to read/maintain. I

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

2019-02-02 Thread Justin Ko
Hi, 1. The monkey patch is redefining the method. Last definition wins. It is how Ruby is designed, nothing specific to Page-Object. A simpler isolated example: def a 'hi' end def a 'bye' end puts a #=> "bye" Notice that you can define the method twice, but when called, the last defin

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

2019-02-01 Thread Justin Ko
Yes, that would work. Personally, I find "falsey" hard to type. Technically it also includes "nil", though #present? shouldn't return that. I tend to go with: expect(on(MyAccountPage).reward_history?).to eq false The monkey patch is redefining the method. It's one of those good and bad things

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

2019-01-31 Thread Justin Ko
You are correct that #reward_history? calls #exists?. There is no auto-generated method for #present?. It is rather unfortunate. Checking presence is probably more common than checking existence. As a backwards incompatible change, it'll take some time to change. If you want, you could monkey-

Re: [wtr-general] Re: b.select_list.select is not working in 6.16

2018-12-21 Thread Justin Ko
t mail. Can you look into that > ? > > On Wed 19 Dec, 2018, 9:43 PM Titus Fortner wrote: > >> Our specs are all passing, so you need to provide a reproducible issue >> so we can add the use case to our test suite. >> >> On Wed, Dec 19, 2018 at 8:50 AM Justin K

[wtr-general] Re: b.select_list.select is not working in 6.16

2018-12-19 Thread Justin Ko
Can you elaborate on what is not working? I get the same behaviour in 6.14 and 6.16 when running the below script - ie `browser.select_list.select` does not select anything. gem 'watir', '=6.14' require 'watir' browser = Watir::Browser.new browser.goto 'test_page.html' browser.select_list.sele

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

2018-11-24 Thread Justin Ko
Hi Navi, One element still counts as a collection, so it should work. What error did you get? Justin On Saturday, November 24, 2018 at 12:52:22 AM UTC-5, NaviHan wrote: > > Hi Justin > > The collection was the first thing I tried. But the issue is when there is > only one gift card applied, m

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

2018-11-23 Thread Justin Ko
Instead of working from the the "gc-list", you could work from the "gift-cards-list". It would save a level of nesting and eliminate the child vs descendant difference: # Page-Object divs(:applied_gift_card, :class => 'gift-cards-list') # Usage p page.applied_gift_card_elements[0].div_element(i

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Justin Ko
Any chance you can capture a video of the test? It's hard to reconcile this discussion and logs without seeing anything. Justin On Tuesday, November 6, 2018 at 12:37:01 PM UTC-5, rajagopalan madasami wrote: > > I am calling this function > > def waitForPageLoad > > @b.wait_until(timeout: @Pa

Re: [wtr-general] Re: problem when locating the element

2018-11-06 Thread Justin Ko
>From the logs, I see: 1. A "Checking this box will delete any prior coverages" alert is accepted 2. The NavContinue button is retrieved (elementID: 04743404-40e9-4dc0-bae8-1f3e270f3eae) 3. Several clicks are attempted, but intercepted by 4. Several clicks are attempted, but r

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

2018-10-02 Thread Justin Ko
Hi Navi, I would expect the closing situation to be much simpler. You should be able to just check that the element is no longer present: slide_dialog = browser.div(id: 'slide-dialog-container') slide_dialog.wait_while(&:present?) The overflow was only important in the expanding case as it mean

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

2018-09-26 Thread Justin Ko
Navi, In the video of the problem, you can actually see the overflow style change while the section is sliding. You can also see it change using the following Watir code: browser.link(text: 'Sign in here').click slide_dialog = browser.div(id: 'slide-dialog-container') 150.times { puts slide_di

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

2018-09-25 Thread Justin Ko
r.div(id: 'slide-dialog-container').wait_until do |s| s.present? && s.style('overflow') == 'visible' end continue_as_guest_element.click end Justin On Tuesday, September 25, 2018 at 2:42:02 PM UTC-4, Justin Ko wrote: > > Element#height didn&

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

2018-09-25 Thread Justin Ko
Element#height didn't work for me. It was returning height of the div including the part cut-off by the overflow. The clientHeight gave the height excluding the cut-off portion. Justin On Tuesday, September 25, 2018 at 2:33:06 PM UTC-4, Titus Fortner wrote: > > Also, Watir has a `Element#heigh

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

2018-09-25 Thread Justin Ko
It looks like the button itself isn't sliding. The div that contains it is actually increasing in height. So my previous suggestions about waiting for the button to stop moving doesn't work. I'm still not quite clear on how the click is getting intercepted. However, waiting for the section to

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

2018-09-25 Thread Justin Ko
(Sorry, if some of this repeats Titus's response. I was half way through this when he replied.) If I'm envisioning the sliding correctly, I believe what happens is: 1. The button starts sliding on to the page (at which point it'll be considered present) 2. The coordinates of the button are retri

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

2018-09-20 Thread Justin Ko
Sounds like the timing issue. Maybe try waiting for the coupon to be removed before continuing: delete_coupon_elements.find{|el| el.value.to_s == coupon_id.to_s}.tap(&: click).wait_while(&:present?) Justin On Thursday, September 20, 2018 at 9:30:17 AM UTC-4, NaviHan wrote: > > Hi Justin > > T

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

2018-09-20 Thread Justin Ko
Hi Navi, Selenium only screenshots the content in the viewport. If you want the whole browser, you would need to take multiple screenshots. There was a gem recently released to do this - https://github.com/samnissen/watir-screenshot-stitch Though I haven't tried it myself. Justin On Thursda

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

2018-09-20 Thread Justin Ko
Hi Navi, How is #delete_coupon_elements defined? I would have expected it to re-determine the collection each time it was called. Titus made some fixes around collections in 6.13 and 6.14. You could see if that resolves your issue. I suppose it could be a timing issue - eg : 1. The first coupo

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

2018-09-12 Thread Justin Ko
Hi Navi, I don't think you'll be able to directly call Page-Object's #wait_for_ajax from an after hook. You'll have to do the wait directly. I believe you said you were using jQuery. Where you are initializing the browser, add the following line to add the after_hook: browser = Watir::Browser.

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

2018-09-11 Thread Justin Ko
Hi Navi, (This is just response to your first reply. I'll have a look at your other replies when I have more time.) `add_to_bag_element.when_present.click` would be Page-Object code rather than Watir code. There are no warnings that would be thrown from it. Switching to `add_to_bag` will incre

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

2018-09-11 Thread Justin Ko
In that example, you should just #add_to_bag. I'm guessing that you are working with a code base that is older than Watir 6.0. Before v6.0, add_to_bag_element.when_present.click was required for elements that were not immediately present on page load (ie you needed to wait for them to appear).

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

2018-08-07 Thread Justin Ko
>>>>>>> >>>>>>> On Tuesday, August 7, 2018 at 9:54:17 PM UTC+5:30, Titus Fortner >>>>>>> wrote: >>>>>>>> >>>>>>>> jquery_wait = lambda { |br| br.wait_until { |b| >>>>>>>&

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

2018-08-07 Thread Justin Ko
The #wait_for_ajax simplifies things if you need to manually call it. However, it sounds like you would have to sprinkle this everywhere. I would suggest adding the jQuery.active check to your browser's after_hooks. Ideally this would catch all (or at least most) of the problems. Note that the

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

2018-08-07 Thread Justin Ko
Hi Navi, Just to be clear, are you saying that "Watir::Wait.until(timeout: 30) { @browser.execute_script('return jQuery.active == 0')}" solves the timing issue? You are just asking if there is a Page Object way to avoid doing this manually everywhere? Thanks, Justin On Tuesday, August 7, 2018

[wtr-general] Re: Trouble Locating elements using PageObject

2018-07-12 Thread Justin Ko
> > 1. Just like we do plural for div, I mean divs, isnt there plural version > for select_list i:e select_lists? Similarly buttons? > How do we know if there is a plural version at all. I couldn't find > the documentation. > The plural version `#select_lists` does exist. I don't think ther

[wtr-general] Re: Trouble Locating elements using PageObject

2018-07-11 Thread Justin Ko
The accessors do not provide a mechanism for filtering the element collection. In other words, the exception is from `product_line_items_in_bag_elements(:"data-product-id" => '9350486827327')`. You can filter the elements manually using `#find`: class MyPage include PageObject elements(:pr

[wtr-general] Re: Trouble Locating elements using PageObject

2018-07-10 Thread Justin Ko
Hi, Accessing the spans within minimum_spend_threshold_error would be similar to what you did with nav_div_elements: page.minimum_spend_threshold_error_element.span_elements[0].html #=> "" page.minimum_spend_threshold_error_element.span_elements[1].html #=> "Sorry, your Perks Payday Voucher wil

Re: [wtr-general] Re: can you run the scripts on Win10\ chrome? Used to be working a while ago

2018-06-27 Thread Justin Ko
> > The question regarding Chrom is still valid. Can anyone drive the chrome > and goto an url on win 10? > Chrome works for me on Windows 10 Pro using: - Watir 6.11 - Selenium-WebDriver 3.13 - Chrome 67 - Chromedriver 2.4 Justin -- -- Before posting, please read https://github.com/watir/wa

Re: [wtr-general] Re: how can I click an

2018-06-22 Thread Justin Ko
cript click, it is > not choosing as selenium click towards the option would choose the option . > But button click remain the same for both, do know why it is ? > > On 23-Jun-2018 1:06 AM, "Justin Ko" > > wrote: > > Do you try using the :id locator? It looks l

[wtr-general] Re: how can I click an

2018-06-22 Thread Justin Ko
Do you try using the :id locator? It looks like you might have crossed your attributes/values - ie the attempts are checking the "fielddisplayname" attribute, but looking for the id value. Try: @browser.a(id: "Employee_ID").click If #click isn't working, you could also try #click! @browser.a(

Re: [wtr-general] Re: visible_text is deprecated

2017-12-13 Thread Justin Ko
...@gmail.com wrote: > > This change available in recent water 6.10.1? > > On Tuesday, December 12, 2017 at 11:39:51 PM UTC+5:30, Justin Ko wrote: >> >> Rajagopalan, would you be able to see if the changes I have made in >> https://github.com/jkotests/watir/t

Re: [wtr-general] Re: visible_text is deprecated

2017-12-12 Thread Justin Ko
Rajagopalan, would you be able to see if the changes I have made in https://github.com/jkotests/watir/tree/simplify_locator fixes the performance problem for :visible_text? I think the problem is where we filter elements: def filter_elements_by_locator(elements, visible = nil, visible_text = ni

[wtr-general] Re: visible_text is deprecated

2017-12-10 Thread Justin Ko
Yes, the plan is to remove :link, :link_text and :partial_link_text. It is known that using :visible_text will not have the same performance. It has to iterate over elements, where as the Selenium ones would not. The benefit of :visible_text is that we can apply it across all element types, not

[wtr-general] Re: Unable to use API Locators using Watir 6.8.4

2017-11-29 Thread Justin Ko
How did you define `@b`? Based on the exception and behaviours you are seeing, it sounds like you've created a Selenium::WebDriver instead of a Watir::Browser. The initialization should be like: @b = Watir::Browser.new - Justin On Wednesday, November 29, 2017 at 3:45:21 PM UTC-5, Jeff Fagot

[wtr-general] Re: link and link_text not working in Watir 6?

2017-10-19 Thread Justin Ko
> > If you try to use something like browser.link(text: "Services").click, it > says: > > "element located, but timed out after 30, seconds." > The problem here is that there are actually 2 services links on the page. One is in the mobile nav menu (when the browser width is small) and one is

[wtr-general] Re: link and link_text not working in Watir 6?

2017-10-19 Thread Justin Ko
:link and :link_text are Selenium-WebDriver locators. Their support is quite limited in Watir. They are only accepted when using the #element method: browser.element(link_text: "Services").exists? #=> true browser.element(link: "Services").exists? #=> true Instead, I would suggest using :text:

[wtr-general] Re: document object could not be used in watir-webdriver

2017-07-04 Thread Justin Ko
7;return window.getComputedStyle(arguments[0]).backgroundColor;', control) For this specific example, you can simply this further by using Watir's built-in `style` method instead: control.style('background-color') - Justin Ko On Tuesday, July 4, 2017 at 11:41:33 AM UTC-4, AROCKI

Re: [wtr-general] Selenium clicks the line but WATIR doesn't click the same link, So there is a bug the way WATIR identifying the Link

2017-03-28 Thread Justin Ko
The difference appears to be that `b.link(:text, 'Recharge')` includes hidden links, where as `driver.find_element(:link, 'Recharge')` only includes visible links. The page includes 8 links with the matching text: Recharge Recharge https://www.airtel.in/netbanking/payments-recharges"; data-i1

[wtr-general] Re: goto method not found

2016-10-04 Thread Justin Ko
"Feeling Lucky" button. However, when > I change it to any reasonable id I discover when using GoogleChrome > Developer Inspect Tool. I get various errors, including selenium > ElementNotVisibleError, and Watir UnknownMethodException. I would not think >

[wtr-general] Re: goto method not found

2016-10-04 Thread Justin Ko
of output. > I did not make a copy of the spec_helper before I ran the install. > What should I look for in there? > > thanks! > -AZ > > > On Tuesday, October 4, 2016 at 6:52:30 AM UTC-7, Justin Ko wrote: >> >> It sounds like the Watir::RSpec::Helper has not be

[wtr-general] Re: goto method not found

2016-10-04 Thread Justin Ko
It sounds like the Watir::RSpec::Helper has not been added to the example groups. Did you run the "watir-rspec install" (see last step of installation)? The install augments your project's spec_helper file to include this module and other related parts. In terms of the debugging question, I do

[wtr-general] Re: cannot load such file - LoadError

2016-07-12 Thread Justin Ko
contain data_form.yml) and it is not likely to be relative to env.rb - Justin Ko On Monday, July 11, 2016 at 3:49:14 PM UTC-4, Ajay Reddy wrote: > > Hello All, > I am getting this error "cannot load such file > -/pages/Config/data/data_form.yml (LoadError)", can any one fi

Re: [wtr-general] Upload multiple files to input element?

2016-05-13 Thread Justin Ko
Last time I checked, Webdriver did not have full support for uploading multiple files. For at least Chrome, a workaround was to use `send_keys` and deliminate the files using "\n": browser.file_field.send_keys("full/path/file1.txt \n full/path/file2.txt") - Justin Ko On

[wtr-general] Re: Reg: iterating a loop in watir web driver

2015-07-31 Thread Justin Ko
The exception is saying that there is no method `table` for `@adl_name_search`. Are you sure you are calling the `table` method for the right object? It should be called for a Watir::Browser or a Watir::Element. Once you do get the table element, you can iterate through each td element by retri

[wtr-general] Re: Need help how to work with watir testing angularjs app

2015-07-15 Thread Justin Ko
use one of the other attributes instead. For example: browser.element(aria_label: 'Remove').click - Justin Ko On Tuesday, July 14, 2015 at 8:49:34 AM UTC-4, Mahesh Mesta wrote: > > Hi, > > I am very new to watir. I have been trying to test the edit profile of an > applicat

[wtr-general] Re: Skip external links

2015-07-02 Thread Justin Ko
erform actions on the page p b.url end - Justin Ko On Monday, June 29, 2015 at 1:40:30 PM UTC-4, Sergiu Cornea wrote: > > Good afternoon guys, > > I was wondering if someone could help me. > > Please correct me if I am wrong as I have just started learning Watir and >

Re: [wtr-general] Drag n Drop not working for me with Firefox version25

2015-03-18 Thread Justin Ko
rsion 2.39.0 (ie the last release with support for Firefox 25). Depending on the changes, you may or may not also need to downgrade Watir-Webdriver to match. Justin Ko On Tuesday, March 17, 2015 at 9:02:49 AM UTC-4, Joe Fl wrote: > > Hi Titus, > > Thanks for responding. I gave tha

[wtr-general] Re: automating httpwatch with watir

2015-03-03 Thread Justin Ko
ntrol = WIN32OLE.new('HttpWatch.Controller') plugin = control.IE.Attach(ie.ie) # Start recording plugin.Record() # Drive the browser ie.goto('www.google.ca') # Stop recording plugin.Stop() # Save the log file plugin.Log.Save('C:\Documents and Settings\Setup\Desktop\log.hwl'

[wtr-general] Re: how to read the meta content

2014-12-16 Thread Justin Ko
You can use the `content` method to return the value of the content attribute: p browser.meta.content #=> "this is variable" Justin On Tuesday, December 16, 2014 11:41:23 AM UTC-5, christina wrote: > > Hi, > > > > Hi Please can one help me an tell how can I read the "Content" > > for meta tag

Re: [wtr-general] Re: HELP - Acessing password (text) field

2014-11-25 Thread Justin Ko
7;bar' The `when_present` method tells Watir to wait for the element to appear before setting it. - Justin Ko On Monday, November 24, 2014 5:49:02 PM UTC-5, Alberto Magalhães wrote: > > same error :-( > > require 'watir-webdriver' > browser = Watir::Browser.new :chr

[wtr-general] Re: page-object and frames

2013-12-03 Thread Justin Ko
You can use the generic element accessor, which is in the form element(:name, :tag_name, :identifier => 'value'). For example: element(:fckeditor, :frame, :id => 'editor') This would let you do: fckeditor_element.send_keys("This is my text") Note that you can also locate the element directly,

[wtr-general] Re: Error selec_list on modal dialog

2013-11-18 Thread Justin Ko
I created an issue for this - https://github.com/watir/watir-classic/issues/64 In the short term, I think the best solution might be to simply monkey patch a focus method in for the modal dialog. This would address the exception without impacting focusing of elements in the regular part of the

[wtr-general] Re: Nokogiri + Watir

2013-09-03 Thread Justin Ko
yntax. Unfortunately, at this point, there is no automatic integration with the Watir browser (ie you have to manually pass the Watir html to the WatirNokogiri parser). - Justin Ko -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice.

[wtr-general] Re: Any fast ways to parse a table

2013-07-12 Thread Justin Ko
tent7', 'col8' => 'Row30 Content8' } myArray = myHash.values start = Time.now obj = ie.table(:id,'table1') nokogiri = Nokogiri::HTML.parse(obj.html) nokogiri.css('tr').each_with_index do |tr, i| if tr.css('td').collect(&:text

[wtr-general] Re: Watir and Chrome: unit tests give Errno::ECONNREFUSED once in 50 tests

2013-04-19 Thread Justin Ko
Based on the exception, it looks like you are on selenium-webdriver version 2.29.0. You should probably try upgrading to the latest version, which is 2.32.1. Justin On Thursday, April 18, 2013 5:45:04 AM UTC-4, gu...@dna-7.com wrote: > > Hello, > > I use Watir and the Chrome Webdriver in my un

[wtr-general] Re: How to determine selection criteria (e.g. :name) supported by a given element in watir-webdriver?

2013-03-01 Thread Justin Ko
.). I believe it is auto-generated some how. Justin Ko On Friday, March 1, 2013 1:04:25 PM UTC-5, Chuck van der Linden wrote: > > We used to have a big chart, which listed all the elements, and what could > be used to identify them, but it was hard to keep up to date, and I'm not &g

[wtr-general] Re: How do I get the maxlength for a text_field?

2013-02-13 Thread Justin Ko
In watir-webdriver, you would have to use the attribute_value method: browser.text_field.attribute_value('maxlength') Justin On Tuesday, February 12, 2013 12:51:03 AM UTC-5, Phuoc Can Hua wrote: > > I used to use textField().maxlength in my scripts. Now I've changed it to > use 'watir-webdrive

[wtr-general] Re: watir-classic user agent

2013-01-28 Thread Justin Ko
That same code will work in watir-classic. The execute_script method exists in watir-classic and navigator.userAgent is supported in all major browsers (http://www.w3schools.com/jsref/prop_nav_useragent.asp). - Justin Ko On Monday, January 28, 2013 11:49:16 AM UTC-5, Dan wrote: > > Is

Re: [wtr-general] Failed 'assert' statement doesn't get rescued

2012-12-19 Thread Justin Ko
egin assert(false) rescue MiniTest::Assertion p "Batdog to the Rescue!" end end end - Justin Ko On Wednesday, December 19, 2012 10:35:26 AM UTC-5, captin wrote: > > Thank you for your reply and for taking the time to assist me. As I stated > in my OP, I&

[wtr-general] Re: Isn't .exists? a boolean method?

2012-12-12 Thread Justin Ko
Are you using Firefox? I had this problem after updating Firefox to version 17. Upgrading to the latest version of selenium-webdriver (2.27.2) fixed the issue for me. Justin On Wednesday, December 12, 2012 12:15:56 PM UTC-5, Abe Heward wrote: > > Note that I am using Watir-webdriver 0.6.2 > >

Re: [wtr-general] undefined method `exists?' for link (PageObject gem)

2012-11-02 Thread Justin Ko
The page object gem automatically creates a method for checking existence - see the docs http://rubydoc.info/github/cheezy/page-object/master/PageObject/Accessors#link-instance_method. So for: link(:signout, :text => 'Sign Out') There should be able to do: signout? - Justin K

[wtr-general] Re: watir-classic Element#style vs watir-webdriver Element#style

2012-10-26 Thread Justin Ko
formats for some of the properties (example 'color'). Justin Ko On Friday, October 26, 2012 6:26:53 AM UTC-4, Connor C wrote: > > Hey Jarmo or whoever else can help :), > > In the latest wair-classic the Element#style() method works as follows > ># return the css style

[wtr-general] Re: Unable to select item from selectlist on watir-classic 3.2: SystemStackError: stack level too deep

2012-10-19 Thread Justin Ko
To reproduce the SystemStackError error, you can use the w3schools page: require 'watir-classic' browser = Watir::Browser.new browser.goto('http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select') browser.frame(:name, 'view').select_list.select('Saab') Or if you want to do it locally, yo

[wtr-general] Re: Win32-process error Installation Watir 2.0.4

2012-10-19 Thread Justin Ko
When you try to install watir 2.0.4, it will grab the latest version of the win32-process gem (and other dependencies) unless you already have one installed. Currently the win32-process gem is at version 0.7.0, which you do not want. So the solution is to manually install a prior version of the

[wtr-general] Retaining variables between tests in a thread-safe manner

2009-02-05 Thread Justin Ko
l:NilClass caller.rb:16:in `test_navigate_somewhere_else' Question: Are there any ideas on how we can retain a variable (the browser) between tests, yet still be thread-safe? Thanks, Justin Ko Code: require 'watir' require 'watir/ie' require 'test/unit'