Re: [wtr-general] Watir - How to call browser.goto from another file

2022-03-24 Thread 'John Fitisoff' via Watir General
Replace all hard-coded instance of the the URLs with a variable or a constant. Store that different URLs in a hash in a file. Something like this: URLS = {  dev: 'https://url1.com',  prod: 'https://url2.com'} Then, in whatever you're using to run the script, add an option to specify the

Re: [wtr-general] not able to click on button that is visible.

2021-02-05 Thread 'John Fitisoff' via Watir General
Just a guess but the page HTML may have multiple buttons that match value: "OK" (and you're getting the very first one, which isn't the one that you actually want.) It's been a while but think you could add visible: true if that's the case, then it should find the one that you're looking for.

Re: [wtr-general] Re: List of items that refresh every second

2019-02-12 Thread 'John Fitisoff' via Watir General
I may be misunderstanding, but you probably want something that'll loop until a condition is met, then poll all of the (divs, spans whatever) checking for one with text matching job name + status. Watir has some wait functionality and there are gems that do this also. rspec-wait's pretty good

Re: [wtr-general] WATIR can be used for AngularJS?

2019-02-02 Thread 'John Fitisoff' via Watir General
I wrote something with Angular in mind. Some sample tests for Google's angular components are here: https://github.com/jfitisoff/insite/blob/master/spec/material_angular_io_spec.rb And Google's showcase for those components are here (the tests utilize this site): https://material.angular.io I

Re: [wtr-general] How do i copy employee dataset into a textbox accurately?

2018-10-14 Thread 'John Fitisoff' via Watir General
If Titus's suggestion doesn't sort it it's worth checking to see if line breaks are getting handled properly and that the encoding is handled properly. Found a random link:

Fw: [wtr-general] Re: Uploading file to a readonly field

2017-10-11 Thread 'John Fitisoff' via Watir General
maybe jdenen/watir-ng | | | | || | | | || jdenen/watir-ng watir-ng - Identify watir-webdriver elements with ng directives | | | | × - Forwarded Message - From: Raymond Raymundo To: Watir General

Re: [wtr-general] How to select a csv file from hard disc using watir ruby on MAC OS

2017-09-01 Thread 'John Fitisoff' via Watir General
#!/usr/bin/env ruby# Encoding: utf-8 # Paste everything into script, including the shebang and encoding# lines above.# Don't forget to make script executable.# Usage: ./some_script.rb /path/to/csv require 'csv'obj = CSV.read(ARGV[0]) # ARGV is an array that will have the cmd line args.

Re: [wtr-general] Exist method is needed while I use visible method, Can it be avoided?

2017-03-23 Thread 'John Fitisoff' via Watir General
i'm not sure if it slows things down a lot. think you need to do some level of checking anyway. one way of implementing this sort of thing would be to try to write or whatever and only do polling when the op is going to fail. i suspect it's probably done like that. you'd be better off using

Re: [wtr-general] Exist method is needed while I use visible method, Can it be avoided?

2017-03-23 Thread 'John Fitisoff' via Watir General
try .present? instead From: Raja gopalan To: watir-general@googlegroups.com Sent: Thursday, March 23, 2017 9:52 AM Subject: [wtr-general] Exist method is needed while I use visible method, Can it be avoided? I find I couldn't use visible method without

Re: [wtr-general] Is Watir the right tool?

2017-02-15 Thread 'John Fitisoff' via Watir General
it's a browser automation tool that requires ruby, so basically if it's html and you can use ruby then the answer is yes From: "achirotou...@gmail.com" To: Watir General Sent: Wednesday, February 15, 2017 11:00 AM Subject:

Re: [wtr-general] angular login

2017-02-03 Thread 'John Fitisoff' via Watir General
i think watir-ng just gives you the ability to use non-standard attributes not sure if this'll work with the new watir codebase without adjustments but we're using something like this to access a custom "role" attribute  Watir::HTMLElement.attributes << :role module Watir  class Element   

Re: [wtr-general] Re: Clicking out of view elements chrome/chromedriver

2017-02-01 Thread 'John Fitisoff' via Watir General
Yeah, I've seen it. It's been a while since I've used ChromeDriver on a regular basis but my recollection was that it seemed a little fussier about that sort of thing.  From: Brian Rieck To: Watir General Sent: Wednesday, February

Re: [wtr-general] iterating LI through elements

2017-01-03 Thread 'John Fitisoff' via Watir General
Watir models everything in the DOM. So think something like this should work b.uls.each do |ul|  ul.lis.each { |li| p li.text }end  From: "artie.z...@gmail.com" To: Watir General Sent: Tuesday, January 3, 2017 2:59 PM Subject:

Re: [wtr-general] How to click specific link in table?

2016-12-28 Thread 'John Fitisoff' via Watir General
May be semantics, but you mentioned clicking on a link to call a button, which could be a problem if the element truly is a link. If it's a link then you should try to access it that way: book_rows.a(value: /view/i).click. There might be more than one table with that id: @browser.tables(id:

Re: [wtr-general] Re: latest watir giving error with firefox

2016-12-15 Thread 'John Fitisoff' via Watir General
I can't remember for sure if this is the same thing but you may want to try this, grabbed it from our framework: # Absolutely, positively have to have this to create browser instances via webdriver.# Something in the Ruby stack is modifying how Kernel#exec works. This setting# allows

Re: [wtr-general] Re: "watir webdriver cannot select checkbox input element"

2016-08-09 Thread 'John Fitisoff' via Watir General
It's most likely exactly what Titus suggested. One other thing you can do, in addition to providing the HTML he asked for, is to see how many elements there are that match. Stuff like this: b.checkboxes(:id => 'sv').length # More than 1? If so, the one you want may be one of the others

Re: [wtr-general] How to identify the index of an element by text

2016-07-18 Thread 'John Fitisoff' via Watir General
probably nicer ways are doing it but think this'll work index = nilb.divs(:class, 'grid').each_with_index do |div, idx|  index = idx if div.text =~ /text6/  break if indexend From: Soori To: Watir General Sent: Monday, July 18, 2016

Re: [wtr-general] cannot load such file — Config/Data/data_form.yml (LoadError)

2016-07-11 Thread 'John Fitisoff' via Watir General
Hard to say. If you're kicking off things with a Ruby script and that script's above the stuff that you want to load, you may want to start off with putting it there From: Ajay Reddy To: Watir General Cc:

Re: [wtr-general] cannot load such file — Config/Data/data_form.yml (LoadError)

2016-07-11 Thread 'John Fitisoff' via Watir General
Ruby has a $LOAD_PATH constant that tells it where to look for things. I usually do something like this to add something for the 'root' directory where I have some files that I need to access: root = File.expand_path(File.dirname(__FILE__))$LOAD_PATH.unshift(root) And then you should be able to

Re: [wtr-general] Passing value to is not working

2016-06-08 Thread 'John Fitisoff' via Watir General
may need to click on the input inside td From: sivam To: Watir General Sent: Wednesday, June 8, 2016 8:46 AM Subject: [wtr-general] Passing value to is not working Hi all, I am using watir 1.6.5 to interact with pages. I got

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

2016-05-14 Thread 'John Fitisoff' via Watir General
File fields have security restrictions, not sure if that'll work. Created an HTML page with a file field to poke around, didn't have much luck. Did see something about some workaround using send_keys and ChromeDriver but that didn't seem to work when I tried it (maybe I missed something)

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

2016-05-13 Thread 'John Fitisoff' via Watir General
Maybe something like this. First thing to try, anyway. Method may take multiple file args, can't remember offhand  # http://www.rubydoc.info/gems/watir-webdriver/Watir/FileField × ['path/one.txt', 'path/two.txt'].each do |path|  b.file_field(:id, 'some_id').when_present.set(path)end

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

2016-05-13 Thread 'John Fitisoff' via Watir General
Hi Jesse, What have you tried, what does the HTML look like and what kind of errors are you getting? It could be many things and that info might narrow down the possibilities a bit. John From: "jherzen...@shastaqa.com" To: Watir General

Re: [wtr-general] Watir-webdriver throws 'not clickable' error even when element is visible, present

2016-04-19 Thread 'John Fitisoff' via Watir General
Yeah, that's annoying. Think I filed a Webdriver bug a one point (I wasn't the only one) but not sure if they ever did anything with it.  If you don't have to use Chrome, It might be worth trying Firefox. Driver install is not required for that and it's a little less fussy, although think I

Re: [wtr-general] Time out issue in Watir

2016-01-19 Thread 'John Fitisoff' via Watir General
Haven't used watir classic in a long time but think .hover should work. You can always bump up the when_present time, it takes an integer argument. the default if you don't specify a time is 30 seconds, which is a really long time, so itmight not be as simple as that. One thing that really

Re: [wtr-general] How can I get all the content in a div element then strip out a table element leaving only what elements I want?

2015-12-07 Thread 'John Fitisoff' via Watir General
Not sure if this fits your problem, but one approach would be to look at the output of b.div(:id, 'contents').text. It may be possible to use regexp matching to get the text leading up to the div and then the text after, without having to worry specifically about what element outside the table

Re: [wtr-general] Code suggestions on how to get a guid from an href to be used to append to other hrefs.

2015-06-17 Thread 'John Fitisoff' via Watir General
Use a regular expression. Assuming that the URL is  http://www.mysite.com/client/abcde012345: browser.url.match(%r{/client/(.*)})[1] = abcde012345 From: Lorraine Botros lorraine.bot...@gmail.com To: watir-general@googlegroups.com Sent: Tuesday, June 16, 2015 4:24 PM Subject:

Re: [wtr-general] unable to click link

2015-05-26 Thread 'John Fitisoff' via Watir General
Oh, wait! Cancel is a link From: 'John Fitisoff' via Watir General watir-general@googlegroups.com To: watir-general@googlegroups.com watir-general@googlegroups.com Sent: Tuesday, May 26, 2015 7:31 AM Subject: Re: [wtr-general] unable to click link I think cancel needs to be in quotes

Re: [wtr-general] Re: verify if checkbox is checked

2015-01-28 Thread 'John Fitisoff' via Watir General
Maybe something like this would work in determining the checkbox state b.span(:text, 'Dependent to an existing member?').parent.html =~ /custom-checkbox checked/  From: jackstaposit...@gmail.com jackstaposit...@gmail.com To: watir-general@googlegroups.com Sent: Tuesday, January 27, 2015

[wtr-general] Watir Job in SF

2015-01-28 Thread 'John Fitisoff' via Watir General
Hi all, My company (Recurly) is looking for a QA engineer with Ruby experience to join and help with manual testing and support an existing automation effort. We're using Watir and RSpec. The position will involve a lot of scripting and we'll be looking for someone with good Ruby programming

Re: [wtr-general] Undefined method 'goto' for RSpec::Core::ExampleGroup using Watir-Rspec

2015-01-12 Thread 'John Fitisoff' via Watir General
It's just saying that RSpec doesn't have a goto method. Try calling that on @browser From: trekr5 cebi...@gmail.com To: watir-general@googlegroups.com Sent: Monday, January 12, 2015 4:52 AM Subject: [wtr-general] Undefined method 'goto' for RSpec::Core::ExampleGroup using Watir-Rspec

Re: [wtr-general] Re: Watir - Identifying a Span ID and its Text Element - False

2015-01-02 Thread 'John Fitisoff' via Watir General
Another way of checking for text (when you don't care about which particular element is displaying it) is: @browser.text =~ /Welcome/ From: Super Kevy kpe...@scholarshipamerica.org To: watir-general@googlegroups.com Sent: Friday, January 2, 2015 6:38 AM Subject: [wtr-general] Re:

Re: [wtr-general] Problem with Logger and condition if/else Watir | Testwise

2014-12-18 Thread 'John Fitisoff' via Watir General
Think you need this if @browser.text.include?(Signed in!) == true   # Something...elseend Think there's more than one spreadsheet library but you should be able to query the spreadsheet object for the number of of rows that it has (take a look at the rdocs for it.) Then you could do something

Re: [wtr-general] Re: Get the link to the Next Page

2014-10-23 Thread 'John Fitisoff' via Watir General
Something like this should work, although it'd be better to restrict the # of links to be checked rather than iterating through all of them link = b.links.find {|link| link.href =~ /Page\$\d+/}link.href.match(  /Page\$\(d+)/)[1] # assumes link is actually found From: Joe Fleck

Re: [wtr-general] How to handle unknown browser popup with text Stop running this script?

2014-05-24 Thread 'John Fitisoff' via Watir General
+1 for treating it as an application bug rather then a problem with Watir. It's likely the reason that browser.alert.exist? isn't working is that the browser isn't responsive. The developers should look at fixing whatever's causing that popup to show up. You might have some luck using a