Search Results

Search found 53 results on 3 pages for 'watir'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • How do I route watir through a proxy pragmatically?

    - by feydr
    I'm trying to route watir through a proxy pragmatically -- this means within the script I'd like to change my proxy dynamically before launching the browser. Here's what I've tried so far (and so far am failing): I'm running chrome and lucid lynx ubuntu. I chose TREX cause I thought watir might be making use of PROXY or something. I rewrote /usr/bin/google-chrome as: #!/bin/bash /opt/google/chrome/chrome --proxy-server="$TREX" $@ The reason I'm passing in the environment variable to proxy-server rather than http_proxy is because I never could get http_proxy to work as is anyways then I did a simple: require 'rubygems' require 'watir-webdriver' ENV['TREX'] = "XX.XX.XX.XX:YY" browser = Watir::Browser.new(:chrome) browser.goto("http://mysite.com") Anyways, what is happening here is that it is forwarding me to the login page of the proxy rather than just forwarding the request. What am I missing here? I feel like I'm pretty close.

    Read the article

  • Watir question regarding table rows and loop

    - by AJ
    Hi, I would like to go through a table and look for a word, if that word appears, i would like to click on a radio button in the same row, but not the same column, then stop the loop. I have something like this at the moment but i dont know where to go on from here. @ie.div(:class, 'tableclass').table(:index, 1).each do | row | row.each do | cell | if (cell.text() == 'text') ##Set radio button break end end end I tried selecting a radio by name and index, but i do not know how to get the row number that it is currently at. Thanks.

    Read the article

  • Watir question regarding select_list and reloading

    - by AJ
    I have a drop down with multiple options. Whenever you choose an option, the page reloads with data specific with that option. Currently I'm using select.list(:name, strg).set(value) and it does that part just fine, but it does not reload the page with the specific data. Anyone know how to help. When i watch it in action, it doesn't select the option either, but my logs show that it does.Thanks.

    Read the article

  • How do I get the id or name of an element in watir?

    - by karlthorwald
    Watir can find a text on a page: <span id="i1" name="n1>Some Text</span> e.text.include?("Some Text") But how can I get the name or id of the span, when I only know "Some Text" e.text.findInPage("Some Text").parentElement.id (should be "i1") e.text.findInPage("Some Text").parentElement.name (should be "n1"); Something like this exists in watir?

    Read the article

  • Does watir's browser.text.include? count text inside invisible divs? If so, how to search only for v

    - by karlthorwald
    Does watir's browser.text.include? count text inside invisible divs? If so, how to search only for visible text? I put all the instructions into the html from the beginning and use jQuery to hide and unhide the relevant parts. How can I use watir's waiter to wait for only text that is visible? My problem is, that the waiter always returns true, even before I have shown a certain text.

    Read the article

  • Watir question regarding exist on a class for testing purposes.

    - by AJ
    I have a button on my page that changes depending on what radio button is clicked. The button has the same text on it with the same id, but different classes. How do I test if the two different buttons exist depending on the radio. <a id="submit" class="on" href="javascript:submit();">Submit</a> <a id="submit" class="off" href="javascript:submit();">Submit</a> How do i test if the second button appears instead of the first one. I used something like, browser.link(:text, 'Submit').exist? but this doesn't work cause it will return true no matter what. thanks

    Read the article

  • getting firewatir to run on mac osx: jssh problems

    - by z3cko
    I am trying to get firewatir to run on Mac OSX Leopard. I have Firefox 3.6rc2 installed but running the most simple script does not work: require 'rubygems' require 'firewatir' ff=FireWatir::Firefox.new ff.goto("http://mail.yahoo.com") i am getting the following error /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/firefox.rb:237:in `set_defaults': Unable to connect to machine : 127.0.0.1 on port 9997. Make sure that JSSh is properly installed and Firefox is running with '-jssh' option (Watir::Exception::UnableToStartJSShException) from /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/firefox.rb:131:in `initialize' from ./watir-test.rb:12:in `new' from ./watir-test.rb:12 even when I am trying to start Firefox with the -jssh option, I get an error (although another one) /Applications/Firefox.app/Contents/MacOS/firefox-bin -jssh the error output in that case: /usr/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/firefox.rb:125:in `initialize': Firefox is running without -jssh (RuntimeError) is there any tutorial or hnt to get firewatir actually running on Mac OSX?

    Read the article

  • visual analysis of web pages in ruby

    - by Clint Miller
    I'm looking to write some code that does visual analysis of web pages, preferably using Ruby. My code will need to be able to determine the top, left, width, height, background color, color, and font size for all the elements in the DOM. Of course, these values can only be calculated once all CSS is applied. So, I don't think that Nokogiri is up for the job. Ultimately, I'm trying to use this data in a VIPS-like (Vision-Based Page Segmentation) algorithm in an attempt to find the main content in downloaded news articles. I've considered using Watir to drive Chrome or Firefox and then extract the data. The problem is that browsers can't be run headless through Watir (I think). Ultimately, this code will be running on an array of Linux servers in a data center. So, the code won't have easy access to an X Server for displaying the browser. I suppose one solution is to use Watir and run a headless X Server on the Linux servers. That's a bit of a pain, but it looks like my best option right now. Does anyone have any better ideas?

    Read the article

  • Integration Testing an Entire *Existing* Application (w/ automatic execution of test suite)

    - by Ev
    Hi there, I have just joined a team working on an existing Java web app. I have been tasked with creating an automated integration test suite that should run when developers commit to our continuous integration server (TeamCity), which automatically deploys to our staging server - so really the tests will be run against our staging web app server. I have read a lot of stuff about automated integration testing with frameworks like Watir, Selenium and RWebSpec. I have created tests in all of these and while I prefer Watir, I am open to anything. The thing that hasn't become clear to me is how to create an entire test suite for an application, and how to have that suite execute in it's entirety upon execution of some script. I can happily create individual tests of varying complexity, but there is a gap in my knowledge about how to tie everything together into something useful. Does anyone have any advice on how to create a full test suite and have it execute automatically? Thanks!

    Read the article

  • xvfb on a machine with a display, can an application run 'in the background?'

    - by marfarma
    I'm setting up to cron a web scraping job, using xvfb, firefox, and watir on my Mac OS X. In testing the script so far, firefox pops up visibly on the local desktop, the watir script executes, and then firefox exits (I quit firefox in my script). I'd like to set the xvfb DISPLAY such that firefox will run, but won't be seen on the local desktop, running 'in the background' so to speak. Nothing I've been able to find online discusses such a possibility - nor explains that it's not possible. Is it possible? If so, what do I need to do to make it work?

    Read the article

  • Running rspec against multiple targets

    - by kaerast
    I've written an rspec test using Watir against a web application and it's running fine. However, I now want to be able to run this test against the web application running on different domain names. My initial thought was that I'd be able to pass a value to spec at the command line to set a variable within my script, but I can't see any easy method of doing this. So my second thought was that I might need to add an array of domains into my script and have it test all of them - but I don't always want to test every domain, and the domains are constantly changing as we add and remove sites to be tested. What are my options for allowing the choice of targets I want?

    Read the article

  • Can AutoIt scripts run as a scheduled task while not logged in?

    - by muddywater
    I am using Ruby/WATIR/AutoIt to automate a task via Task Scheduler which runs fine as long as I am logged in, but as soon as my account is locked (mandated 10 minute screen lock) or I logout the script stops functioning. When I log back in, it is sitting at the part where AutoIt is supposed to handle a file download dialogue by clicking save and then entering the filename and clicking to save again. The follwing is the code that works while I am logged in. Is AutoIt supposed to work when I am not logged in, and is there some other way to accomplish this? Thanks!! because search has not turned up anything (terms are too generic) prompt_message = "Do you want to save this file, or find a program online to open it?" window_title = "File Download" save_dialog = WIN32OLE.new("AutoItX3.Control") sleep 1 save_dialog_obtained = save_dialog.WinWaitActive(window_title,prompt_message, 25) save_dialog.ControlFocus(window_title, prompt_message, "&Save") sleep 1 save_dialog.Send("S") save_dialog.ControlClick(window_title, prompt_message, "&Save") save_dialog.WinSetTitle(window_title, prompt_message, "This is ForTesting" ) saveas_dialog_obtained = save_dialog.WinWait("Save As", "Save&in", 5) sleep 1 path = fileName puts " Edit the file path" save_dialog.ControlSend("Save As", "", "Edit1",path) sleep 4 puts " Save the file" save_dialog.ControlClick("Save As", "Save &in", "&Save") save_fileAlreadyExists = save_dialog.Send("Y")

    Read the article

  • How to do Basic Authentication using FireWatir on Ubuntu Linux?

    - by lotharsmash
    Hi, I'm trying to use FireWatir (1.6.5) to access a site using Basic Authentication and I've been unable to find a solution that works on Firefox in Linux. Does FireWatir 1.6.5 support Basic Authentication on Linux? I've been searching the web for 2 days and can't get a straight answer anywhere as to how to do this. The only thread I found that seemed helpful was this one ( http://groups.google.com/group/watir-general/browse_thread/thread/d8ab9a177d282ce4/fc1bf2319fb387d8?lnk=gst&q=basic+authentication#fc1bf2319fb387d8). Aedorn Varanis says " Angrez's fork had the solution so I'm using that now. Thanks Angrez, works perfectly!", but he doesn't mention what he did to get things working. Initially I tried to bypass the authentication dialog box by using: browser.goto('http://admin:[email protected]') However, this generates a "Confirm" dialog which says: "You are about to log in to the site "172.20.1.1" with the username "admin"." [Cancel, OK] This dialog blocks, and the goto call won't return until I click "OK". Then I tried adding: browser.startClicker("ok") browser.goto('http://admin:[email protected]') But this ALSO generates the same "Confirm" dialog. I tested out the startClicker functionality using the unit test /var/ lib/gems/1.8/gems/firewatir-1.6.5/unittests/html/JavascriptClick.html and it worked fine, which makes me think that using the startClicker method is NOT the correct way to take care of the Confirm dialog. Anybody else found a way to get Basic Auth to work, or how to click the OK on the confirm dialog? I'm at my wits end...

    Read the article

  • Naming selenium grid nodes. Spawning a specific node

    - by ???? ????
    I'm trying to implement a kind of default queues in selenium hub. There is a possibility to specify node's name (actually its environment, smth like "firefox on ubuntu" or "chrome on windows"). Selenium grid itself has a default queue, it works according to 'First In, First Out' principle. But I want to prioritize some of my tasks given to selenium server. I have no possibility to introduce custom queue (seems like there is no API for that), that's why I decided to separate queue's logic from selenium server. I'll only call a specific node with specific name (environment) for example "firefox important node" or smth like that. So, I want to know how to directly tell selenium which node to use for my task? And generally, am I thinking in a right way? Here are my configs: hubConfig.json.erb { "host": null, "port": <%= node[:selenium][:server][:port] %>, "newSessionWaitTimeout": -1, "servlets" : [], "prioritizer": null, "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher", "throwOnCapabilityNotPresent": true, "nodePolling": <%= node[:selenium][:server][:node_polling] %>, "cleanUpCycle": <%= node[:selenium][:server][:cleanup_cycle] %>, "timeout": <%= node[:selenium][:server][:timeout] %>, "browserTimeout": 0, "maxSession": <%= node[:selenium][:server][:max_session] %> } nodeConfig.json.erb { "capabilities": [ { "browserName": "firefox", "maxInstances": 5, "seleniumProtocol": "WebDriver" }, { "browserName": "chrome", "maxInstances": 5, "seleniumProtocol": "WebDriver" }, { "browserName": "phantomjs", "maxInstances": 5, "seleniumProtocol": "WebDriver" } ], "configuration": { "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy", "maxSession": <%= node[:selenium][:node][:max_session] %>, "port": <%= node[:selenium][:node][:port] %>, "host": "<%= node[:fqdn] %>", "register": true, "registerCycle": <%= node[:selenium][:node][:register_cycle] %>, "hubPort": <%= node[:selenium][:server][:port] %> } } And my Driver class: ... def remote_driver @browser = Watir::Browser.new(:remote, :url => "http://myhub.com:4444/wd/hub", :http_client => client, :desired_capabilities => capabilities ) end def capabilities Selenium::WebDriver::Remote::Capabilities.send( "firefox", :javascript_enabled => true, :css_selectors_enabled => true, :takes_screenshot => true ) end def client client = Selenium::WebDriver::Remote::Http::Default.new client.timeout = 360 client end ... I still don't know how to use specified node for my task. If I try to start a driver adding :name => "firefox important node" and extend nodeConfig.json.erb's configuration with environments: - name: "firefox important node" browser: "*firefox" - name: "Firefox36 on Linux" browser: "*firefox" selenium just starts random firefox browser on a random node. How can I control it?

    Read the article

  • Regex issue with comma's telling me there are 6 args, instead of intended 4

    - by Azher
    I have a scenario outline table that looks like the following: Scenario Outline: Verify Full ad details Given I am on the xxx classified home page And I have entered <headline> in the search field & clicked on search When I click on full details Then I should see <headline> <year> <mileage> <price> displaying correctly and successfully Examples: |headline |year |mileage |price | |alfa romeo 166 |2005 |73,000 |6,990 | When I run my scenario it spits out that I have 6 args. But what I thought, I should only have 4 args: headline, year, mileage and price. I am thinking that it is taking the comma's and what is before and after it as two seperate args. Is there any way that I can make cucumber think that there are only 4 args with the example below? I have looked at messing around with regex but I dont seem to be getting anywhere. Any help would be greatly appreciated.

    Read the article

  • IE browser doesn't close and file download popup needs focus

    - by jkranthi
    Hii all , I am trying to to click on a link after it is active which again produces a popup ( file download) after clicking. Here i have 2 problems 1) I start the code and leave it .what the code does is -after long process -it waits for the link to be active .Once the link is active it clicks on the link and a download popups opens (if everything goes well) and then it hangs there ( showing yellow flashing in the task bar which mean i have to click on the explorer for it to process whatever is next ).every time i have to click on the IE whenever the download popup appears .Is there a way to handle this or am i doing some wrong ? 2) The next problem is even if i click on the IE .the IE doesn't get close even though i write ie.close . my code is below : ## if the link is active ie.link(:text,a).click_no_wait prompt_message = "Do you want to open or save this file?" window_title = "File Download" save_dialog =WIN32OLE.new("AutoItX3.Control") save_dialog.WinGetText(window_title) save_dialog_obtained =save_dialog.WinWaitActive(window_title) save_dialog.WinKill(window_title) # end #' #some more code -normal puts statements # ie.close ie is hanging up for some strange reason ..?

    Read the article

  • Running a cucumber feature multiple times

    - by evomase
    Hi, I'm trying to run a cucumber feature multiple times (i.e 500 times). Is there a way of doing this than me having to type in the same command everytime? I'm guessing this can be done using Rake? I'm not an expert in using rake or cucumber. Will appreciate your help. Thanks

    Read the article

  • My Codemash 2011 Retrospective

    - by Greg Malcolm
    I just got back from Codemash yesterday, and still on an adrenaline buzz. Here's my take on this years encounter: The Awesome Nearly everybody in one place Codemash is the ultimate place to catch up with community friends. This is my 3rd year visiting and I've got to know a great number of very cool people through various conferences, Give Camps and other community events. I'm finding more and more that Codemash is the best place to catch up with everybody regardless of technology interest or location. Of course I always make a whole bunch more friends while I'm there! Yay! Open Spaced I found the open spaces didn't work so well last year. This year things went a lot smoother and the topics were engaging and fresh. While I miss Alan Steven's approach of running it like an agile project, it was very cool to see that it evolving. Laptops were often cracked open, not just once but frequently! For example: Jasmine - Paired on a javascript kata using the Jasmine javascript test runner J - Sat in on a J demo from local J enthusiast, Tracy Harms Watir - More pairing, this time using Ruby with the watir-webdriver through cucumber. I'd mostly forgotten that Cucumber runs just fine without Rails. It made a change to do without. The other spaces were engaging too, but I think that's enough for that topic. Javascript Shenanigans I've already mentioned that I attended a Jasmine kata session. Jasmine is close to my heart right now every since I discovered it while on the hunt for a decent Javascript testing framework for a javascript koans project earlier this year. Well, it also got covered in the Java Precompiler and Pillar's vendor session, which was great to see. Node.js was also a reoccurring theme. Node.js in a nutshell? It's an extremely scalable Event based I/O server which runs on Javascript. I'd already encountered through a Startup Weekend project and have been noticing increasing interest of late. After encountering more node.js driven excitement from my peers at codemash I absolutely had to attend the open space on it. At least 20 people turned up and by the end we had some answers, a whole ton of new questions and an impromptu user group in the form of a twitter channel (#nodemash). I have no idea where this is going to go or how big it is going to become, but if it can cross the chasm into the enterprise it could become huge... Scala Koans I'm a bit of a Koans addict, and I really need more exposure to functional languages so I gave the Scala Koans precompiler a try. Great fun! I'm really glad I attended because I found I had a whole ton of questions. Currently the koans are available here, and the answers are here. Opportunities While we're on the subject can we change the subject now? Hai Gregory, You really need to keep the drinking for later in the day. I mean seriously, you're 34 and you still do this every single time! Sure, you made it to Chad Fowler keynote ok, but you looking a rather pale weren't you? Also might have been nice to attend 'Netflicks in the Cloud' instead of 'Sleeping It Off For People Who Should Know Better'. Kthxbye PS: Stop talking to yourself Not that I entirely regret it, I've had some of my greatest insights through late night drunken conversations at the CodeMash bar. Just might be nice to reign it in a little and get something out of the next morning too. Diversity This is something that is in the back of my mind because of conversations at Codemash as well as throughout the year; I'm realizing more and more how discouraging the IT profession is for women. I notice in the community there has been a lot of attention paid to stamping out harrasment, which is good, but there also seems to be a massive PR issue. I really don't have any solutions, but I figure it can't hurt to pay more attention to whats going on... And in Other News I now have a picture of Chad Fowler giving me more cowbell! Sadly I managed to lose the cowbell later on. Hopefully it's gone to a Better Place. The Womack Family Band joined in with the musicians jam this year. There's my cowbell again! Why must you hide from me? I also finally went in the water for the first time in all the I've been coming to codemash. Why did I wait so long?!?

    Read the article

  • Setting up a Proxy to record Firefox requests

    - by Marco
    I'm using Ruby+Watir to request pages through Firefox. I would like to record the headers and content of every http request made through the browser. Would it be possible to configure a proxy solution to store this information, either in a file or pipe it straight into an application? Could I use something such as squid or nginx to record header/content information? PS: Running Ubuntu x64.

    Read the article

  • Logging all Firefox HTTP Request Headers?

    - by Hayek
    I'm using Ruby+Watir to request pages through Firefox. I would like to record the headers and content of every http request made through the browser. Would it be possible to configure a proxy solution to store this information, either in a file or pipe it into an application? I'm running Ubuntu x64. // Edit: I would like to store the data in logs because I would like to view it later. Preferably, I am looking for a solution that runs quietly in the background and stores the headers/content in files.

    Read the article

  • How do I find the Recaptcha ID?

    - by Joe
    I've been stuck on something for the past day. I'm building a RoR bot, and part of it involves signing up for an email account with mail.com. I've automated all the filling out of the form, apart from the captcha (Recaptcha). I'll be using the deathbycaptcha Ruby gem. However, in order to have the captcha solved, I'll need to get either its ID or its URL. While this shows up when I "enable form details" with the Firefox Web Developer toolbar, it doesn't seem to be in the source. How can I find it out? I'm using Watir. Thanks! Joe

    Read the article

  • RSpec: in-depth differences between before(:all) and before(:each)

    - by gmile
    Ok, so I've ran into a very strange issue, directly connected with before blocks. I'm doing a integration testing via Watir and RSpec. For a simple test to check if user can perform a login I'm creating a 'user' record in the db by means of factory_girl. So I put the following code: before(:each) do @user = Factory(:user) end if "should perform a login" do # do stuff end In do stuff I call a browser and see how the user tries to login. Unfortunately, somehow he cannot do that — "Username isn't valid". After some investigation I discovered that if I put the code for creating user in before(:all) block, everything magically works. How's that? What's the difference between :all and :each in this context? Also, If I put the code for creating user actually in the test body, it still doesn't work (i.e. user somehow isn't added to the DB or something).

    Read the article

  • Where are the factory_girl records?

    - by gmile
    I'm trying to perform an integration test via Watir and RSpec. So, I created a test file within /integration and wrote a test, which adds a test user into a base via factory_girl. The problem is — I can't actually perform a login with my test user. The test I wrote looks as following: ... before(:each) @user = Factory(:user) @browser = FireWatir::Firefox.new end it "should login" @browser.text_field(:id, "username").set(@user.username) @browser.text_field(:id, "password").set(@user.password) @browser.button(:id, "get_in").click end ... As I'm starting the test and see a "performance" in browser, it always fires up a Username is not valid error. I've started an investigation, and did a small trick. First of all I've started to have doubts if the factory actually creates the user in DB. So after the immediate call to factory I've put some puts User.find stuff only to discover that the user is actually in DB. Ok, but as user still couldn't have logged in I've decided to see if he's present in DB with my own eyes. I've added a sleep right after a factory call, and went to see what's in the DB at the moment. I was crushed to see that the user is actually missing there! How come? Still, when I'm trying to output a user within the code, he is actually being fetched from somewhere. So where does the records, made by factory_girl within a runtime lie? Is it test or dev DB? I don't get it. I've 10 times checked if I'm running my Mongrel in test mode (does it matter? I think it does, as I'm trying to tun an integration test) and if my database.yml holds the correct connection specific data. I'm using an authlogic, if that can give any clue (no, putting activate_authlogic doesn't work here).

    Read the article

< Previous Page | 1 2 3  | Next Page >