Re: [wtr-general] Trying to test for table data

2010-09-14 Thread Basim Baassiri
your e On Tue, Sep 14, 2010 at 4:03 PM, Basim Baassiri wrote: > you will need to provide the html as well > > > On Tue, Sep 14, 2010 at 3:58 PM, Watir General wrote: > >> I'm attempting to check a table for a string of data, however I keep >> getting this: >> >> 9if browser.table(:id, "data

Re: [wtr-general] Trying to test for table data

2010-09-14 Thread Basim Baassiri
you will need to provide the html as well On Tue, Sep 14, 2010 at 3:58 PM, Watir General wrote: > I'm attempting to check a table for a string of data, however I keep > getting this: > > 9if browser.table(:id, "dataTableBody").include?("146173") > 10 puts "Data Verify passed" > 11el

[wtr-general] Trying to test for table data

2010-09-14 Thread Watir General
I'm attempting to check a table for a string of data, however I keep getting this: 9if browser.table(:id, "dataTableBody").include?("146173") 10 puts "Data Verify passed" 11else 12 puts "Data Verify FAILED. Ouch." 13end _ NoMet

[wtr-general] WIN32OLERuntimeError: execScript while executing a javaScript function from Watir Script

2010-09-14 Thread kunal shah
Hi, I am trying to define a JavaScript function and execute it from the Watir Script. This function will return the cookies of the current IE window. Defining the function: js_stuff = <<-end_js_stuff var myCookie = document.cookie; return cookies; end_js_stuff Call: myCookies = ie2.execut

Re: [wtr-general] Javascript popup on goto()

2010-09-14 Thread Keith Hughes
Hi Alexis, how about doing the whole lot in the execute_script part: browser = Watir::Browser.new(:firefox) browser.execute_script(' window.location="http://www.url.com";; window.confirm = function(msg) { return true; ') the window.location part replaces the goto in this case I'm not sure if th

[wtr-general] Javascript popup on goto()

2010-09-14 Thread balexis
Hello, I'm running Firewatir 1.6.5 on Ubuntu 10.04. I am experiencing the following problem and can't manage to find a solution at all. I instantiate a browser and use goto() to visit a given site. Upon landing on the site, I am 'greeted' with a Javascript popup, which I would like to dismiss by

[wtr-general] Re: Setting text in br tags

2010-09-14 Thread Usman Hussain
Hey Keith, I just got it working by doing the following: require 'rubygems' require 'win32ole' require 'watir-webdriver' autoit = WIN32OLE.new('AutoITX3.Control') autoit.WinActivate('Magnolia Edit Dialog') autoit.Send('{TAB}') autoit.Send('{TAB}') autoit.Send('hello world usman is

Re: [wtr-general] Setting text in br tags

2010-09-14 Thread Keith Hughes
Hi Usman, try browser.element_by_xpath("//b...@_moz_editor_bogus_node='TRUE']/").set("blah") Keith On Tue, Sep 14, 2010 at 3:00 PM, Usman Hussain wrote: > Hi Guys, (Me Again...!) > > Ive come across a problem (again...) > For the paragraph field for the CMS system im automating it has br > tag

[wtr-general] Setting text in br tags

2010-09-14 Thread Usman Hussain
Hi Guys, (Me Again...!) Ive come across a problem (again...) For the paragraph field for the CMS system im automating it has br tags instead of being a text_field. the html looks like this: - +

[wtr-general] Re: Close All browser function

2010-09-14 Thread Usman Hussain
ahhh oops my bad. think i read the comment wrong. will look at the link now. cheers for that usman On Sep 14, 11:18 am, Željko Filipin wrote: > On Tue, Sep 14, 2010 at 12:12 PM, Usman Hussain > wrote: > > > if i put @browser#quit it again wont work. > > Jari said you should take a look at Browse

Re: [wtr-general] Close All browser function

2010-09-14 Thread Keith Hughes
Hi Usman, If you really want to shut down all browers you could try this: require 'sys-proctable' Sys::ProcTable.ps.each{|ps| if ps.name.downcase=="firefox.exe" Process.kill('KILL',ps.pid) end } Keith On Tue, Sep 14, 2010 at 10:28 AM, Usman Hussain wrote: > Hi Guys, > > Im using Watir-

Re: [wtr-general] Re: Close All browser function

2010-09-14 Thread Željko Filipin
On Tue, Sep 14, 2010 at 12:12 PM, Usman Hussain wrote: > if i put @browser#quit it again wont work. Jari said you should take a look at Browser#quit. It is a way to reference method of a class (in Ruby). It is not executable code. That means "quit" method in "Browser" class. Take a look: http://

[wtr-general] Re: Close All browser function

2010-09-14 Thread Usman Hussain
Hey, I just tried @browser.quit and that didnt work... if i put @browser#quit it again wont work. Reason being as im Writing in Ruby a # comments out anything after it. so the quit is not called as its been comented out if i put @browser#quit (hence why i wrote @browser.quit) Ill continue to goo

Re: [wtr-general] Close All browser function

2010-09-14 Thread Keith Hughes
Hi Usman looking through the code in browser.rb all I can see is 'close', no 'close_all' or 'quit' Regards Keith On Tue, Sep 14, 2010 at 10:28 AM, Usman Hussain wrote: > Hi Guys, > > Im using Watir-WebDriver and firefox > In my tests at the end I want to close all instances of the browsers > (wh

Re: [wtr-general] using verify method

2010-09-14 Thread goutham mandadi
Thanks a lot mahesh,Usman and Keith for ur replies i will try this On Tue, Sep 14, 2010 at 3:11 PM, Keith Hughes wrote: > Kartheek > This should work, > > require 'watir/testcase' > require 'watir-webdriver' > class Test_google_ff def setup > @Browser = Watir::Browser.new(:firefox) >

Re: [wtr-general] using verify method

2010-09-14 Thread Keith Hughes
Kartheek This should work, require 'watir/testcase' require 'watir-webdriver' class Test_google_ff http://www.google.com"; end def test_google1 verify(@Browser.button(:name,"blah").exist?,"Dude where's my button") end def teardown @Browser.close end end rgds Keith On Tue, Sep 14, 2010 at 7:18 AM

Re: [wtr-general] Close All browser function

2010-09-14 Thread Jari Bakken
On Tue, Sep 14, 2010 at 11:33 AM, Željko Filipin wrote: > On Tue, Sep 14, 2010 at 11:28 AM, Usman Hussain > wrote: >>  undefined method `close_all' for # > > My guess is that close_all method in not implemented in watir-webdriver. > That's right. You want Browser#quit. -- Before posting, pleas

Re: [wtr-general] Close All browser function

2010-09-14 Thread Željko Filipin
On Tue, Sep 14, 2010 at 11:28 AM, Usman Hussain wrote: > undefined method `close_all' for # My guess is that close_all method in not implemented in watir-webdriver. Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of th

[wtr-general] Close All browser function

2010-09-14 Thread Usman Hussain
Hi Guys, Im using Watir-WebDriver and firefox In my tests at the end I want to close all instances of the browsers (which is 3 browser windows in total) In my env.rb file i have: After do @browser.close_all end BUT it does not close all browser windows. I get the following error message:

[wtr-general] Re: using verify method

2010-09-14 Thread Usman Hussain
Hi, Try this: for True: @browser.link(:href, 'http://www.google.co.uk').should exist for False: @browser.link(:href, 'http://www.google.co.uk').should_not exist you will need to require 'spec' though (spec is RSpec so if this is not installed you need to do a gem install rspec) Hope this helps.