[wtr-general] Re: Using Watir to Click a Button that has OnClick attribute

2012-09-07 Thread orde
You should be able to use the fire_event method instead of the click 
method.  A generic example:

browser.button(:id => "foo").fire_event("onclick")

HIH.

orde

On Friday, September 7, 2012 11:05:55 AM UTC-7, Brickman wrote:
>
> Hello All,
>
> I have an issue configuring a script that will simply click on a button. 
>
> Here is the HTML code  onClick="parent.location='DefaultOrig.asp'" />
>
> I have been around the internet and looked at many forums to try different 
> scripts, but nothing seems to work.
>
> To me it seems to be with the onClick attribute, and I not super well 
> rounded in HTML however that appears to be a java script element.  Any help 
> is appreciated and if you need more code or information please let me know.
>
>
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: watir help

2012-02-01 Thread orde
A couple of piggyback comments on the above.

a) first question about accessing elements in a frame:

browser.frame(:id, "foo").link(:href => /
productpref=catalog/).click# the example frame has no attributes,
so I guess you could use index...

b) lots of javascript in the second example, so you might need to
trigger the event:

browser.link(:id,
"foo").fire_event("onmouseover")#
mouseover is an example event handler

HIH.

orde



On Feb 1, 3:52 pm, Dave McNulla  wrote:
> For the first question, I would try these:
> browser.link(:href => /productpref=catalog/).click
> browser.link(:text => 'catalog').click
>
> For the second question, I would try these:
> browser.link(:text => 'Active').click
> browser.link(:href => /List Catalogs/).click
>
> Of course I wouldn't give up if those did not work, but I would try to
> following identification methods (probably in that order) OR a combination
> of them:
> :href
> :name
> :id
> :text
> :index
> :class
> :html
> :after
> :xpathhttp://wiki.openqa.org/display/WTR/HTML+Elements+Supported+by+Watir
>
> Dave

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Export entire html table to a text document

2011-12-02 Thread orde
Although it won't capture the HTML tags, you can dump the contents of
a table like this:

table_contents = browser.table(:id, 'foo').to_a

For writing to .txt file, check out the ruby File class:
http://www.ruby-doc.org/core-1.9.3/File.html

This is an example for writing the HTML for a page to a file:

browser.goto(test_site)
html = browser.html

f = File.new("txt.txt", "w+")
f.write(html)
f.close

Hope it helps.

orde

On Dec 2, 1:42 am, Mark Ballinger  wrote:
> Thank you for your reply.
> After re-reading what I have written and thinking about what I what to
> achieve... I don't believe I want to extract the table data into
> excel. I would like to extract it to a .txt (notepad document).
> The purpose of extracting the data is to check it against it against
> what I have in my database :-). If I can get it into .txt file
> (notepad document) I have the know-how to clean it and import it into
> sql for validation.
> FYI the data in the table looks like this...
>  Address  Council
> tax band  Annual council tax 
>  2, STONELEIGH AVENUE, COVENTRY, CV5 6BZ  align="center"> F  £2125 
> ... The above row is repeated many time ..
> 
> Then the table is closed.
> So to re-cap my situation. I can use Watir to navigate the browser to
> the page containing the html table but my problem is that I am unsure
> of how to extract the results (everything within the  tag -
> including the html) to a .txt file and then save that .txt file onto
> my computer.
> I would prefer to take smaller steps with using Watir. I am knew to it
> therefore I would just like to learn how to extract the table and save
> everything that I have extracted into a .txt file. I have seen a
> couple of examples online using hpricot. However most of the examples
> seem to miss off code detailing how the array (if that is the correct
> approach) is outputted into a .txt file.
> Could you help by demonstrating how to write a simple piece of code
> which will extract the html table ( and everything, including the
> ,  and everything in between) to a .txt notepad file?
> Many thanks for your time.
> On Dec 2, 2:36 am, bis  wrote:
>
>
>
>
>
>
>
> > To me that sounds like a lot of extra work what happens once it is in an 
> > excel? Why would putting it in an excel be better than asserting it all 
> > within the test itself
>
> > So I'll go ahead and ask some questions first.
> > Will it happen more than once validating the excel?
> > What sort of data is in the table?
> > Would you be comparing the data in the excel vs data in a data base? If 
> > yes, why not let the test do it?
>
> > Sent from my iPhone
>
> > On Dec 1, 2011, at 4:43 PM, Mark Ballinger  
> > wrote:
>
> > > Hi I am a newbie to groups and to ruby, watir, watir-webdriver etc...
>
> > > Basically all I would like to do is export a table from a web page
> > > which I have instructed the browser to find using Watir-webdriver. I
> > > just want to take the whole contents of the html table and place it
> > > into Excel for further analysis.
>
> > > I have the got the following code to work:
>
> > > require 'rubygems'
> > > require 'hpricot'
> > > require "watir-webdriver"
> > > url = "http://www.mycounciltax.org.uk/results?
> > > postcode=cv35+8au&search=Search"
> > > browser = Watir::Browser.new
> > > browser.goto url
>
> > > All i would like to do now is save the table. How do save the html to
> > > a csv or .txt file into my C;\Temp folder?
>
> > > Best Regards,
>
> > > Mark
>
> > > --
> > > Before posting, please readhttp://watir.com/support. In short: search 
> > > before you ask, be nice.
>
> > > watir-general@googlegroups.com
> > >http://groups.google.com/group/watir-general
> > > watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: New member of the Watir team

2011-10-26 Thread orde
+1

On Oct 26, 1:50 am, Dan Claudiu Pop  wrote:
> Hail to Chuck !

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: retrieve drop list items/values

2011-10-20 Thread orde
Something like this?

options = browser.select_list(:id, "foo").options
com_list = String.new
options.each do |option_text|
  com_list << "#{option_text}, "
end

Hope it helps.

orde

On Oct 20, 10:28 am, Joe Fl  wrote:
> How can take those values from the list and put them in a string so I
> can use the split method?
>
> the values from the list box are
> ACG GI Circle
> Advisory Board CDK Sandbox
> Advisory Board Sandbox
> AFCC
> Akron Children's Hospital
> Bayer Pulmonary Hypertension Community
> Better Health Greater Cleveland
> Board of Governors
> Case Western Reserve University - School of Medicine Alumni
> CHB Demo
> Children's Hospital Boston
> Children's Hospital Boston Alumni Association Satellite Community
> Children's Hospital Boston PPOC Online Community
> Covance Virtual Advisory Board
> Future Forum
> Future Forum Editorial Board
> GI Consultant Forum
> Janssen Advisory Board Forum
> Medical Affairs Leaders Forum
> NAPH Member Community
>
> I want to place them in a string called com_list with a comma between
> each value.
>
> I currently retrieve them by above code but it would a lot easier to
> work with them in a string.
>
> Thank you,
> Joe
>
> On Oct 19, 3:17 pm, Chuck van der Linden  wrote:
>
>
>
>
>
>
>
> > On Oct 19, 11:14 am, Joe Fl  wrote:
>
> > > Hi,
>
> > > I have figure it out.
>
> > > Code...
> > > names = $browser.select_list(:name,'communities').options
>
> > > community_names_arr = Array.new
>
> > > commuName = ""
>
> > > name_number = 0
>
> > > names.each do |name|
>
> > >   puts commuName = "#{name_number}: #{name.text}"
>
> > >   name_number = name_number + 1
>
> > > end
>
> > > this gives me the text to each option in the listbox.
>
> > You might want to make use of .each_with_index to make your code a
> > little easier and cleaner
>
> > names = $browser.select_list(:name,'communities').options
>
> > community_names_arr = Array.new
>
> > commuName = ""
>
> > names.each_with_index do |name, i|
>
> >   puts commuName = "#{i}: #{name.text}"
>
> > end

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: How to click on a div tag

2011-10-13 Thread orde
I've seen this topic come up a few times in this forum (i.e.
automating yahoo email or gmail), and I'd advise finding another
option if possible.  They have tons of dynamic content and change
frequently, so it's a serious challenge to maintain.

Sorry it's not the answer that you're looking for, but that's my 2
cents.

HTH

orde

On Oct 13, 3:53 pm, iamqa  wrote:
> I am trying to automate some testing on yahoo email. I need to click
> on the subject or from, so that the email content opens up. I am able
> to select the first email by firing onmousedown but unable to go
> forward from there.
> This is my code:
>
> @browser.div(:id,"shellcontent").div(:id,"inboxcontainer").div(:id,"msg-
> list").div(:class,"list-view ").div(:class,"list-view-items
> ").div(:class=>"list-view-item  btn-msglist resize-
> columns", :index=>1).div(:class,"subj").fire_event('onmousedown')
>
> I tried firing onkeyup, onkeydown, onmouseup, onmousedown, onclick but
> nothing is working. I also tried send_keys("{ENTER}") but was getting
> an error as:
>
> C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.8.1/lib/watir/element.rb:
> 378:in `method_missing': undefined method `send_keys' for # 0x2b58d78 located=false how=:class what="subj"> (NoMethodError)
>         from email_Agent_MonthlyNonMemberContent_Yahoo.rb:84
>
> Thanks

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Scroll DIV element in watir-webdriver

2011-09-27 Thread orde
This works in watir 1.9.x:

@browser.div(:id, foo).document.scrollintoview

Hope it helps.

orde

On Sep 27, 8:10 am, the_zonker  wrote:
> Hi guys,
>
> My SUT has a modal popup with dynamically loaded content. When user
> scrolls it down new records appear. DIV element of modal popup, which
> contains all records, has its own scroll bar.
>
> So my task is to scroll down DIV to the bottom, wait until all records
> are loaded and get them all.
> At present moment I cannot scroll down DIV.
>
> I tried to iteratively focus on records to get scrolling in DIV, but
> scrolling didn't happen and thereby no any records are loaded.
>
> Does watir-webdriver has native methods to scroll inside the element
> (not in browser window or frame)?
> I know that there are some solutions which use tricky Javascript but
> I'm trying to avoid it.
>
> I appreciate any help.
>
> Regards, Vadim

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Can't access HTML in modal dialog using Ruby 1.9.2 and Watir 2.0.2

2011-09-16 Thread orde
Ahhh...I didn't realize that Ruby 1.9.2 + Watir 2.x was ready for
testing.  I'll have to upgrade a VM and take a look as well.

Sorry for getting off topic and not providing a solution to your
issue ;)

orde

On Sep 16, 11:03 am, George Wiley  wrote:
> I read in this group that Ruby 1.9.2 and Watir 2.x was ready to test.
> I thought I would run my scripts through and see what I get. For the
> most part with some changes I have been able to run many scripts
> successfully. This happens to be a problem I can't figure out.
>
> On Sep 16, 12:47 pm, orde  wrote:
>
>
>
>
>
>
>
> > Does watir 2.x support ruby 1.9.x?  http://watir.com/installation/
> > still recommends 1.8.6 or 1.8.7 (although the documentation might be
> > slightly out of date).
>
> > orde
>
> > On Sep 16, 7:48 am, George Wiley  wrote:
>
> > > The code below works fine with Win7, IE8, Ruby 1.8.6 and Watir 1.6.2
> > > for accessing an 'Internet Explorer_TridentDlgFrame' modal dialog.
> > > This code gives the error below when I upgrade to Ruby 1.9.2 and Watir
> > > 2.0.2. It does not appear to be a timing issue because I have tried
> > > sleeps and Watir::Wait.until without success.
>
> > > I can find the dialog but I cannot access the HTML code. I can also
> > > find the dialog using RAutomation directly but I have the same
> > > problem. I can't see the HTML to access the controls on the modal
> > > dialog.
>
> > > The modal dialog has a text_field a select_list and 2 buttons all
> > > within a frame.
>
> > > Is there another tool I should be using with these newer versions of
> > > Ruby and Watir to access the HTML in a modal dialog?
>
> > > Thank you for your help.
> > > *
> > > require 'watir'
>
> > > ie = Watir::IE.attach(:title, /my title/i)
>
> > > btnOK = ie.button(:id, 'OK').click_no_wait()       # this opens the
> > > modal dialog
>
> > > iemod = nil
>
> > > 50.times do
> > >   begin
> > >     iemod = ie.modal_dialog             # this does find the dialog
> > >     puts "** dialog found **"
> > >     break
> > >   rescue
> > >     puts "** dialog not found **"
> > >     sleep(1)
> > >   end
> > > end
>
> > > sleep(20)
> > > frame = iemod.frame(:name, 'Frame')
> > > modSelectList = frame.select_list(:name, 'Select_List')
> > > puts modSelectList.exists?
>
> > > C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/lib/
> > > watir/modal_dialog.rb:32:in `locate': undefined method
> > > `connect_unknown' for WIN32OLE:Class (NoMethodError)
> > >         from 
> > > C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> > > lib/watir/modal_dialog.rb:36:in `document'
> > >         from 
> > > C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> > > lib/watir/locator.rb:7:in `document'
> > >         from 
> > > C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> > > lib/watir/locator.rb:147:in `each_element'
> > >         from 
> > > C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> > > lib/watir/locator.rb:159:in `block in each'
> > >         from 
> > > C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> > > lib/watir/locator.rb:158:in `each'
> > >         from 
> > > C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> > > lib/watir/locator.rb:158:in `each'
> > >         from 
> > > C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> > > lib/watir/locator.rb:173:in `locate'
> > >         from 
> > > C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> > > lib/watir/frame.rb:10:in `locate'
> > >         from 
> > > C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> > > lib/watir/element.rb:75:in `assert_exists'
> > >         from 
> > > C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> > > lib/watir/frame.rb:35:in `document'
> > >         from 
> > > C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> > > lib/watir/frame.rb:24:in `__ole_inner_elements'
> > >         from 
> > > C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/

[wtr-general] Re: Can't access HTML in modal dialog using Ruby 1.9.2 and Watir 2.0.2

2011-09-16 Thread orde
Does watir 2.x support ruby 1.9.x?  http://watir.com/installation/
still recommends 1.8.6 or 1.8.7 (although the documentation might be
slightly out of date).

orde

On Sep 16, 7:48 am, George Wiley  wrote:
> The code below works fine with Win7, IE8, Ruby 1.8.6 and Watir 1.6.2
> for accessing an 'Internet Explorer_TridentDlgFrame' modal dialog.
> This code gives the error below when I upgrade to Ruby 1.9.2 and Watir
> 2.0.2. It does not appear to be a timing issue because I have tried
> sleeps and Watir::Wait.until without success.
>
> I can find the dialog but I cannot access the HTML code. I can also
> find the dialog using RAutomation directly but I have the same
> problem. I can't see the HTML to access the controls on the modal
> dialog.
>
> The modal dialog has a text_field a select_list and 2 buttons all
> within a frame.
>
> Is there another tool I should be using with these newer versions of
> Ruby and Watir to access the HTML in a modal dialog?
>
> Thank you for your help.
> *
> require 'watir'
>
> ie = Watir::IE.attach(:title, /my title/i)
>
> btnOK = ie.button(:id, 'OK').click_no_wait()       # this opens the
> modal dialog
>
> iemod = nil
>
> 50.times do
>   begin
>     iemod = ie.modal_dialog             # this does find the dialog
>     puts "** dialog found **"
>     break
>   rescue
>     puts "** dialog not found **"
>     sleep(1)
>   end
> end
>
> sleep(20)
> frame = iemod.frame(:name, 'Frame')
> modSelectList = frame.select_list(:name, 'Select_List')
> puts modSelectList.exists?
>
> C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/lib/
> watir/modal_dialog.rb:32:in `locate': undefined method
> `connect_unknown' for WIN32OLE:Class (NoMethodError)
>         from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> lib/watir/modal_dialog.rb:36:in `document'
>         from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> lib/watir/locator.rb:7:in `document'
>         from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> lib/watir/locator.rb:147:in `each_element'
>         from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> lib/watir/locator.rb:159:in `block in each'
>         from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> lib/watir/locator.rb:158:in `each'
>         from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> lib/watir/locator.rb:158:in `each'
>         from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> lib/watir/locator.rb:173:in `locate'
>         from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> lib/watir/frame.rb:10:in `locate'
>         from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> lib/watir/element.rb:75:in `assert_exists'
>         from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> lib/watir/frame.rb:35:in `document'
>         from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> lib/watir/frame.rb:24:in `__ole_inner_elements'
>         from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> lib/watir/locator.rb:200:in `each_element'
>         from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> lib/watir/locator.rb:220:in `each'
>         from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> lib/watir/locator.rb:213:in `locate'
>         from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> lib/watir/input_elements.rb:6:in `locate'
>         from C:/programs/Ruby-192-p290/lib/ruby/gems/1.9.1/gems/watir-2.0.2/
> lib/watir/element.rb:391:in `exists?'
>         from watir202test.rb:39:in `'
> ** dialog found **

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: meaning of

2011-08-30 Thread orde
> I do not understand what role ! mark does in the code..

!= is the negated form of the == operator.  Take a look at" Table
7.1 : Common comparison operators" on
http://phrogz.net/programmingruby/tut_expressions.html#expressions.

orde

On Aug 30, 12:54 pm, byung  wrote:
> I come across below code..
>
> while(ie.status! = "Done") do
>
> sleep(1)
>
> end
>
> Can anybody tell me what the meaning of ..
> -
> ie.status! = "Done"
> -
> means??
>
> I do not understand what role ! mark does in the code..

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Post form not on the page

2011-08-15 Thread orde
Does this work (from http://rdoc.info/gems/watir/2.0.1/Watir/Form)?

browser.form(:name, "input").submit

Hope it helps.

orde


On Aug 15, 7:48 am, Rahul Sharma  wrote:
> Hi Dimitry,
>
> The reason I wanted to submit a local form is that I can not simulate user
> clicks as part of the tests. The form in the question is:
>
>   
>
> promotions code:
>
> Mind the formatting. This is the source of the form I want to post. For some
> reason I can not click on the Submit button to post it in the test. Is there
> another way?
> On 12 August 2011 21:20, Dmitriy Korobskiy  wrote:
>
>
>
>
>
>
>
>
>
> > On 8/6/11 1:33 PM, Rahul Sharma wrote:
>
> >> Thanks for the information there Dimitry and Chuck. I forgot to add one
> >> thing in my post. The form I am talking about is a form that has been
> >> created by a developer to assist automated testing. In real world, users of
> >> our website will see a promotion somewhere(let's say google). When one
> >> clicks on that advertisement it will bring the user to our website with the
> >> promotion code filled in and letting the users fill the rest of the form to
> >> be able to register and claim the promotion. So the form here is a HTML 
> >> page
> >> written by a developer so that when I click on the button in the form it
> >> will do the same thing as in the real world when a customer clicks on a
> >> promotion on Google. I actually don;t have the HTML of the form handy but I
> >> can paste it on Monday when I get back to work. So basically my question 
> >> was
> >> to whether I can define that    in my Page and use it with the
> >> page object to post it and give me the website page filled with the
> >> promotion code just like the user would do actually.
>
> >>  Rahul,
>
> > Getting back to your original question of submitting a local form, why do
> > you need to that? Do you really need to manipulate the form in a non-trivial
> > way?
> > If you don't, Watir can drive the browser to reproduce user clicks and
> > filling the text on the form quite well without extra complications.
>
> > --
> > DK
> > AIM: DKroot1, Skype: DKroot
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > watir-general@googlegroups.com
> >http://groups.google.com/**group/watir-general<http://groups.google.com/group/watir-general>
> > watir-general+unsubscribe@**googlegroups.com > oglegroups.com>
>
> --
> Regards,
>
> Rahul Sharma
> Ph:+44 7800 736851

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: how to select a month/day into that calendar http://calendarview.org/

2011-07-19 Thread orde
Although I'm not using watir-webdriver, this works for me on
http://calendarview.org (using ruby 1.8.6 + watir 1.9.0 + IE8):

browser.div(:id, 'popupDateField').document.scrollintoview
browser.div(:id, 'popupDateField').click
puts browser.div(:class, "calendar popup").cell(:text,
"Today").exists? if true  # returns true

I don't know why you're getting the undefined method error since the
webdriver API contains a cell method.

orde



On Jul 19, 11:28 am, Cristina Dumitrescu
 wrote:
> c:/ruby187/lib/ruby/gems/gems/1.8/gems/watir-webdriver-0.2.4/lib/watir-webd 
> river/elements/elements.rb
> 292: in "method_missing": undefined method 'cell' for #
>
>  Do I have any library missing?
>
> I was trying
>
> $browser.div(:id, "mac").div(:class, "calendar popup",  :index 
> =>1}).cell(:text,"Today").click
>
> But I am reciving an error also. Because there are so many divs I think that
> I have to specify one div by index?!
>
>
>
>
>
>
>
>
>
> On Tue, Jul 19, 2011 at 2:11 PM, orde  wrote:
> > The Today and arrow links are in cells.  Have you tried to click the
> > cell?  For example:
>
> > $browser.div(:id, "mac").div(:class, "calendar popup").cell(:text,
> > "Today").click
>
> > Hope it helps...
>
> > orde
>
> > On Jul 19, 10:42 am, Cristina Dumitrescu
> >  wrote:
> > > I've attached the screen snapshot.
>
> > > On Tue, Jul 19, 2011 at 1:39 PM, Cristina Dumitrescu <
>
> > > cristina.watir.toro...@gmail.com> wrote:
> > > > Hi,
>
> > > > we are using that calendar component fromhttp://calendarview.org.
>
> > > > When I click on a text field the popup calendar shows and I have to
> > pick a
> > > > date.
>
> > > > I do now know how to select one month/day using watir.
>
> > > > I attached a screensnapshot from our ui.
>
> > > > And take a look at
> > > >http://calendarview.org
> > > > Example HTML Output
>
> > > > We are using divs the calendar popup divs belong to the "mac" div
> > > > I've try:
> > > > $browser.div(:id, "mac").div(:class, "calendar popup")
>
> > > > I do not know how to click on "Today" button/ click on the right arrow
> > to
> > > > jump to the next month and to select a day.
>
> > > > Can one help me with that.
>
> > > > Thanks a lot in advance,
> > > > Cristina
>
> > > --
> > > Cristina
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > watir-general@googlegroups.com
> >http://groups.google.com/group/watir-general
> > watir-general+unsubscr...@googlegroups.com<http://groups.google.com/group/watir-general%0Awatir-general+unsubscr...>
>
> --
> Cristina

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: how to select a month/day into that calendar http://calendarview.org/

2011-07-19 Thread orde
The Today and arrow links are in cells.  Have you tried to click the
cell?  For example:

$browser.div(:id, "mac").div(:class, "calendar popup").cell(:text,
"Today").click

Hope it helps...

orde

On Jul 19, 10:42 am, Cristina Dumitrescu
 wrote:
> I've attached the screen snapshot.
>
> On Tue, Jul 19, 2011 at 1:39 PM, Cristina Dumitrescu <
>
>
>
>
>
>
>
>
>
> cristina.watir.toro...@gmail.com> wrote:
> > Hi,
>
> > we are using that calendar component fromhttp://calendarview.org.
>
> > When I click on a text field the popup calendar shows and I have to pick a
> > date.
>
> > I do now know how to select one month/day using watir.
>
> > I attached a screensnapshot from our ui.
>
> > And take a look at
> >http://calendarview.org
> > Example HTML Output
>
> > We are using divs the calendar popup divs belong to the "mac" div
> > I've try:
> > $browser.div(:id, "mac").div(:class, "calendar popup")
>
> > I do not know how to click on "Today" button/ click on the right arrow to
> > jump to the next month and to select a day.
>
> > Can one help me with that.
>
> > Thanks a lot in advance,
> > Cristina
>
> --
> Cristina

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: restricting verification to part of the page that is visible

2011-07-14 Thread orde
Can you do something like this?

topicContentFirstLine = @browser.frame(:index, 2).div(:id,
'topicText').text.first

or

topicContentFirstLine = @browser.frame(:id, 'foo').div(:id,
'topicText').text.first

Hope it helps.

orde

On Jul 14, 9:59 am, Anne  wrote:
> Can anyone tell me if there is a way to restrict what you are
> verifying to just the part of the page that is currently visible?
>
> On the page I am testing there are 2 frames:  outline and content
> (kind of like Adobe Reader).  When you click on any line in the
> outline, that section of the content comes to the top of the second
> frame.
> I need to verify that what is at the top of the second frame is,
> indeed, what the user selected.  But I can't figure out how to
> restrict my verification to just what is currently visible.
>
> So far I've got
>    topicContentFirstLine = @browser.div(:id, 'topicText').text.first
> but this gives me the first line of the entire topic, not the first
> line of what is currently visible.
>
> Anne

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: sending i18n data to remote computer using watir scripts.

2011-07-08 Thread orde
I'm assuming no one answered because this isn't a watir-specific
issue.

I suggest a trying a Net::SSH on google or stackoverflow.

Good luck.

orde

On Jul 8, 2:23 pm, Bhavesh  wrote:
> Di Anyone knows about it?
>
> On Jun 29, 3:56 pm, Bhavesh  wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I have routines to send commands to remote computer.
>
> > def issueCommandInKazBox5(okMachine="", command="", matchLog="",
> > user="admin", passwd="kazeon")
> > puts "    issueCommandInKazMachine=#{okMachine}"
> > puts "    issueCommandInKazcommand=#{command}"
> > puts "    issueCommandInKazstatus=#{matchLog}"
> > puts "    issueCommandInKazuser=#{user}"
> > puts "    issueCommandInKazpasswd=#{passwd}"
>
> >   Net::SSH.start(okMachine, user, :password => "kazeon", :auth_methods
> > => ["password"]) do |session|
>
> >   session.open_channel do |channel|
>
> >     channel.request_pty do |ch, success|
> >       raise "Error requesting pty" unless success
>
> >       ch.send_channel_request("shell") do |ch, success|
> >         raise "Error opening shell" unless success
> >       end
> >     end
>
> >     channel.on_data do |ch, data|
> >       STDOUT.print data
> >     end
>
> >     channel.on_extended_data do |ch, type, data|
> >       STDOUT.print "Error: #{data}\n"
> >     end
>
> >     channel.send_data "#{command}\n".force_encoding('utf-8')
> >   channel.send_data "exit\n"
>
> >     session.loop
> >   end
> > end
>
> > end
>
> > I fire commands like this to get the command fire on remote machine :
>
> > issueCommandInKazBox($node1, "add user bhavesh role admin", "")
>
> > It works properly for english data.
>
> > But when i have utf8 data, it throws error :
>
> > issueCommandInKazBox($node1, "add user âêžýáíúöóá¿ role admin", "")
>
> > Error is :
>
> >   1) Error:
> > test_0001(TC_I18N):
> > OpenSSL::Cipher::CipherError: data not multiple of block length
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/
> > transport/stat
> > e.rb:85:in `final'
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/
> > transport/stat
> > e.rb:85:in `final_cipher'
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/
> > transport/pack
> > et_stream.rb:142:in `enqueue_packet'
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/
> > transport/sess
> > ion.rb:223:in `enqueue_message'
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/
> > connection/ses
> > sion.rb:368:in `send_message'
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/
> > connection/cha
> > nnel.rb:493:in `enqueue_pending_output'
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/
> > connection/cha
> > nnel.rb:312:in `process'
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/
> > connection/ses
> > sion.rb:214:in `block in preprocess'
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/
> > connection/ses
> > sion.rb:214:in `each'
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/
> > connection/ses
> > sion.rb:214:in `preprocess'
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/
> > connection/ses
> > sion.rb:197:in `process'
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/
> > connection/ses
> > sion.rb:161:in `block in loop'
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/
> > connection/ses
> > sion.rb:161:in `loop'
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/
> > connection/ses
> > sion.rb:161:in `loop'
> >     C:/IE_AUTOMATION/kazeon/qa/watir-v1_4-TIP/Lib/KazeonCommon/
> > BasicMethodLibrar
> > y.rb:2523:in `block (2 levels) in issueCommandInKazBox5'
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/
> > connection/cha
> > nnel.rb:513:in `call'
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/lib/net/ssh/
> > connection/cha
> > nnel.rb:513:in `do_open_confirmation'
> >     C:/Ruby192/lib/ruby/gems/1.9.1/gems/net-ssh-2.1.4/li

[wtr-general] Re: Report generation with the Watir

2011-06-28 Thread orde
This thread should have useful information:
http://stackoverflow.com/questions/5073552/rspec-ruby-basic-example-error

Hope it helps.

orde

On Jun 28, 7:39 am, Parag Dave  wrote:
> Thanks Zeljko,
>
> This will really helpful.
>
> But i have some problem i am not able to understand how to run this
> test.
> I created one file named bowling_spec.rb
>
> # bowling_spec.rb
> require 'bowling'
> require 'rubygems'
> require 'rspec'
>
> describe Bowling, "#score" do
>   it "returns 0 for all gutter game" do
>     bowling = Bowling.new
>     20.times { bowling.hit(0) }
>     bowling.score.should == 0
>   end
> end
>
> Run the script bowling_spec.rb in command prompt. and getting the
> error "No such file or Directory -- bowling_spec.rb "
>
> So what i am missing here (Sorry for the questions as i am new-bee to
> the testing with watir/rspec)
> I followed examplehttp://rspec.info/
>
> I also followed thehttp://relishapp.com/rspecbut i am not able to
> generate the html report.
>
> Please guide me on that
>
> On Jun 28, 10:03 am, Željko Filipin 
> wrote:
>
>
>
>
>
>
>
> > On Tue, Jun 28, 2011 at 3:55 PM, Parag Dave  wrote:
> > > How can i generate report (That has visual identification like Fail
> > > test is in red line or any symbol and Pass test is in Green) with
> > > watir. Also how much time it took in the one test script. Is there any
> > > tool or gem that help to create logger report generation that might in
> > > XML or HTML.
>
> > Sure, use RSpec gem:
>
> >http://rspec.info/http://relishapp.com/rspec
>
> > > If possible please post the example code. or site that have example.
>
> > This will create html file named report.htm:
>
> > rspec file_name.rb --format html --out report.htm
>
> > More information:
>
> >http://relishapp.com/rspec/rspec-core/v/2-6/dir/command-line/format-o...
>
> > Željko
> > --
> > watir.com - community manager
> > watir.com/book - author
> > watirpodcast.com - host

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: How to get list content

2011-06-27 Thread orde
This should point you in the right direction:
http://rdoc.info/gems/watir/1.9.0/Watir/Container#lis-instance_method

Hope it helps.

orde

On Jun 27, 9:13 am, Parag Dave  wrote:
> Hi All Geeks,
>
> Here i have some easy question ;) (That's why i am asking)
>
> $browser.table(:id, 'recent_records').to_a returns the number of row
> in the table, but if i want to count the number of list
> 
>     
>     
>     
>     
> 
>
> Here the value of the li is change as per the search term (Search
> returns the number of the list depend upon the search term).
>
> So question how can i check the number of return  I can not check
> with ID as it changes every time (As per the search term)

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: set (variable) issue

2011-06-22 Thread orde
Are you converting the amount var into a string before passing it to
the .set method?

orde

On Jun 22, 7:45 am, JohnH  wrote:
> I'm reading an integer value from an xls. file and save it in a
> variable called amount.
>
> Afterwards, I'm trying to send that variable value into a text field
> from a website, but I'm having some problems there.
>
> Here is the code:
> begin
> sleep 1
> counter = counter + 1
> browser.text_field(:name, "name").set(amount)
> rescue
>         if counter < 10
>         retry
>         end
> end
>
> If I use a direct value (like 5) instead or the "amount" variable it
> all works fine, but when trying in this form the form where the text
> field starts to change its position in the page :O
>
> I've tried as well with .value(variable) instead of .set(variable) but
> in this case nothing happens - the value is not sent.

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: how to read the

2011-06-17 Thread orde
Flash isn't supported in watir.  There is/was a flashwatir fork, but
I'm not sure if it's maintained anymore.

On Jun 17, 12:05 am, Jasmine  wrote:
> I just start learning the watir,I have a problem about it in the
> project.Watir doesn't support the tag of the object,so how to read the
> element,following is html code.
>  data="/mosicn/script/swf/uploadify.swf" id="uploadifyUploader"
> style="visibility: visible

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Need to click on a link which has only the class name.

2011-06-16 Thread orde
I'd agree with the post above.  Unless you have some other compelling
reason, the approach above should be fine.

In any event, $1 is returning nil in this code snippet:

if //
  begin
ie.link(:class, $1).click
  rescue => e
rescueHandle(e)
   end
else
   puts $1 # nil
   puts "FAILED! Could not find Class for Close Button"
   return false
end

On Jun 15, 12:30 pm, Chuck van der Linden  wrote:
> On Jun 15, 12:27 am, Mahesh  wrote:
>
>
>
>
>
>
>
>
>
> > Hi,
>
> >  > id=mainTabsId__CaseDetails>
>
> > This is the source code, and i am using the if condition to extract
> > the dynamic class name to extract the class name & click the link.
>
> > The Watir script i am using is:
>
> > if //
> >                 begin
> >                         ie.link(:class, $1).click
> >                 rescue => e
> >                         rescueHandle(e)
> >                 end
> >         else
> >                 puts "FAILED! Could not find Class for Close Button"
> >                 return false
> >         end
>
> You say you are dynamically extracting the class of the link, does
> this mean it is changing in a regular basis?
>
> I'm having a hard time following exactly what your challenge is here,
> What do you know, e.g. what is constant each time or predictable each
> time?  how do you know you've found the link you want to click?
>
> If the pattern is for example a list item with a particular ID, that
> contains the link you want,  and the class of the link always contains
> the text "...strip-close" then you could do something like this
>
>  if browser.li(:id, mainTabsId__CaseDetails').link(:class, /strip-
> close/).exists?
>    browser.li(:id, mainTabsId__CaseDetails').link(:class, /strip-
> close/).click
>  else
>    puts "FAILED! Could not find Close Button"
>    return false
>  end

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Need to access the login window

2011-06-16 Thread orde
This is more of a ruby question than a watir question.  I'd suggest
reading up on common control structures.  There is good documentation
at http://www.ruby-lang.org/en/documentation/ or (specific to your
question) 
http://www.howtogeek.com/howto/programming/ruby/ruby-if-else-if-command-syntax/




On Jun 16, 8:51 am, era gupta  wrote:
> This is what I want to know, How to use an If statement in this condition.
>
> On Thu, Jun 16, 2011 at 7:42 PM, Rahul Sharma 
> wrote:
>
>
>
>
>
>
>
> > After you have logged in you need to do  a check if login is prompted
> > again...use an "if" statement or something
>
> > On Jun 16, 2:13 pm, era gupta  wrote:
> > > Thanks Chuck for your response.
>
> > > Find below the code that I am trying to access:
>
> > > require 'watir'
> > > Watir::Browser.default = 'firefox'
> > > b = Watir::Browser.new
> > > b.goto ""
> > > b.link(:href, "").click
> > >         b.text_field(:id, "email_id").set("ad...@test.com")
> > >         b.text_field(:name, "pass").set("test")
> > >         b.link(:text, "Login").click
>
> > > In the above code line no. 6,7 and 8 I want to call when the site asks
> > for
> > > the login again. Otherwise it should go to some other task.
>
> > > Any Idea how it can be done.
>
> > > On Thu, Jun 16, 2011 at 2:32 AM, Chuck van der Linden  > >wrote:
>
> > > > On Jun 15, 5:12 am, Era  wrote:
> > > > > Hi,
>
> > > > > I am new in watir group and not very good in watir scripting. Please
> > > > > help me to write the script for the following scenario:
>
> > > > > There is one web application in which the user can access the main
> > > > > elements by logging into the account. But there is some issue in the
> > > > > login window. It sometimes asks to login twice it means the user has
> > > > > to give the username and password and then click on login button,
> > then
> > > > > again enter the same username and password and click on login window.
>
> > > > We're here to help, buy there is a limit, writing all the code for you
> > > > is past the limit.
> > > > What you can expect is responses in the area of helping when/where you
> > > > get stuck, and helping you refine your approach, or suggesting other
> > > > things to try instead.  With that in mind, please respond as best you
> > > > can tot he following:
>
> > > > Does your system always do this, or is there some random element which
> > > > controls when someone is asked for their credentials a second time?
>
> > > > Is there an easy way to tell (such as perhaps the page title) if the
> > > > user is still faced with a request for credentials verses logged into
> > > > the system?
>
> > > > Is the page source the same on both pages that request credentials?
>
> > > > Can you provide please a sample of the page's HTML and also most
> > > > important of all, the applicable Watir automation code you have tried
> > > > so far?
>
> > > > --
> > > > Before posting, please readhttp://watir.com/support. In short: search
> > > > before you ask, be nice.
>
> > > > watir-general@googlegroups.com
> > > >http://groups.google.com/group/watir-general
> > > > watir-general+unsubscr...@googlegroups.com<
> >http://groups.google.com/group/watir-general%0Awatir-general+unsubscr...>
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > watir-general@googlegroups.com
> >http://groups.google.com/group/watir-general
> > watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: watir scripts in windows scheduled task

2011-06-14 Thread orde
I've used windows scheduler without any major hiccups.  There is a
thread in this forum that discusses scheduled watir scripts hanging
on .js popups:

http://groups.google.com/group/watir-general/browse_thread/thread/bde0ab5ef96408c2/d89d4ec8a790bc5a?lnk=gst&q=windows+scheduler#d89d4ec8a790bc5a

If the failing task deals with .js popups and the passing task
doesn't, that might be something to look at.

HTH

orde

On Jun 14, 7:00 am, chachster  wrote:
> Hi,
>
> I've heard that running watir scripts via the windows scheduled task
> might not be supported and generally doesn't work too well?  If so, is
> there a workaround for this (ie: stopping the machine from getting
> locked, etc...).
>
> I'm currently using Watir 1.8,1 and Ruby 1.8.7 and have 2 scheduled
> tasks running watir scripts, one seems to work fine but one seems to
> be very sporadic and not reliable.
>
> Cheers!

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: How to deal with HTTP responce

2011-05-16 Thread orde
This is more of a ruby question than watir question, but you can take
a look at the Net:HTTP class: 
http://ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTP.html

orde

On May 16, 5:53 am, Сергей Демьянчук 
wrote:
> Hi, Amit
>
> This is possible with Watir if you use HttpWatch Controller.
> Before tell you more i think it will be optional for you to take a look 
> athttp://www.httpwatch.com/rubywatir/.
> The main idea of this approach is that you create the instance of the
> browser (Internet Explorer or Firefox)  attach HttpWatch plugin and start to
> record. This plugin allows you to get information you are interested in
> (status codes, kbytes received, kbytes send, header info, etc).
>
> Thanks,
> Sergii
>
> 2011/5/16 Amit Bobade 
>
>
>
>
>
>
>
> > Dear all:
>
> > I am trying to deal with http response using watir. It is possible with
> > watir? If yes, please tell me how to deal with response (status
> > code), header, etc.
>
> > --
> > Thanks and Regards,
> > Amit
>
> >  --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > watir-general@googlegroups.com
> >http://groups.google.com/group/watir-general
> > watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: No able to click hyperlink showing in the table>cell

2011-05-16 Thread orde
> Thanks for replying but these option is also not working.

What exactly is happening?  Is an error thrown?

It's possible that the javascript needs to be triggered via a
fire_event method (http://rdoc.info/gems/watir/1.8.1/Watir/
Element:fire_event):

browser.link(:text => "Update").fire_event("onclick")
browser.link(:text => "Cancel").fire_event("onclick")

Hope it helps.

orde



On May 16, 7:28 am, sandy  wrote:
> Thanks for replying but these option is also not working.
>
> Please let me know if there is an another solution of this problem.
>
> On May 13, 7:55 pm, Željko Filipin 
> wrote:
>
>
>
>
>
>
>
> > On Fri, May 13, 2011 at 4:31 PM, sandy  wrote:
> > > i am not able to click the update or cancel link
>
> > Try this:
>
> > browser.link(:text => "Update").click
> > browser.link(:text => "Cancel").click
>
> > Željko
> > --
> > watir.com - community manager
> > watir.com/book - author
> > watirpodcast.com - host
> > viaqa.mobi conference on software testing - organizer

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Handling pop up

2011-05-11 Thread orde
check out http://wiki.openqa.org/display/WTR/Pop+Ups

Hope it helps.

orde



On May 11, 7:16 am, "Vikas Garg"  wrote:
> Hello, while writing script for my website on IE, I am getting some problem:
>
> While logging in my website on Internet Explorer, I am getting a pop-up
> message which is asking me for remembering the password. How can I handle
> that pop-up?

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Printing a Text on Browser

2011-05-05 Thread orde
puts browser.div(:class, "system").text will print 123456

To see all tables on a page, use the show_tables method:
http://rdoc.info/gems/watir/1.8.1/Watir/IE#show_tables-instance_method

Hope it helps.

orde

On May 5, 3:14 am, Ashu  wrote:
> Is there an alternative wherein I can list all the tables and then
> locate the particular desired text?
> Thanks...
>
> On May 5, 1:48 pm, Ashu  wrote:
>
>
>
>
>
>
>
> > Well I tried it,
> > but since there doesnt exist any cell in the HTML, hence it does
> > return with a error.
>
> > On May 5, 12:54 pm, Željko Filipin 
> > wrote:
>
> > > On Thu, May 5, 2011 at 9:40 AM, Ashu  wrote:
> > > > on trying the above I get the following error
> > > > :undefined method 'td' for # > > > title="company:network">
>
> > > Try this then:
>
> > > puts browser.cell(:id => "e0_id").text
>
> > > Željko

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Sending single key presses to element.

2011-04-21 Thread orde
You should able to accomplish it through either .fire_event
or .send_keys methods.  Examples:

fire_event: 
http://rdoc.info/gems/watir/1.8.1/Watir/Element#fire_event-instance_method
send_keys: http://rdoc.info/gems/watir/1.8.1/Watir/IE#send_keys-instance_method

But I think that send_keys only works with IE.  Hope it helps.

orde


On Apr 21, 2:55 am, Alastair Montgomery  wrote:
> Having talked with our developers we would only need to be able to fire the
> following events;
> keydown, keyup, mousedown, mouseup and paste.
>
> So really need a way of being able to pass a key code with the keydown and
> keyup events for WATIR and FIREWATIR?

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Moving a window

2011-04-21 Thread orde
I use scrollintoview on IE7/8 + WinXP/7 without any errors (usually on
div tags to reorient the page "above the fold").  Example:

browser.div(how, what).document.scrollintoview

orde

On Apr 21, 8:24 am, Abe Heward  wrote:
> My code:
>
> $ff.checkbox(:id, "stdOptOut").document.scrollIntoView
>
> Error result:
>
> test.rb:7:in `': undefined method `scrollIntoView' for "":String
> (NoMethodError)

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: how to simulate Enter on a jumper box

2011-04-13 Thread orde
If I'm following your question correctly, you can activate the Enter
key via the send_keys method.

For example: browser.send_keys('{ENTER}')

For more info, see 
http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/IE.html#M000497

Hope it helps.

orde

On Apr 13, 1:01 pm, a b  wrote:
> I have attached the code screen snapshot.
>
> Thanks,
> Cristina
>
> On Wed, Apr 13, 2011 at 3:17 PM, a b wrote:
>
>
>
>
>
>
>
> > Hi all,
>
> > I didn't find any example on how to simulate Enter on a jump field.
>
> > I have a jump/search text field and is working only when we hit enter. I do
> > not have any other button..
> > I do not know how to do it on watir. I searched on watir group/
> > stackoverflow and google it but I didn't find anything to help me.
>
> > Please let me know if I can find any example or any information.
>
> > Hope One encountered that issue.
>
> > Regards,
> > Cristina

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Watir 1.8.1.rc1 Released

2011-04-08 Thread orde
FYI: I upgraded a couple of VMs (one XP; one Win7; both running IE8.x)
to 1.8.1.rc1 and ran a subset of existing scripts without any issues.

On Apr 8, 8:07 am, Charley Baker  wrote:
> My guess is that there's some javascript event on your select list that's
> not getting fired to open the new window since you mention this happens with
> regular select as well as select_no_wait. Can you take a look at what's
> currently being fired on the select list?
>
> Cheers,
>
> Charley Baker
> Lead Developer, Watir,http://watir.com
>
>
>
>
>
>
>
> On Fri, Apr 8, 2011 at 7:20 AM, GJHmf  wrote:
> > I replied to this directly to Ivan in more detail, as he added the
> > improvement.  To everyone else; I don't want this thread to go off-
> > topic, but for the record I got the same problem with select and
> > select_no_wait.
>
> > GJHmf
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > watir-general@googlegroups.com
> >http://groups.google.com/group/watir-general
> > watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: How to Trace the change in a field

2011-03-03 Thread orde
Find a way to determine the value of  and assign
it to a variable.


On Mar 3, 1:35 am, Ashu  wrote:
> The xpath for the html
> html  counter change class="normal">1
>
> is xpath  /html/body/div/div/div[4]/div/fieldset/table[3]/tbody/tr[9]/
> td[2]/div
>
> On Mar 3, 2:17 pm, Ashu  wrote:
>
>
>
>
>
>
>
> > hi,
> > there is a field on the php page that keeps track of the change in
> > counter field.
> > On every next refresh the value changes of that variable.
> > Change counter
> > 1
> > The "1" in the above code determines that one transaction has taken
> > place and it continues to increase up on every transaction update.
> > I am unable to figure out the logic to keep track of the change.

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Is there a 1.8.0 equivalent of "Watir::Waiter.wait_until"?

2011-03-02 Thread orde
I'm using watir 1.7.1, but there are 2 files named wait.rb and
element_extensions.rb (in *\commonwatir-1.7.1\lib\watir), which
contain the Wait and ElementExtensions modules.

These modules contain the method(s) that you want (i.e. the .until
method).

orde



On Mar 2, 12:05 pm, chsonnu  wrote:
> Using "Watir::Waiter.wait_until" in 1.8.0 causes this message to
> display:
>
> Using Watir::Waiter is DEPRECATED and will be removed in some newer
> version of Watir! Use Watir::Wait and Watir::ElementExtensions methods
> instead!
>
> I'm assuming the message isn't valid since "Watir::Wait" and
> "Watir::ElementExtensions" no longer exist.  What should we be using
> instead?

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Accessing file_field under div style

2011-02-11 Thread orde
Is there an error message?

On Feb 11, 6:57 am, Dan Claudiu Pop  wrote:
> Hi,
>
> I'm trying to access the file_field, highlighted in the screenshot below,
> but because of the div style i'm not able.
>
> 
>
> I tried @browser.file_field(:name => "top_image").set("C:\\image.PNG") with
> no success.
>
> Any suggestions ?
>
> Thanks,
> Dan

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Methods in custom libraries

2011-02-02 Thread orde
Take a look at the Namespaces section on 
http://phrogz.net/programmingruby/tut_modules.html#modules.

Hope it helps.

orde

On Feb 1, 8:56 pm, Dave McNulla  wrote:
> That is a general question, should address it to the Ruby group. But I
> don't mind giving advice when I can. Put a little code in here so I
> get idea of what you are doing.
>
> Dave
>
> On Feb 1, 8:05 pm, dt_nz  wrote:
>
>
>
>
>
>
>
> > Hi there
> > I am working testing a couple of different web apps that sometimes
> > need to call classes/methods in each others libraries
>
> > I have found that if I specified both library paths in $LOAD_PATH then
> > methods that have the same names sometimes get called by mistake
>
> > eg
> > the paths are
> > c:/ruby_tests/my_project_1/
> > c:/ruby_tests/my_project_2/
>
> > When running tests in my_project_1, I am trying to call a method name
> > open_browser in the Project1 module, however the test is trying to use
> > the open_browser in the Project2 module
>
> > The question is a bit more complicated.  Basically, I am trying to run
> > tests suites that may need to run something on the other project, and
> > I have not found a good way of handling the custom libraries.
>
> > Anyone got any pointers?

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Automating the object with in TD tag

2011-01-12 Thread orde
> I'm not sure what your question is?

+1.

 tags can be accessed via the .cell method:
http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Container.html#M000298

orde

On Jan 12, 9:24 am, Basim Baassiri  wrote:
> I'm not sure what your question is?
>
>
>
>
>
>
>
> On Wed, Jan 12, 2011 at 10:28 AM, Sanu  wrote:
> > Hi,
>
> > I have an object with TD tag with out any object type specified.
> > That is actually a tag in the application.
>
> > please find the HTML code below
>
> > 
> > 
> >      #text
> > 

[wtr-general] Re: Timeout when setting a text_field

2011-01-04 Thread orde
Try 'speed=:fast'.  For example:

browser = Watir::IE.new
browser.speed=:fast

It's documented at 
http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/IE.html#M000470

Hope it helps.

orde

On Jan 4, 1:12 pm, Emmanuel Cecchet  wrote:
> No, this is the set() operation that generates a timeout (Watir starts
> writing in the form but it takes a long time and the operation generates
> a timeout in the ruby script). I have no timeout on the server side.
> I forgot to mention that I am using Watir on Webdriver. So this might be
> a timeout coming from Webdriver.
>
> Emmanuel
>
> On 1/4/2011 4:08 PM, jv-watir wrote:
>
>
>
>
>
>
>
> > If I understand correctly, it is a session time out, you may want to
> > change in the web server settings or ask some one too, if it is the
> > issue.
>
> > On Jan 4, 3:45 pm, manu  wrote:
> >> Hi all,
>
> >> I am writing a pretty big chunk of text in a form and want to keep the
> >> default typing speed in the form to emulate a real user.
> >> So when I call:
> >> browser.text_field(:name, 'field').set('some very long text here')
>
> >> The operation stops before completion with a timeout.
> >> Is there a way I can override the timeout in the set operation so that
> >> it can complete?
> >> Any other workaround you can suggest?
>
> >> Thanks
> >> manu

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Can't click on a nameless div

2010-12-07 Thread orde
If browser.link(:text,"Add Another State").click does't work, try
browser.link(:text, /Add Another State/).click.

If neither of those work, you may need to use the fire_event method
(see http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Element.html#M000557).
Example:

browser.link(:text, /Add Another State/).fire_event("onclick")

Hope it helps.

orde



On Dec 7, 2:21 pm, LizLeong  wrote:
> I'm running Ruby1.8.7 patchlevel 249 with Watir 1.6.7 on WinXP.
>
> I'm trying to click on the text "Add Another State" on a web page.  It
> looks like a link, but I am having trouble hooking onto it.
>
> The structure is:
> 
>   http://www.website.com/
> insert" method="post">
>      
>         
>         
>                 
>                         Text - Add Another State
>                  Text - Empty Text Node
>
> I've tried the following unsuccessfully.  I tried to use flash also
> and didn't see anything highlighted either.
> ie.div(:class=>"mainModule").div(:text=>"Add Another State").click
> ie.div(:class=>"mainModule").div(:href=>"#").click
> ie.span(:text,"Add Another State").link(:text,"Add Another
> State").click
>
>  Maybe there's no way to do what I want, even knowing that would
> help!

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Option in select

2010-11-24 Thread orde
I don't ever find myself using xpath, but you could look here:
http://wiki.openqa.org/display/WTR/XPath

Hope it helps.

orde

On Nov 24, 3:01 pm, Shlomit Gazit  wrote:
> I am not sure I know how. could I get help on that?
>
> On Nov 24, 1:16 am, Željko Filipin 
> wrote:
>
>
>
>
>
>
>
> > On Tue, Nov 23, 2010 at 8:47 PM, Shlomit Gazit 
> > wrote:
>
> > > Is there an option to use title for option?
> > > This is the html code:
> > > http://semanticweb.databaserepublic.com/c2p/systemData/
> > > searchField#attachmentTargetItself" value="341" title="true,Inner
> > > Search,^50$|^62$|^56$,attachmentTargetItself">Attachment::
>
> > Did you try?
>
> > Željko
> > --
> > watir.com - community manager
> > watirpodcast.com - host
> > testingpodcast.com - audio podcasts on software testing. all of them

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Option in select

2010-11-23 Thread orde
Not according to 
http://wiki.openqa.org/display/WTR/HTML+Elements+Supported+by+Watir.
Check out the select_list method, and there's a red X for :title
attribute.

orde


On Nov 23, 11:47 am, Shlomit Gazit  wrote:
> Is there an option to use title for option?
> This is the html code:
> http://semanticweb.databaserepublic.com/c2p/systemData/
> searchField#attachmentTargetItself" value="341" title="true,Inner
> Search,^50$|^62$|^56$,attachmentTargetItself">Attachment::

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Need help to capture a string from the action attribute

2010-11-15 Thread orde
You should be able to capture the action attribute like this:

action_attribute =  @browser.form(:name, "mainForm").action

Hope it helps.

orde

On Nov 15, 8:20 am, Shiv  wrote:
> Hello,
>
> This is my html:
>
>  method="post" old_onsubmit="null" _sfm_form_name="mainForm"
> show_errors_together="true">
>
> I am using rasta and watir for data driven testing. I want to capture this
> url in the above html and compare with the url which I get from excel using
> Rasta to pass my test.
>
> *Problem I am facing is *
>
> I want the action variable in the below watir code to store the string using
> the action attribute in form element, I have tried with different
> combinations but was unsuccessful
>
> This is my watir code:
>
> def error?
>     trigger_link
>     action = @@ie.form(:xpath, "//fo...@action']")
>     if (@page_name == action)
>     puts "#...@page_name} page is available"
>         return 0
>     else
>     puts "#...@page_name} page is not available"
>     return 1
>     end
> end
> def trigger_link
> @@ie.link(:text, @link_name).click
> end
>
> I want the action variable to store the string using the action attribute in
> form element, I have tried with different combinations but was unsuccessful
> any help is greatly appreciated
>
> Regards,
> Shiv

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Capture Text

2010-11-05 Thread orde
Try:

puts @browser.cell(:class, "pageContent").text

Hope it helps.

orde

On Nov 5, 2:46 pm, Basim Baassiri  wrote:
> What code have you tried?
>
> You could use Xpath to retrieve the value looking at the class (if its
> unique to the page)http://wiki.openqa.org/display/WTR/XPath
>
> Try reading about tableshttp://rdoc.info/gems/watir/1.6.6/Watir/Table
>
> On Fri, Nov 5, 2010 at 5:32 PM, Eric Mathiesen wrote:
>
>
>
>
>
>
>
> > Hello All!
>
> > I am running into a significant challenge capturing a string of text to
> > later use in my script.  Here's the situation.  I have a basic create user
> > form in my application (First Name, Last Name, Username) that provides a
> > password on the page.  How would I go about capturing the string for the
> > password as It changes every time.  In the snippet below, the string I want
> > captured is ynH&ZaBK
>
> > Any help is GREATLY appreciated!
>
> > Viewing source gives me this (condensed to the fields I'm working with).
>
> > 
> > 
> >     
> >         
> >             
> >                  > cellspacing="1"  >
> >                     
> >                                  > ="formHeader" id='3081488100560284032' onclick =
> > "root.handleOnClick(document, this);" >
>
> >                                         Password:
>
> >                                  
> >                                 
> >                         
> >                     
> >                 
> >             
> >         
> >     
> > 
>
> > 
>
> > ynH&ZaBK
>
> > 
>
> > 
>
> > Thanks,
> > Eric
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > watir-general@googlegroups.com
> >http://groups.google.com/group/watir-general
> > watir-general+unsubscr...@googlegroups.com > legroups.com>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Welcome Jarmo Pertman to the core Watir team

2010-09-24 Thread orde
Congrats to Jarmo!  And many, many thanks to the watir core dev team
for their hard work on and dedication to watir.

If you're like me, watir has become an indispensable testing tool that
increases your test coverage and adds to your professional skill set.
So, why not put your money where your mouth is?  Make a donation:
http://pledgie.com/campaigns/2982.

Congrats/thanks again.

orde

PS: Yep...I made a donation myself.  It just ended up as anonymous ;)


On Sep 24, 3:06 pm, Jarmo Pertman  wrote:
> Thank you, Charley, for these nice words :)
>
> If someone hasn't noticed then Watir's repo on GitHub (http://
> github.com/bret/watir) has started to see some action lately.
> Hopefully we can keep it like that and start releasing as often as
> possible. There's no need to hold back ourselves when it comes to
> releasing. At least that is my moto and that's why i kept bugging
> Charley about making a release. Finally it happened :)
>
> There is still a lot of things to do starting from cleaning up the
> existing code and fixing bugs and adding new features. I'm also
> waiting to see what comes out of Watir-WebDriver lead by Jari Bakken's
> development. I've helped him a little to deal with IE specific things
> so far, but i'll try to add more value to that project since i really
> would like to see it in the end as a Watir 2.0. Forgive me if my views
> doesn't comply with someone else :)
>
> Anyway, hopefully we can build a better future for everyone :)
>
> I hope to see more people to get involved with helping us to change
> things in Watir/Watir-WebDriver.
>
> Jarmo
>
> On Sep 25, 12:51 am, Charley Baker  wrote:
>
>
>
> > Hi all,
>
> >  I just wanted to send out an announcement about a new addition to the
> > core Watir contributors and team. Jarmo Pertman has been working with
> > Watir for a while. I'll let his bio speak for itself:
>
> > My name is Jarmo Pertman (@jarm0) and i am writing about things that
> > really matter in IT :) I love a software programming language called
> > Ruby. I also like to create quality software, which means that
> > automated (web) user interface- and unit tests are a necessity. Watir,
> > RSpec and Cucumber are the tools i'd recommend.
>
> > He has an excellent blog athttp://www.itreallymatters.net/dealing
> > with testing, Watir, Rspec, and his own framework 
> > -http://github.com/jarmo/watirsplash Jarmo's also done a podcast with
> > Zeljko on Watir:http://watirpodcast.com/36-jarmo-pertman/ I'd
> > recommend anyone doing Watir testing to also do a podcast with Zeljko,
> > it's well worth it.
>
> > Jarmo's been driving changes to watir and making great pull requests
> > on github for a while now. Sorry it took me so long to add him as a
> > core contributor :), but it's been well worth it.
>
> > You might have seen the latest pre-release version of Watir email. It
> > couldn't have been done without Jarmo hounding me to release it, and
> > testing and tweaking code and his additions and "what's happening
> > now?" on IRC - the #watir channel on 
> > freenode.net:http://wiki.openqa.org/display/WTR/The+IRC+Channel I'd highly
> > recommend joining it if you use Watir.
>
> > Join me in welcoming Jarmo to the Watir core team. :)
>
> > Charley Baker
> > Lead Developer, Watir,http://watir.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: clicking a certain radio button with a specific value

2010-08-25 Thread orde
This page lists the supported attributes for each HTML element:
http://wiki.openqa.org/display/WTR/HTML+Elements+Supported+by+Watir

You should be able to do the following:

browser.radio(:value, "4").click

Hope it helps.

orde

On Aug 25, 5:09 pm, lawcab  wrote:
> Hi,
>
> need help.
>
> My page have 4 radio buttons. Same Name but different value. How can I
> say to select radio button that is value="4"
>
> 
> 
> 
> 
>
> Thanks,
> Law

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Regression in watir

2010-08-18 Thread orde
If you haven't already, I'd start with the tutorial to get familiar
with watir: http://wiki.openqa.org/display/WTR/Tutorial

There's a section called Running Tests that discusses a couple of
commonly-used test frameworks: rspec and Test::Unit.

Hope it helps.

orde

On Aug 18, 8:31 am, nix  wrote:
> Iam new to watir and would like to maintain regression tests. If
> one can suggest me to create a batch file or any tool that cn be
> referred? Thanks Nix

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: click on html element

2010-08-17 Thread orde
This is a matrix of supported elements and respective attributes:
http://wiki.openqa.org/display/WTR/HTML+Elements+Supported+by+Watir.
It includes cell, table and div (i.e. ,  and ).

If you want to extend watir, check out this link:
http://wiki.openqa.org/display/WTR/FAQ#FAQ-HowdoIaccessAnyTaginHTML%28DOM%29withWatir%3F

orde

On Aug 17, 4:09 am, TCBlues  wrote:
> is it possible to click any element using an id... something like
> ie.element(:id,"myid").click
>
> On 17 ago, 12:45, TCBlues  wrote:
>
>
>
> > the html I need to access has no ids or names:
> > ... AB
> > and also sometimes I need to click on words without any tag:
> > 
> > The text I want to click
> > 
> > On 17 ago, 12:27, TCBlues  wrote:
>
> > > Hi, I need to click on an html element using watir and firewatir, for
> > > example:
> > > A
> > > Since this is not a button or a link... how can I do it?

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: How to verify a result in a pop-up message dialog?

2010-08-17 Thread orde
Check out: http://wiki.openqa.org/display/WTR/Pop+Ups

Hope it helps.

orde

On Aug 17, 7:33 am, Chan Nguyen  wrote:
> Hi Charley,
>
> Thanks for your response, however I think it's too general for a
> newbie for me. By mailing list, did you mean searching in this 'watir'
> group? Sorry, I haven't done anything like this before. How do we know
> which type of dialog box was popped up? Looking at the HTML source?
> Can you give me simple example? Thanks,
>
> On Aug 13, 1:04 pm, Charley Baker  wrote:
>
>
>
> > Check in the mailing list and the main watir site for the same. First
> > identify what kind of dialog box you have and then work from there.
>
> > hth,
> > Charley Baker
> > Lead Developer, Watir,http://watir.com
>
> > On Fri, Aug 13, 2010 at 1:49 PM, Chan Nguyen  wrote:
> > > Hi Kevy,
> > > Is there any other way to work around this problem without touching
> > > AutoIt?
>
> > > On Aug 13, 12:16 pm, Super Kevy  wrote:
> > > > You may consider the AutoIT extension for reading the content of the
> > > > popup window
>
> > > > On Aug 13, 11:06 am, Chan Nguyen  wrote:
>
> > > > > Hi Arihan,
> > > > > It is a Windows PopUp. When I manually run it, I use FF to locate the
> > > > > text inside that "Windows"; however, when I check w/
> > > > > contains_text( "Some Search Results" ), it failed :( . Can you show me
> > > > > how to handle this situation?
> > > > > Thanks,
>
> > > > > On Aug 13, 9:03 am, arihan sinha  wrote:
>
> > > > > > is this a browser popup or window popup.
>
> > > > > > if its browser pop up then its straight forward but if its window
> > > popup
> > > > > > then  you have to handle it differently
>
> > > > > > Cheers
> > > > > > A
>
> > > > > > On Fri, Aug 13, 2010 at 4:45 PM, Chan Nguyen 
> > > wrote:
> > > > > > > Hi everyone,
> > > > > > > My situation is that I fill in a form then click search button. 
> > > > > > > The
> > > > > > > result box will pop up with number of searches found. I want to
> > > verify
> > > > > > > the result in this textbox but I really have no idea how? Anyone
> > > could
> > > > > > > share me a hint?
>
> > > > > > > Thanks,
>
> > > > > > > --
> > > > > > > Before posting, please readhttp://watir.com/support. In short:
> > > search
> > > > > > > before you ask, be nice.
>
> > > > > > > You received this message because you are subscribed to
> > > > > > >http://groups.google.com/group/watir-general
> > > > > > > To post: watir-general@googlegroups.com
> > > > > > > To unsubscribe: 
> > > > > > > watir-general+unsubscr...@googlegroups.com > > > > > >  legroups.com>
> > > - Hide quoted text -
>
> > > > > - Show quoted text -
>
> > > --
> > > Before posting, please readhttp://watir.com/support. In short: search
> > > before you ask, be nice.
>
> > > You received this message because you are subscribed to
> > >http://groups.google.com/group/watir-general
> > > To post: watir-general@googlegroups.com
> > > To unsubscribe: 
> > > watir-general+unsubscr...@googlegroups.com > >  legroups.com>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: How to verify the browser contains text in another page?

2010-08-13 Thread orde
For info on attaching, see http://wiki.openqa.org/display/WTR/Pop+Ups

If you're trying to verify the existence of something in an ,
you'll need to specify the frame.  Example: browser.frame(id,
'id').whatever(:id, 'id').exists?

On Aug 13, 9:16 am, Chan Nguyen  wrote:
> Hi orde again,
>
> I tried to use your second method. Unfortunately, I always got "not
> exists" when I tested the link
>
>  id="Module_3__ctl1__ctl0_hprOnlineHelp"> align="absmiddle" style="margin-right: 5px;" src="http://
> media.rapmlsstg.com/rapmlsimages/onlinehelp.gif"
> id="Module_3__ctl1__ctl0_imgOnlineHelp">Online Help
>
> The code that I use :
> # Since it's nested in a frame
> 1. main_frame.link( :id, "Module_3__ctl1__ctl0_hprOnlineHelp" ).click
> # Check the link to see if it exists?
> if browser.link( :id, "Module_3__ctl1__ctl0_hprOnlineHelp" ).exists?
> or
> if browser.link( :href, "http://media.rapmlsstg.com/help/
> 10.01.01/" ).exists?
>
> For your first solution, I'm a little vague about "assuming you've
> attached
> to the new page" ? How can I do this?
>
> Thanks,
>
> On Aug 12, 2:09 pm, Chan Nguyen  wrote:
>
>
>
> > Hi orde again, thanks a lot for your super sweet and quick response
> > ^_^ ! KISS !
>
> > On Aug 12, 2:03 pm, orde  wrote:
>
> > > >1. Verify text in a new opened page?
>
> > > browser.text.include?("string_to_verify")  # assuming you've attached
> > > to the new page
>
> > > > 2. Verify some condition in current page?
>
> > > Just an example: browser.link(:id, 'id').exists?
>
> > > And you would probably want to put that into a begin/rescue/end
> > > statement to handle a failure case gracefully:
>
> > > begin
> > >   # assert/verify something (e.g. browser.text.include?
> > > ("string_to_verify"))
> > > rescue
> > >   # log the failure if it fails.
> > > end
>
> > > For some info on exception handling, check 
> > > outhttp://ruby-doc.org/docs/ProgrammingRuby/html/tut_exceptions.html(or
> > > your favorite .rb reference doc).
>
> > > Hope it helps.
>
> > > orde
>
> > > On Aug 12, 1:22 pm, Chan Nguyen  wrote:
>
> > > > Hi everyone,
> > > > I encountered a problem that when clicking on a link, it will open a
> > > > separate page. In other words, I will have 2 pages, so if I want to
> > > > verify the web is doing correctly? What should I do?
> > > > 1. Verify text in a new opened page?
> > > > 2. Verify some condition in current page?
> > > > For both 1 & 2, I don't really know how to start? Can anyone share me
> > > > an example?
> > > > Thanks,

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Unable to locate checkbox element ?

2010-08-12 Thread orde
Search this group for :
http://groups.google.com/group/watir-general/search?group=watir-general&q=%3Ciframe%3E&qt_g=Search+this+group

Or check the tutorial: http://wiki.openqa.org/display/WTR/Printable+Tutorial
and 
http://wiki.openqa.org/display/WTR/Printable+Tutorial#PrintableTutorial-Frames

On Aug 12, 4:34 pm, Chan Nguyen  wrote:
> Hi Ethan,
>
> Can you show me an example, I saw a Frame in Firebug. I couldn't copy the
> whole HTML when viewing with FB, so weird.
>  src="customizehomepage.aspx?hidMLS=SDNA" class="MainBody" name="Main_Body"
> id="Main_Body" style="height: 124px;">
> And those checkboxes are nested into 2 more tables :(. How can I deal with
> these kind of situations ?
>
>
>
> On Thu, Aug 12, 2010 at 3:47 PM, Ethan  wrote:
> > deep nesting with most elements is no issue, but there is some mention of a
> > frame there. if it's inside a frame, then you'll need to access the frame
> > first, then the checkbox in the frame.
>
> > On Thu, Aug 12, 2010 at 18:42, Chan Nguyen  wrote:
>
> >> This is what I copied when using TestWise Recorder :
> >> # can't yet handle followFrame
> >> browser.checkbox(:id, "cblModules_0").clear
> >> browser.checkbox(:id, "cblModules_1").clear
>
> >> browser.checkbox(:id, "cblModules_2").clear
> >> browser.checkbox(:id, "cblModules_3").clear
>
> >> I think the reason that it failed because it's nested really deep. I can
> >> see a huge  slope when viewing with Firebug. Is there another way 
> >> to
> >> get around this issue? Thanks
>
> >> On Thu, Aug 12, 2010 at 3:28 PM, Chan Nguyen  wrote:
>
> >>> Hi Arihan,
> >>> Yes, I checked the id name carefully. I don't really know why it failed,
> >>> too obvious to be right :(
> >>> Thanks,
>
> >>> On Thu, Aug 12, 2010 at 3:04 PM, arihan sinha 
> >>> wrote:
>
>  Have you given the correct id name?
>
>  it seems from html code the id is *cblModules_2* but you have used i*
>  cblModules_0*
>
>  On Thu, Aug 12, 2010 at 10:15 PM, Chan Nguyen wrote:
>
> > Hi everyone,
> > I followed a very simple example in Watir tutorial website
> >http://wiki.openqa.org/display/WTR/Checkboxes.
> > Here is the element HTML code:
> >  > id="cblModules_2">
> > Then I tried
> > browser.checkbox( :id, 'icblModules_0' ).clear
> > but the compiler keeps complaining :
>
> > C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> > 56:in `assert_exists': Unable to locate element, using :id,
> > "icblModules_0" (Watir::Exception::UnknownObjectException)
>
> > Any idea?
>
> > Thanks,
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > You received this message because you are subscribed to
> >http://groups.google.com/group/watir-general
> > To post: watir-general@googlegroups.com
> > To unsubscribe: 
> > watir-general+unsubscr...@googlegroups.com >  legroups.com>
>
>   --
>  Before posting, please readhttp://watir.com/support. In short: search
>  before you ask, be nice.
>
>  You received this message because you are subscribed to
> http://groups.google.com/group/watir-general
>  To post: watir-general@googlegroups.com
>  To unsubscribe: 
>  watir-general+unsubscr...@googlegroups.com   legroups.com>
>
> >>  --
> >> Before posting, please readhttp://watir.com/support. In short: search
> >> before you ask, be nice.
>
> >> You received this message because you are subscribed to
> >>http://groups.google.com/group/watir-general
> >> To post: watir-general@googlegroups.com
> >> To unsubscribe: 
> >> watir-general+unsubscr...@googlegroups.com >>  legroups.com>
>
> >  --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > You received this message because you are subscribed to
> >http://groups.google.com/group/watir-general
> > To post: watir-general@googlegroups.com
> > To unsubscribe: 
> > watir-general+unsubscr...@googlegroups.com > legroups.com>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: How to verify the browser contains text in another page?

2010-08-12 Thread orde
>1. Verify text in a new opened page?

browser.text.include?("string_to_verify")  # assuming you've attached
to the new page

> 2. Verify some condition in current page?

Just an example: browser.link(:id, 'id').exists?

And you would probably want to put that into a begin/rescue/end
statement to handle a failure case gracefully:

begin
  # assert/verify something (e.g. browser.text.include?
("string_to_verify"))
rescue
  # log the failure if it fails.
end

For some info on exception handling, check out
http://ruby-doc.org/docs/ProgrammingRuby/html/tut_exceptions.html (or
your favorite .rb reference doc).

Hope it helps.

orde




On Aug 12, 1:22 pm, Chan Nguyen  wrote:
> Hi everyone,
> I encountered a problem that when clicking on a link, it will open a
> separate page. In other words, I will have 2 pages, so if I want to
> verify the web is doing correctly? What should I do?
> 1. Verify text in a new opened page?
> 2. Verify some condition in current page?
> For both 1 & 2, I don't really know how to start? Can anyone share me
> an example?
> Thanks,

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: How to access a href link which is a java script?

2010-08-12 Thread orde
Try:

ie.link(:class, "sWhiteLink").fire_event('onclick')

For reference: 
http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Element.html#M000557

Hope it helps.

orde

On Aug 12, 1:43 pm, Chan Nguyen  wrote:
> Hi,
> I used Firebug to locate the element, it's a text link. And here is
> element's HTML:
> Customize Home Page
> I tried :
> ie.link( :class, "sWhiteLink" ).click
> but Watir does not regconize it? Any idea?
>
> Thanks,

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Problem finding a way to access a link

2010-08-12 Thread orde
If at all possible, try to get a developer to add an id tag (or some
unique element attribute like name or value) to the href so that you
can locate it more easily.

Otherwise, you could try something like this:

$browser.link(:href, /some_unique_part_of_href/).click
or
$browser.link(:href, /some_unique_part_of_href/).fire_event('onclick')

Hope it helps.

orde

On Aug 12, 11:14 am, Melissa  wrote:
> I'm trying to get my Watir test to click the link below, and I'm
> coming up empty. I've tried accessing it by text, href, title, cell,
> table, link index and anything else I could think of. It's such messy
> code - I'm starting to wonder if it's even possible to get at it.
>
> Any thoughts on what I can use to click the link? Thanks for any tips!
>
>  bgcolor="#efefe7" align="center" style="font-size:90%;border-
> right:#94a6ce 1px solid;padding-right:4px;border-top:#94a6ce 1px
> solid;padding-left:4px;border-left:#94a6ce 1px solid;width:
> 100px;color:black;border-bottom:#FF9900 1px solid;font-
> family:tahoma;height:20px;background-color:#efefe7;text-
> align:center;text-decoration:none;">
>  href="javascript:document.aspnetForm.__ctl00_TemplateBody_DesignShell1_ctl0 
> 0_ctl00_SectionTabStrip_State__.value='1';__doPostBack('ctl00$TemplateBody
> $DesignShell1$ctl00$ctl00$SectionTabStrip','1')">
> Sources
> 

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Vista & IE8... does not wait for

2010-07-28 Thread orde
I don't run Vista, but I do recall some "need to run as administrator
on Vista" threads.  You can search this forum and/or this FAQ blurb
might help:

http://wiki.openqa.org/display/WTR/FAQ#FAQ-WhatshouldIdoiftwobrowserwindowsappearwhenrunningatestunderWindowsVista%3F

orde

On Jul 28, 1:59 pm, niartseoj  wrote:
> when i run these commands in IRB the ie.text_field(:name,
> 'UserName').flash works
> and ie.text_field(:name, 'UserName').set('user') works
>
> but i'm getting this when try to run it in a file
>
> c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:56:in
> `assert_exists': Unable to locate element, using :name,
> "UserName" (Watir::Exception::UnknownObjectException)
>         from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> 288:in `enabled?'
>         from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:
> 60:in `assert_enabled'
>         from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> input_elements.rb:327:in `set'
>         from sub.rb:7
>
> On Jul 28, 4:48 pm, niartseoj  wrote:
>
>
>
> > having problems running scripts using vista, IE8.
> > gem -v  returns
> > ruby -e 'require "watir"; puts Watir::IE::VERSION'
>
> > things work find in irb. but when i run this it seems that system does
> > not wait for htlm to load.
> > it runs find on xp with same versions
>
> > # the Watir controller
> > require "watir"
> > require "watir/ie"
>
> > ie = Watir::IE.new
> > ie.goto("http://www.rapidreview.com/sales30/CALogon.jsp";)
> > ie.text_field(:name, 'UserName').set('user')

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Understanding Modules and Classes a little better

2010-07-28 Thread orde
An old version of Programming Ruby is online: 
http://ruby-doc.org/docs/ProgrammingRuby/

Classes: http://ruby-doc.org/docs/ProgrammingRuby/html/tut_classes.html
Modules: http://ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html

It's the 1.6 version of Ruby, but the concepts are the same.

Hope it helps.

orde

On Jul 28, 2:08 am, Željko Filipin 
wrote:
> On Tue, Jul 27, 2010 at 10:48 PM, Jason  wrote:
> > I might post a few discussions here over the coming days trying to
> > better improve my framework,
>
> You could also take a look at existing Watir frameworks:
>
> http://github.com/scudco/tazahttp://github.com/bret/watircrafthttp://tech.groups.yahoo.com/group/watir-framework/
>
> Željko
> --
> watir.com - community manager
> watirpodcast.com - host
> testingpodcast.com - audio podcasts on software testing. all of them
> vidipodkast.com - pričamo o hardveru, softveru i časopisu Vidi

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Recent Stack Overflow Questions Tagged Watir

2010-07-28 Thread orde
> How about when we have exactly the same text in a page? What can we do?

Check this out: http://wiki.openqa.org/display/WTR/Multiple+Attributes

Example: browser.link(:text=>'text', :index=>2).click

You have a number of (good) questions, but I'd really advise reading
through the tutorial and FAQ to get up to speed on watir:
http://wiki.openqa.org/display/WTR/Start+Here

orde

PS: I think this thread went off topic...

On Jul 28, 9:16 am, Chan Nguyen  wrote:
> Hi Zeljko,
>
> Got you ;). By the way I got it worked like this:
> puts " Step 5 : move mouse over the Searches tab"
> browser.cell(:id => "uwmMainMenu_1").fire_event "onfocus"
> puts " Step 6 : click on Quick Search "
> browser.cell( :text => "Quick" ).fire_event "onmousedown"
> browser.cell( :text => "Quick" ).fire_event "onmouseup"
>
> Can I ask you about :text property? In the worst scenario without any
> information about element, you have to use :text? How about when we have
> exactly the same text in a page? What can we do?
>
> Thanks,
> Chan Nguyen
>
> On Wed, Jul 28, 2010 at 9:13 AM, Željko Filipin <
>
>
>
> zeljko.fili...@wa-research.ch> wrote:
> > 2010/7/28 Chan Nguyen 
> > >  superclass mismatch
>
> > Do not require both watir and watir-webdriver, only one.
>
> > Željko
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > You received this message because you are subscribed to
> >http://groups.google.com/group/watir-general
> > To post: watir-general@googlegroups.com
> > To unsubscribe: 
> > watir-general+unsubscr...@googlegroups.com > legroups.com>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: IE8 Update Broke Watir Support

2010-07-21 Thread orde
I'm running the following, but I'm not seeing the problem you
describe:

IE: 8.0.7600.16385
Ruby version: 1.8.6
WATIR version: 1.6.5
OS: Win7

orde

On Jul 20, 6:11 am, mattchurchy  wrote:
> Is anyone else having problems getting Watir to work with Internet
> Explorer 8 after latest minor update pushed out by Microsoft. I'm now
> on version 8.0.7600.16385.
>
> It worked fine until the update yesterday, when `bam` it stopped
> working.
>
> My problem is when calling:
>   @ie = Watir::IE.new
>   @ie.goto("www.google.com")
>
> which gives the error:
> unknown property or method `navigate'     HRESULT error code:
> 0x800706b5       The interface is unknown.
>
> The attach method below still works:
>   @ie = Watir::IE.attach(:title,//)
>
> I appreciate any feedback. I'd like to know if this is only me.
>
> Thanks in advance.
> - Matt

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Fwd: How to automate a scrollbar

2010-07-21 Thread orde
Checkout this thread:
http://groups.google.com/group/watir-general/browse_thread/thread/a0504c3358716dbb/3b17fb365356c8f1?hl=en&lnk=gst&q=scroll#3b17fb365356c8f1

Hope it helps.

orde

On Jul 21, 9:41 am, John Fitisoff  wrote:
> Might be possible to set focus on the element and then use send_keys to hit 
> the
> down arrow button some number of times to enable the check box. Ugly and not
> preferred but it might work as a short term fix.
>
> 
> From: Basim Baassiri 
> To: watir-general@googlegroups.com
> Sent: Wed, July 21, 2010 8:58:09 AM
> Subject: Re: [wtr-general] Fwd: How to automate a scrollbar
>
> Padma
>
> Perhaps a link to a page or some html (and javascript) would be helpful in
> solving your problem.  From the sounds of it, it might be solvable by sending 
> a
> javascript event or using autoit you could move your mouse to the position of
> the scrollbar and send mouse clicks or send keyboard spacebar.  Without html 
> or
> code, it makes it extremely difficult to help you
>
> Good Luck!
>
> On Wed, Jul 21, 2010 at 3:18 AM, Padma Reddy  wrote:
>
> someone please help me out.. its urgent!!
>
>
>
>
>
> >
>
> >Hi all,
>
> >I need to tick the checkbox and continue to the next page.. but the checkbox
> >will be enabled only when the agreements are read and scrolled down(that
> >particular pane).
>
> >How to enable the checkbox without scrolling down or how to scrolldown to 
> >enable
> >the checkbox??
>
> >Please let me knw if u can help.
>
> >--
> >Padma
>
> --
> >Before posting, please readhttp://watir.com/support. In short: search before
> >you ask, be nice.
>
> >You received this message because you are subscribed to
> >http://groups.google.com/group/watir-general
> >To post: watir-general@googlegroups.com
> >To unsubscribe: watir-general+unsubscr...@googlegroups.com
>
> --
> Before posting, please readhttp://watir.com/support. In short: search before
> you ask, be nice.
>
> You received this message because you are subscribed 
> tohttp://groups.google.com/group/watir-general
> To post: watir-general@googlegroups.com
> To unsubscribe: watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: unable to click image in a div

2010-07-13 Thread orde
Did you try just browser.image(:class, "gwt-Image").click or
browser.image(:class, "gwt-Image").fire_event("onload")?

orde

On Jul 13, 12:59 pm, Basim Baassiri  wrote:
> pre-conditions:
> ruby -v
> ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
>
> gem list watir
>
> *** LOCAL GEMS ***
>
> watir (1.6.5, 1.5.6)
>
> Browser: Firefox 3.6.6
> HTML Page:http://v.overlay.tv/demo/html5
>
> I've tried the following with no success (didn't respond to clicking of the
> play button). I used firebug to identify the tag and the attribute class
>
> irb(main):032:0> browser.div(:class, 'play-button play-button-up').click
> => 0
> irb(main):034:0> browser.div(:xpath , "//d...@class='play-button
> play-button-up']").exists?
> => true
> irb(main):035:0> browser.div(:xpath , "//d...@class='play-button
> play-button-up']").click
> => 0
> irb(main):036:0> browser.div(:xpath , "//d...@class='play-button
> play-button-up']").image(:class, "gwt-Image").exists?
> => true
> irb(main):037:0> browser.div(:xpath , "//d...@class='play-button
> play-button-up']").image(:class, "gwt-Image").click
> => 0
> irb(main):038:0> browser.div(:class, "play-button
> play-button-up").image(:class, "gwt-Image").exists?
> => true
> irb(main):039:0> browser.div(:class, "play-button
> play-button-up").image(:class, "gwt-Image").click
> => 0
> irb(main):040:0> browser.div(:class, "play-button
> play-button-up").image(:class, "gwt-Image").fire_event "onclick"
> => 0
> irb(main):041:0> browser.div(:class, "play-button
> play-button-up").image(:class, "gwt-Image").fire_event "onclick"
> => 0
> irb(main):042:0> browser.div(:class, "play-button
> play-button-up").fire_event "onclick"
> => 0
> irb(main):043:0> browser.div(:class, "play-button
> play-button-up").fire_event "mousedown"
> => 0
> irb(main):044:0> browser.div(:class, "play-button
> play-button-up").fire_event "mouseup"
> => 0
> irb(main):045:0> browser.div(:class, "play-button
> play-button-up").image(:class, "gwt-Image").fire_event "mousedown"
> => 0
> irb(main):046:0> browser.div(:class, "play-button
> play-button-up").image(:class, "gwt-Image").fire_event "mouseup"
> => 0
>
> Any Ideas?

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Rich calender how to get value

2010-06-24 Thread orde
I google'd up a RichFaces example: 
http://livedemo.exadel.com/richfaces-demo/richfaces/calendar.jsf.
It looks like you don't enter the date into the text field, but--
rather--you click on the calendar icon and select a date.

Peeking at the (ajax-heavy) HTML, you'll probably need to click on the
calender image and then use the fire_event method to trigger the event
handlers in the elements that you need to access.

Here's the link to the fire_event documentation:
http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Element.html#M000557

Hope it helps.

orde

On Jun 24, 4:17 am, naresh  wrote:
> Hi ,
>
> Fot input text , text_field method is available.
> What method is available for  following rich calender
>
>  timeZone="#{org.jboss.seam.international.timeZone}"
> enableManualInput="true" datePattern="dd-MM-" id="endDate"/>
>
> Regards
>
> On Jun 24, 4:10 pm, Željko Filipin 
> wrote:
>
>
>
> > On Thu, Jun 24, 2010 at 1:07 PM, naresh  wrote:
> > > Can anyone guide me how to do that in watir?
>
> > What is the problem? What have you tried? Is the calendar public, so we
> > could try too?
>
> > Željko
> > --
> > watir.com - community manager
> > watirpodcast.com - host
> > testingpodcast.com - audio podcasts on software testing. all of them
> > vidipodkast.com - pričamo o hardveru, softveru i časopisu Vidi

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: WatiR Recorder++

2010-06-24 Thread orde
Apparently, WatirMaker was renamed WatirRecorder, but it's not clear
that it's being actively supported. And I'm going to avoid the debate
about the benefits/drawbacks of recorders ;)

Here's a download link: http://watir-recorder.openqa.org/

Hope it helps.

orde



On Jun 23, 1:22 am, Sohail Mirza  wrote:
> Hi All,
>
> Can anyone explain me below points
>
> *How to installed Watir Recorder ++?*
> *What is the difference between WatiR Recorder++ and WatiR Maker?*
>
> Best Regards,
> Sohail

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Gif not spawning child element

2010-06-23 Thread orde
The anchor tag has event handlers associated with it (e.g. onClick),
so you might need to trigger the event.  Check this out:

http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Element.html#M000557

Example syntax: browser.link(:id, 'id').fire_event('onclick')

Hope it helps.

On Jun 23, 1:41 pm, Eric Mathiesen  wrote:
> Hello all,
>
> On
>
>  type='hidden'>  id='search_customer.tracking_no::0::0'
> onMouseUp='root.handleOnMouseUp(document, this);' href='#'
> onMouseDown='root.handleOnMouseDown(document, this);'
> name='search_customer.tracking_no::0'> src='/images/icon_magnfi.gif' height='16' border='0' class='cursorHand'
> id='default::searchrow::TEMPLATE' alt='Search'>
>
> when I attempt to access the gif by clicking (either image or button) or
> tabbing to and pressing enter I can audibly hear the click sound on the
> workstation during the script lines;
>
> puts "image click..."
> ie.frame("app_FinanceCenter").image(:id,
> "default::searchrow::TEMPLATE").click
> puts "button click..."
> ie.frame("app_FinanceCenter").button(:id,
> "default::searchrow::TEMPLATE").click
> puts "simulate tab to and enter..."
> ie.send_keys("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{ 
> TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{ENTER}")
>
> however no child is spawned blocking all the hidden fields from being
> tested.  Has anyone encountered a similar issue?  Any help would be greatly
> appreciated.  I have tried accessing this control with id, name, src (xpath)
> and all to no avail (but I hear the click!) 
>
> Eric

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: How to handle a pop up (google chrome)

2010-06-16 Thread orde
> so i think chromewatir not support popup , am i right?

To be honest, I really don't know since I don't use chromewatir and I
don't know if chromewatir is actively supported by its primary
developer at this point.

If there was info on handling popups with chromewatir, I'd expect it
to be on that page.

Perhaps one of the more informed contributors to this forum would have
a better idea (Željko?).



On Jun 16, 2:59 am, NumOi3  wrote:
> thankyou but it still not work
>
> i use watir-webdriver to run on google chrome and i didn't found  lib -> 
> enabled_popup.rb for watir-webdriver
>
> and chromewatir too
>
> and i can not use click_no_wait method too
>
> so i think chromewatir not support popup , am i right?
>
> On Jun 16, 4:13 am, orde  wrote:
>
>
>
> > I generally test using IE, but this is the link to the FAQ:
>
> >http://wiki.openqa.org/display/WTR/Pop+Ups
>
> > Hope it helps.
>
> > On Jun 14, 9:20 pm, NumOi3  wrote:
>
> > > Hi All,
> > > I am working with web-driver for test  google chrome  browser.
> > > and there's  pop up is generated after clicking on a button.
> > > i need to click "OK" button and get text form pop up.
> > > How can i access these popup.
>
> > > Please help ...

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: How to handle a pop up (google chrome)

2010-06-15 Thread orde
I generally test using IE, but this is the link to the FAQ:

http://wiki.openqa.org/display/WTR/Pop+Ups

Hope it helps.

On Jun 14, 9:20 pm, NumOi3  wrote:
> Hi All,
> I am working with web-driver for test  google chrome  browser.
> and there's  pop up is generated after clicking on a button.
> i need to click "OK" button and get text form pop up.
> How can i access these popup.
>
> Please help ...

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: How to create a file and save it.

2010-06-03 Thread orde
The Ruby IO and File classes contain untold goodies.   I'd suggest
reading up on them:

http://www.ruby-doc.org/core/classes/File.html
http://www.ruby-doc.org/core/classes/IO.html

Hope it helps.

orde


On Jun 3, 7:49 am, Adam Reed  wrote:
> With respect, file manipulation is a basic feature of Ruby.  WATIR is
> a testing library/tool that makes use of the basic built-in Ruby
> functionality.  That is the distinction that is being made.
>
> In your case, you would need to design a way to locate the Order Id,
> temporarily assign that value to a variable, open or create a text
> file, and finally write this value to the file.
>
> Which step in that process are you having difficulty coding?
>
> Thanks,
> Adam
>
> On Jun 3, 9:17 am, meaculpa  wrote:
>
>
>
> > Its WATIR specific only. And This is not a blanket request for help.
>
> > Everyone in this forum are having experience and they are not just
> > NOOBS. So they can surely understand what i mean... Also After
> > googling only I post here...
>
> > I believe this group is mainly for helping each other than creating
> > specific rules !!!
>
> > I accept that my question was little.
>
> > My actual problem is :
>
> > From a webpage I get a Order Id. I want to save that in a notepad. I
> > googled and didnt find any help.

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: not a frame nor form for a newbie....

2010-05-20 Thread orde
Sounds like you need to attach to the second browser instance.  Check
out http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/IE.html#M000464

The syntax is like this: browser = Watir::IE.attach(:url, "the_url")
or browser = Watir::IE.attach(:title, "the_title")

Hope it helps.

orde

On May 20, 8:44 am, dave  wrote:
> i'm trying to access a spawned ie window after login...that's neither
> a frame nor formi think
> i'm able to startup and login to our workorder system...with this
>
> ie = Watir::IE.start('http://cpp-woapp.cpp.org/web/base/logindisp')
>
> ...and find the proper places to put the user name and password
> ...and click the login button:
>    ie.button(:id,'submit').click
>
> ...BUT...this complex vendor supplied software (even though the web
> server and software is all inside our own LAN).
> 1.) spawns a whole new IE screen(/IE window?) while keeping the
> original login screen in a completely different IE browser /window.
> This results in having two IE on my window(XP) minimize bar.
> 2.) This second spawned window has only a title on it AND i am unable
> to view any HTML or access any toolbars...nor access through ie
> methods i know of
> ..any ideas on how to access this second screen (i've already tried
> ie.frame and ie.form)...tia dave
>
> --
> Before posting, please readhttp://watir.com/support. In short: search before 
> you ask, be nice.
>
> You received this message because you are subscribed 
> tohttp://groups.google.com/group/watir-general
> To post: watir-general@googlegroups.com
> To unsubscribe: watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: How to access to onclick attribute

2010-05-05 Thread orde
Try something like this:

browser.link(:text, "text").fire_event('onclick')

For reference: 
http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Element.html#M000557

orde

On May 5, 7:16 am, Rodrigo  wrote:
> Hi guys,
>
> I'm trying to click a button I have on a site I'm working on, but this
> button is identified by the following tag and properties:
> Select
>
> I've tried to use the different methods to be able to click on the
> button but no one was successful.
>
> Do you mind to give me an idea to resolve this problem?
>
> Thanks a lot!!
> rODRIGO
>
> --
> Before posting, please readhttp://watir.com/support. In short: search before 
> you ask, be nice.
>
> You received this message because you are subscribed 
> tohttp://groups.google.com/group/watir-general
> To post: watir-general@googlegroups.com
> To unsubscribe: watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: synchronisation in ruby

2010-04-09 Thread orde
> there's an instance method in the Waiter class on line 36  that
> should do the trick (note: untested): @@default_timeout = 60.0

I obviously meant class variable ;)

On Apr 9, 10:14 am, orde  wrote:
> Take a look 
> athttp://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Waiter.html#M000580.
>
> The wait_until method is defined in commonwatir/lib/watir/waiter.rb,
> and there's an instance method in the Waiter class on line 36 that
> should do the trick (note: untested): @@default_timeout = 60.0
>
> Hope that helps.
>
> orde
>
> On Apr 9, 4:24 am, arihan sinha  wrote:
>
>
>
> > I am using wait_until and its working fine and it seems the default value is
> > 60 secs. I mean it waits for 60 secs . If it doesnt find then status is
> > fail.
>
> > but if I want to change that to say 120 secs (  because in our apps few
> > cases it takes more than 60 secs) then where i need to change. there must be
> > something in the library file where we can change. anyone can suggest pls
>
> > Thanks
> > Arihan
>
> > On Mon, Mar 29, 2010 at 3:24 PM, Željko Filipin <
>
> > zeljko.fili...@wa-research.ch> wrote:
> > > On Mon, Mar 29, 2010 at 4:22 PM, arihan sinha 
> > > 
> > > wrote:
> > > > can I use the synchronisation statement in the ruby test rather than
> > > sleep statement.
>
> > > Did you read this?
>
> > >http://wiki.openqa.org/display/WTR/How+to+wait+with+Watir
>
> > > Željko
> > > --
> > > watir.com - community manager
> > > pledgie.com/campaigns/2982 - donate to Watir
> > > watirpodcast.com - host
> > > testingpodcast.com - audio podcasts on software testing. all of them
>
> > >  --
> > > Before posting, please readhttp://watir.com/support. In short: search
> > > before you ask, be nice.
>
> > > You received this message because you are subscribed to
> > >http://groups.google.com/group/watir-general
> > > To post: watir-general@googlegroups.com
> > > To unsubscribe: 
> > > watir-general+unsubscr...@googlegroups.com > >  legroups.com>
>
> > > To unsubscribe from this group, send email to watir-general+
> > > unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> > > ME" as the subject.

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com

To unsubscribe, reply using "remove me" as the subject.


[wtr-general] Re: synchronisation in ruby

2010-04-09 Thread orde
Take a look at 
http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Waiter.html#M000580.

The wait_until method is defined in commonwatir/lib/watir/waiter.rb,
and there's an instance method in the Waiter class on line 36 that
should do the trick (note: untested): @@default_timeout = 60.0

Hope that helps.

orde

On Apr 9, 4:24 am, arihan sinha  wrote:
> I am using wait_until and its working fine and it seems the default value is
> 60 secs. I mean it waits for 60 secs . If it doesnt find then status is
> fail.
>
> but if I want to change that to say 120 secs (  because in our apps few
> cases it takes more than 60 secs) then where i need to change. there must be
> something in the library file where we can change. anyone can suggest pls
>
> Thanks
> Arihan
>
> On Mon, Mar 29, 2010 at 3:24 PM, Željko Filipin <
>
>
>
> zeljko.fili...@wa-research.ch> wrote:
> > On Mon, Mar 29, 2010 at 4:22 PM, arihan sinha 
> > wrote:
> > > can I use the synchronisation statement in the ruby test rather than
> > sleep statement.
>
> > Did you read this?
>
> >http://wiki.openqa.org/display/WTR/How+to+wait+with+Watir
>
> > Željko
> > --
> > watir.com - community manager
> > pledgie.com/campaigns/2982 - donate to Watir
> > watirpodcast.com - host
> > testingpodcast.com - audio podcasts on software testing. all of them
>
> >  --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > You received this message because you are subscribed to
> >http://groups.google.com/group/watir-general
> > To post: watir-general@googlegroups.com
> > To unsubscribe: 
> > watir-general+unsubscr...@googlegroups.com > legroups.com>
>
> > To unsubscribe from this group, send email to watir-general+
> > unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> > ME" as the subject.

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com

To unsubscribe, reply using "remove me" as the subject.


[wtr-general] Re: Experience with testing Apples Web Objects

2010-04-08 Thread orde
I'm not personally familiar with Apple WO, but--since it's a web-app
framework that generates an HTML page--watir should be able to do the
trick as a functional automation tool.

Start by checking out the documentation at watir.com (http://watir.com/
documentation/) and the example at 
http://wiki.openqa.org/display/WTR/Example+Test+Case.

>From there, you could do some exploratory scripting of 
>http://store.apple.com/us
to see if watir suits your needs.

Hope that helps.

orde

On Apr 8, 2:21 pm, dt_nz  wrote:
> I should point out that my company is looking at developing a new site
> with webojects, and we have to make a decision on whether we will use
> WATIR or something else.
>
> --
> Before posting, please readhttp://watir.com/support. In short: search before 
> you ask, be nice.
>
> You received this message because you are subscribed 
> tohttp://groups.google.com/group/watir-general
> To post: watir-general@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com


[wtr-general] Re: How can I send a keystrokes using Watir?

2010-04-05 Thread orde
autoit is installed with watir.  You don't need to require it, but
you'll need to make sure the .dll is registered correctly.  If you run
into problems, check out 
http://wiki.openqa.org/display/WTR/FAQ#FAQ-HowdoIfixaWIN32OLERuntimeErrorwhenIuseAutoIt%3F

send_keys is a method that allows you to execute autoit commands
within watir scripts.  You can check out the send_keys method on
http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/IE.html#M000497.

Hope that helps.

orde



On Apr 4, 6:31 pm, Rats  wrote:
> On Apr 2, 4:27 am, orde  wrote:
>
> > Use autoit (http://www.autoitscript.com).
>
> > Here's the function list for 
> > Send:http://www.autoitscript.com/autoit3/docs/functions/Send.htm
>
> > Example syntax: browser.send_keys("{TAB}{DOWN}")
>
> Thanks for your reply. I am however a little bit confused by what
> you've written.
>
> I got send_keys to work just like in autoit. However I don't
> understand what you mean by "use autoit". Are you saying you can use
> autoit directly from within Watir? Is this by doing a require 'autoit'
> or something similar?

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com

To unsubscribe, reply using "remove me" as the subject.


[wtr-general] Re: HP acquires the Watir project, announces Wativ

2010-04-01 Thread orde
Alister/Z - Let me know if you need rides to/from the airport.  Then
again, you probably have a limo waiting (after flying 1st class,
naturally).

On Apr 1, 8:28 am, jw  wrote:
> good one Alister!  I usually get taken on this day but everybody at my
> office said to expect pranks : )
>
> On Apr 1, 5:23 am, "Don Taylor"  wrote:
>
>
>
> > it would be a pity if all this turned out to be the work of a juvenile few
> > who treat Watir as their plaything.
>
> > just glad I've found TestWise developed by someone who is committed to
> > providing a tool for test automation.
>
> > Don
>
> >   _  
>
> > From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com]
> > On Behalf Of ®eljko Filipin
> > Sent: Thursday, 1 April 2010 9:05 PM
> > To: watir-general@googlegroups.com; watir
> > Subject: Re: [wtr-general] HP acquires the Watir project, announces Wativ
>
> > Alister and I are flying to HP headquarters (Palo Alto, Calif.) as I write
> > this (from the plane). We have heard that Watir users are gathering in front
> > of the headquarters. There are some rumors about them having signs and
> > shouting stuff. I hope we will manage to record a podcast with a few of the
> > Watir users and hear what they think.
>
> > ®eljko
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > You received this message because you are subscribed 
> > tohttp://groups.google.com/group/watir-general
> > To post: watir-general@googlegroups.com
> > To unsubscribe: watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com

To unsubscribe, reply using "remove me" as the subject.


[wtr-general] Re: How can I send a keystrokes using Watir?

2010-04-01 Thread orde
Use autoit (http://www.autoitscript.com).

Here's the function list for Send: 
http://www.autoitscript.com/autoit3/docs/functions/Send.htm

Example syntax: browser.send_keys("{TAB}{DOWN}")



On Mar 31, 7:03 pm, Rats  wrote:
> Ok, I've successfully clicked on a link and a new page opens. All I
> want to do now is to send two keystokes i.e. tab and then a down
> arrow.
>
> Is there a way to do this using Watir?

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com

To unsubscribe, reply using "remove me" as the subject.


[wtr-general] Re: Same word different places on the page.

2010-03-11 Thread orde
Something like this should work:

browser.link(:index=>0, :text=>"Share").click

Watir uses zero-based indexing (although I think firewatir is
different).  So, the example above would click on the first link where
the text is "Share".

Hope it helps.

On Mar 11, 3:09 pm, Shlomit Gazit  wrote:
> I need to look for the word 'Share' in related to different texts in
> different places in the page, but the link has the same properties.
> How can I distinguish. Any ideas?

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: watir-general@googlegroups.com
To unsubscribe: watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Gmail compose automation

2010-03-10 Thread orde
Developing and maintaining gmail scripts will be a challenge.

If you're committed to it, search this forum, and there are a few
threads that might help.  For example:

http://groups.google.com/group/watir-general/browse_thread/thread/d6ffd6abde7e711c/14f71f58ec631893?lnk=gst&q=automating+gmail#14f71f58ec631893
http://groups.google.com/group/watir-general/browse_thread/thread/4b5b7622f4ad8a82/ceb6a3d140a7f0ec?lnk=gst&q=automating+gmail#ceb6a3d140a7f0ec

If you can avoid automating gmail, I'd strongly advise it.

Hope that helps..

orde

On Mar 10, 3:21 am, Dilip M  wrote:
> Hi all,
>
> I am automating gmail..while i am doing so i encountered a problem.. i
> will explain here that problem plz can any one solve and guide me to
> solve..
>
>                  i can able to login successfully.then after while
> composing a mail i can flash that compose using
> $ie.frame(:name,"main").frame(:name,"v1").span(:text,"Compose
> Mail").flash
>
> even its going to flash.. and also i can click that using
> $ie.frame(:name,"main").frame(:name,"v1").span(:text,"Compose
> Mail").click
>
> its going to click..  but its not opening that new compose window.. i
> mean simply its clicking that but its not functioning properly
>
> plz.. try and solve this problem... if any one has solution plz. mail
> me...
>
> Thanks In advance..
> Dilip.M
> mai at :   lovingdilip...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: Dealing with the  character

2010-03-10 Thread orde
You should be able to select Unicode (UTF-8) from that dropdown.  That
might fix the "Â" issue that you're observing.

On Mar 10, 10:04 am, George  wrote:
> It appears that Western European (ISO) is selected by default. Is
> there something I can do in the code to convert it to UTF-8?
>
> On Mar 10, 9:44 am, orde  wrote:
>
>
>
> > Nice that you got it worked out.
>
> > One question, though.
>
> > Open IE, go to the website you're testing, right click, and select
> > Encoding.  Is Unicode (UTF-8) selected?
>
> > On Mar 10, 8:26 am, George  wrote:
>
> > > I'm using IE. I tried using gsub!(/Â/, ""), but I couldn't remove the
> > > remaining spaces. It took a long time, but I think I figured it out
> > > using this:
>
> > > x = "3       Jubitz Travel Center              Â
> > > Portland,OR"
> > > b = x.gsub(x[/(\d+)(\b[^0-9A-Za-z]{1,}\b)/], '') # gets rid of the
> > > beginning number/funky chars
> > > puts b.gsub(b[/(\b[^0-9A-Za-z]{1,}\b)(\w+)(,..)\Z/], '') # gets rid of
> > > the second set of funky chars and city/state
>
> > > On Mar 9, 3:36 pm, Ethan  wrote:
>
> > > > Is this in IE or firefox?

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: Dealing with the  character

2010-03-10 Thread orde
Nice that you got it worked out.

One question, though.

Open IE, go to the website you're testing, right click, and select
Encoding.  Is Unicode (UTF-8) selected?


On Mar 10, 8:26 am, George  wrote:
> I'm using IE. I tried using gsub!(/Â/, ""), but I couldn't remove the
> remaining spaces. It took a long time, but I think I figured it out
> using this:
>
> x = "3       Jubitz Travel Center              Â
> Portland,OR"
> b = x.gsub(x[/(\d+)(\b[^0-9A-Za-z]{1,}\b)/], '') # gets rid of the
> beginning number/funky chars
> puts b.gsub(b[/(\b[^0-9A-Za-z]{1,}\b)(\w+)(,..)\Z/], '') # gets rid of
> the second set of funky chars and city/state
>
> On Mar 9, 3:36 pm, Ethan  wrote:
>
>
>
> > Is this in IE or firefox?

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: Dealing with the  character

2010-03-09 Thread orde
This will remove each "Â" character from the string:

x = "3       Jubitz Travel Center              Â
Portland,OR"
x.gsub!(/Â/, "")

But you're probably looking to solve your root problem.  Looks like a
UTF-8 vs. ISO-8859-1 issue.  Do a search for "utf-8 Â as a space" on
your favorite search engine, and that should point you in the right
direction (hopefully).

Hope that helps.

orde


On Mar 9, 8:58 am, George  wrote:
> I'm not sure if this is a Watir or a Ruby question. I'm pulling all
> the contents from a select list, and when I display each option, I get
> something similar to the following (without the quotes):
>
> "3       Jubitz Travel
> Center               Portland,OR"
>
> Is there something in Watir that will get rid of the  character? Is
> this related to UTF-8? Ultimately, I'm trying to isolate "Jubitz
> Travel Center" from the text string. If someone can help, I would be
> most grateful!
>
> Thanks,
>
> George

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: Measure download time of a file using watir

2010-02-12 Thread orde
Is a Download Complete popup actually displayed?  If not, then that
example won't work.

ai.ControlClick("Save As", "", "&Save", "left") and
ai.ControlClick("Download complete", "", "Close") provide 2 distinct
code points around the download process.  If possible, you need to
identify a second one (e.g. a Download Complete prompt).

Otherwise, maybe something like this (untested):
###
ai.ControlSend("Save As", "", "Edit1", file_to_download)
ai.ControlClick("Save As", "", "&Save", "left")

time_start = Time.now
   until
   File.exist?(filename) && File.size(filename) == known_file_size
   end
time_end = Time.now
###

Take a look at the File class.  It's packed with cool stuff.  Hope it
helps.


On Feb 11, 8:53 pm, Maumita  wrote:
> Hi, I made the changes as per the suggesstion.Below find my modified
> script
> But my script gets ended once the file starts downloading. The script
> is not handling "ai.WinWait("Download complete", "", 5)
>   ai.ControlClick("Download complete", "", "Close")"
> Please help on this. I am using watir-1.6.2
>
> require 'watir'
> require 'win32ole'
>
> $ie = Watir::IE.new
> $ie.goto("http://localhost/dportal";)
> $ie.image(:name, 'toplogo_nav_04_off').click
> $ie.link(:text, 'Hitach product').click
> $ie.link(:text, 'File size 220 MB').click_no_wait
>
>     ai = WIN32OLE.new("AutoItX3.Control")
>     ai.WinWait("File Download", "", 5)
>     ai.ControlFocus("File Download", "", "&Save")
>     sleep 1
>     ai.ControlClick("File Download", "", "&Save", "left")
>     ai.WinWait("Save As", "", 5)
>     sleep 1
>     begin_time=Time.now
>     ai.ControlSend("Save As", "", "Edit1","login.csv")
>     ai.ControlClick("Save As", "", "&Save", "left")
>     ai.WinWait("Download complete", "", 5)
>     ai.ControlClick("Download complete", "", "Close")
>     end_time=Time.now
>     p (end_time - begin_time).to_s
>
> Thanks
> Maumita
>
> On Feb 11, 11:46 pm, orde  wrote:
>
>
>
> > Is there a Download Complete prompt/popup?  If so, you could wrap this
> > section of solution #2, and it will give you an approx. download
> > time.
>
> > Otherwise, you might be able to use the File class (e.g. see if the
> > downloaded file exists?  is the size 220MB?).
>
> > ###
> > begin_time=Time.now
> >     ai.ControlSend("Save As", "", "Edit1",filepath)
> >     ai.ControlClick("Save As", "", "&Save", "left")
> >     ai.WinWait("Download complete", "", 5)
> >     ai.ControlClick("Download complete", "", "Close")
> > end_time=Time.now
> > download_time = time_start - time_end
> > ###
>
> > Hope it helps.
>
> > On Feb 11, 2:20 am, Maumita  wrote:
>
> > > require 'watir'
> > > require 'win32ole'
> > > $ie = Watir::IE.new
> > > $ie.goto("http://localhost/dportal";)
> > > $ie.image(:name, 'toplogo_nav_04_off').click
> > > $ie.link(:text, 'Hitach product').click
> > > $ie.link(:text, 'File size 220 MB').click_no_wait
>
> > > prompt_message = "Do you want to open or save this file?"
> > > 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.ControlClick(window_title, prompt_message, "&Save")
> > > saveas_dialog_obtained = save_dialog.WinWait("Save As", "Save&in", 5)
> > > sleep 1
> > > begin_time=Time.now
> > > path = File.dirname("D:/ruby/log/").gsub("/" , "\\" )+ "\\" +
> > > "login.csv"
> > > save_dialog.ControlSend("Save As", "", "Edit1",path)
> > > save_dialog.ControlClick("Save As", "Save &in", "&Save")
> > > e

[wtr-general] Re: Measure download time of a file using watir

2010-02-11 Thread orde
Is there a Download Complete prompt/popup?  If so, you could wrap this
section of solution #2, and it will give you an approx. download
time.

Otherwise, you might be able to use the File class (e.g. see if the
downloaded file exists?  is the size 220MB?).

###
begin_time=Time.now
ai.ControlSend("Save As", "", "Edit1",filepath)
ai.ControlClick("Save As", "", "&Save", "left")
ai.WinWait("Download complete", "", 5)
ai.ControlClick("Download complete", "", "Close")
end_time=Time.now
download_time = time_start - time_end
###

Hope it helps.

On Feb 11, 2:20 am, Maumita  wrote:
> require 'watir'
> require 'win32ole'
> $ie = Watir::IE.new
> $ie.goto("http://localhost/dportal";)
> $ie.image(:name, 'toplogo_nav_04_off').click
> $ie.link(:text, 'Hitach product').click
> $ie.link(:text, 'File size 220 MB').click_no_wait
>
> prompt_message = "Do you want to open or save this file?"
> 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.ControlClick(window_title, prompt_message, "&Save")
> saveas_dialog_obtained = save_dialog.WinWait("Save As", "Save&in", 5)
> sleep 1
> begin_time=Time.now
> path = File.dirname("D:/ruby/log/").gsub("/" , "\\" )+ "\\" +
> "login.csv"
> save_dialog.ControlSend("Save As", "", "Edit1",path)
> save_dialog.ControlClick("Save As", "Save &in", "&Save")
> end_time=Time.now
> download_time = time_start - time_end
>
> But my scripts exist when the file starts downloading.
> Please help on this.This is urgent for my project to measure the file
> download time.
> Is there any other way to do this?
>
> Thanks in advance
> Maumita
>
> On Feb 11, 2:14 am, orde  wrote:
>
>
>
> > I've used solution #2 onhttp://wiki.openqa.org/display/WTR/File+Downloads.
>
> > You should be able to modify that code to get an approximate download
> > time:
>
> > time_start = Time.now
> > # code
> > # code
> > time_end = Time.now
> > download_time = time_start - time_end
>
> > Hope it helps.
>
> > orde
>
> > On Feb 10, 1:30 am, Maumita  wrote:
>
> > > Hi,
>
> > > Is this possible to write a watir script that should download a file
> > > from website to locally and also to measure how long it takes to
> > > download the file.
> > > This is a requirement in my project. The main idea is to measure the
> > > download time of a file.
> > > Please suggest if there is any way to do this.
> > > Thanks in advance.
>
> > > Maumita

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: Measure download time of a file using watir

2010-02-10 Thread orde
I've used solution #2 on http://wiki.openqa.org/display/WTR/File+Downloads.

You should be able to modify that code to get an approximate download
time:

time_start = Time.now
# code
# code
time_end = Time.now
download_time = time_start - time_end

Hope it helps.

orde

On Feb 10, 1:30 am, Maumita  wrote:
> Hi,
>
> Is this possible to write a watir script that should download a file
> from website to locally and also to measure how long it takes to
> download the file.
> This is a requirement in my project. The main idea is to measure the
> download time of a file.
> Please suggest if there is any way to do this.
> Thanks in advance.
>
> Maumita

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: use verify instead of assert

2010-02-10 Thread orde
I'd suggest reading the Test::Unit documentation at
http://www.ruby-doc.org/core/classes/Test/Unit.html.  The assertions
are detailed at http://www.ruby-doc.org/core/classes/Test/Unit/Assertions.html.

If you want your script to continue after a failed condition, you
could wrap the condition in an if/else statement.  Or use begin/rescue/
end:

begin
  # assert/verify something (e.g. assert(browser.link(:id,
"id").exists?)
rescue
  # log the failure if it fails.
end

Hopefully, this helps point you in the right direction.

orde

PS: In terms of "best practices for reporting to test results?", you'd
likely get various answers to that question.  I do know that many of
the contributors on this forum use RSpec and hold it in high regard.




On Feb 10, 11:42 am, Matt  wrote:
> Hi,
>
> I am new to Watir and trying to figure out the best way to go about
> validating my AUT. I started out by using the assert method for text
> checks but do not like that it exits when there is a failure and does
> not execute the following statements. So my questions are:
>
> How is the verify method used?
> Can I check for objects, properties, text, etc with verify? (need to
> check for the existence of objects)
> Which libraries need to be loaded?
>
> I added 'require "watir/testcase" ' as directed in another post and it
> did not work. I was using it like this:
>
> verify($browser.text.include?("Order Now") )
>
> best practices for reporting to test results?
>
> Thanks!
>
> Matt

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: div values in table

2010-02-09 Thread orde
browser.contains_text("total") is matching against the string
"total".

If you looking check the value of the variable named total, then you
would do this: browser.contains_text("#{total}").

Also, the .contains_text method has been deprecated in favor
of .text.include?  See 
http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/PageContainer.html#M000192

orde

On Feb 9, 12:14 pm, tester86  wrote:
> Hi
>
> The value 601 is stored in total and I want to make sure that 'total'
> matches the value on the screen (overall total). Is there any way that
> I can compare to make sure that is it the correct total.
>
> if total 601
> and
> overall total is 601
>
> passed.
>
> I tried to do if $b.contains_text("total") but it fails.
>
> On Feb 8, 3:02 pm, orde  wrote:
>
>
>
> > The .html method is returning a string value.   So, you're adding
> > "14.56" and "85.00" to create "14.5685.00"
>
> > You need to convert the a and b variables to a numeric class.  In this
> > case, you want to use .to_f:
>
> > total = a.to_f +  b.to_f
>
> > Hope that helps.
>
> > orde
>
> > On Feb 8, 12:45 pm, tester86  wrote:
>
> > > Sorry but in IRB when I do
>
> > > a= $b.table(:index, 1)[2][11].html
> > > print 14.56
>
> > > b=$b.table(:index, 1)[2][11].html
> > > print 85.00
>
> > > total = a +  b
>
> > > in IRB it returns 14.5685.00
>
> > > when it should return 99.56

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: div values in table

2010-02-08 Thread orde
The .html method is returning a string value.   So, you're adding
"14.56" and "85.00" to create "14.5685.00"

You need to convert the a and b variables to a numeric class.  In this
case, you want to use .to_f:

total = a.to_f +  b.to_f

Hope that helps.

orde

On Feb 8, 12:45 pm, tester86  wrote:
> Sorry but in IRB when I do
>
> a= $b.table(:index, 1)[2][11].html
> print 14.56
>
> b=$b.table(:index, 1)[2][11].html
> print 85.00
>
> total = a +  b
>
> in IRB it returns 14.5685.00
>
> when it should return 99.56

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: how to run watirscript in background

2010-02-05 Thread orde
Sorry that didn't work for you.  Then again, I'm guess I'm not clear
regarding what you're trying to accomplish, either.

These pages contain info on the Thread class:

http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_threads.html
http://ruby-doc.org/core/classes/Thread.html


On Feb 5, 5:33 am, venkat  wrote:
> Added more info. for better understanding my problem...
>
> again ran the script, following are the errors:
>  1) Error:
> testMasters_All(TestSuite):
> WIN32OLERuntimeError:
>     OLE error code:0 in 
>       
>     HRESULT error code:0x80070005
>       Access is denied.
>
> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/input_elements.rb:75:i n
> `method_missing'
>
> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/input_elements.rb:75:i n
> `select_item_in_select_list'
>
> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/input_elements.rb:69:i n
> `each'
>
> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/input_elements.rb:69:i n
> `select_item_in_select_list'
>
> C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/input_elements.rb:46:i n
> `set'
>     ./CrimeCogTest_AllMasters.rb:414:in `gangSearch'
>     ./CrimeCogTest_AllMasters.rb:408:in `each'
>     ./CrimeCogTest_AllMasters.rb:408:in `gangSearch'
>     ./CrimeCogTest_AllMasters.rb:89:in `testMasters_All'
>
>  1) Error:
> testMasters_All(TestSuite):
> WIN32OLERuntimeError: unknown property or method `document'
>     HRESULT error code:0x80010108
>       The object invoked has disconnected from its clients.
>     C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ie-class.rb:460:in
> `method_missing'
>     C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ie-class.rb:460:in
> `document'
>     C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/locator.rb:44:in
> `each_element'
>     C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/locator.rb:51:in
> `locate'
>     C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/container.rb:811:in
> `locate_tagged_element'
>     C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/image.rb:20:in
> `locate'
>     C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:53:in
> `assert_exists'
>     C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:288:in
> `enabled?'
>     C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:60:in
> `assert_enabled'
>     C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:233:in
> `click!'
>     C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:219:in
> `click'
>     ./CrimeCogTest_AllMasters.rb:430:in `gangSearch'
>     ./CrimeCogTest_AllMasters.rb:89:in `testMasters_All'
>
> thanks
>
>
>
> On Thu, Feb 4, 2010 at 1:44 PM, venkat  wrote:
> > Thanks in advance if anybody answers my query here it is:
>
> > i have my watir script named login.rb which checks the functionality of
> > Login, go to Inbox then Logout from Gmail website.
> > If I run this login.rb using google loadtest example, it fails with
> > multiple users (#5), multiple iterations(5). Hence I want run these tests in
> > the background process without seeing on the functional GUI navigation on
> > windows.
>
> > Would there be any solution to run my tests for load in the backgound? One
> > of my friend's friend gave me clue that it can be done using
> > Fork...Spawn...with parent process/ child process even in windows too...
>
> > Please help me
> > venkat

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: Handle Failures in Watir

2010-02-04 Thread orde
You could do it a couple of ways.

1. Use an if/else statement (as seen here - 
http://wiki.openqa.org/display/WTR/Example+Logging)

if condition=true
   # log pass
else
   # log fail
end

2. Use the Exception class:

Here's the basic syntax:

begin
  # do something
rescue
  # log the failure if it fails.
end

For more detailed info, I'd strongly suggest getting familiar with
http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_exceptions.html
and/or http://www.ruby-doc.org/core/classes/Exception.html

orde

On Feb 4, 8:55 am, tester86  wrote:
> Hi
>
> Question for the watir group. When I run my test sometimes it fails if
> it cannot find an element or input field. Is there a way that when
> this occurs it can log that failure and continue running the tests and
> not stop. Is there any Watir commands that I can put in place at
> points in my script to cope with failures?
>
> I am using the ruby logger to output all my result into a text file.

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: how to run watirscript in background

2010-02-04 Thread orde
You can set the browser as invisible after launching the browser
(from http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/IE.html#M000266):

browser = Watir::Browser.new
browser.visible=(0)

Not sure if that's what you're looking for, tho.  Hope it helps.

orde


On Feb 4, 12:14 am, venkat  wrote:
> Thanks in advance if anybody answers my query here it is:
>
> i have my watir script named login.rb which checks the functionality of
> Login, go to Inbox then Logout from Gmail website.
> If I run this login.rb using google loadtest example, it fails with multiple
> users (#5), multiple iterations(5). Hence I want run these tests in the
> background process without seeing on the functional GUI navigation on
> windows.
>
> Would there be any solution to run my tests for load in the backgound? One
> of my friend's friend gave me clue that it can be done using
> Fork...Spawn...with parent process/ child process even in windows too...
>
> Please help me
> venkat

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: Firewatir & rpxnow

2010-02-01 Thread orde
Take a look at http://wiki.openqa.org/display/WTR/Frames

To click a link in a frame, the syntax is the following:

browser.frame(:id, "id").link(:id, "id").click

Hope that helps.

orde

On Jan 31, 11:28 pm, Gimle  wrote:
> To answer both of your questions, I'm posting some related html
> here..
>
> The original page doesn't initially contain the html element i'm
> looking to activate, but they are generated by this remove
> javascript :
>
> https://rpxnow.com/openid/v2/widget"</a>; type="text/
> javascript">
>
> This contains a class "RPXNOW" that handles generating the html for
> the overlay where the link ends up.
>
> Here's a very partial paste acquired via Firebug (view source doesn't
> really cut it here :)), containing the  that houses the rpxnow
> login overlay. Most of the tree is truncated, i've left only the
> element I was inspecting open.
>
>  allowtransparency="true" style="background: transparent none repeat
> scroll 0% 0%; width: 373px; height: 265px; -moz-background-clip: -moz-
> initial; -moz-background-origin: -moz-initial; -moz-background-inline-
> policy: -moz-initial; position: absolute; top: 0pt; left: 0pt;
> visibility: visible; display: block; margin-top: 12px;"
> name="rpx_auth_1265008478579" src="">
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Welcome back,
> 
> habbo.testing.1
> 
> not you?
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> Above, you can see the span within the link I was trying to acquire.
>
> Tryhttp://www.habbo.co.uk/and click "Sign In or Register with one of
> these services" to see the overlay in action.
>
> -Toni
>
> On 27 tammi, 09:01, Angrez Singh  wrote:
>
>
>
> > Can you post the HTML code? Also, is this link is inside the FRAME?
>
> > On Tue, Jan 26, 2010 at 6:50 PM, Gimle  wrote:
> > > Hello all. I have a question regarding accessing the elements in
> > > remote-javascript generated content on a page. It would appear that
> > > these created elements are not accessible with firewatir at all. I
> > > tried both tagged elements and xpath, but no matches for elements
> > > within rpxnow's javascript-generated content can be found.
>
> > > Example : RPX now's "not you?" link
>
> > > ff.link(:class, "not_you").exists? # <-- should return true, but
> > > doesn't
> > > ff.span(:text, "not you?").exists? # <-- also false
> > > ff.link(:xpath, "//a...@class='not_you']/span").exists? # <-- Doesn't
> > > return true
> > > ff.link(:xpath, "//a...@class='not_you']/").exists? # <-- jSSH doesn't
> > > like this formatting on an xpath
>
> > > Is this a known problem, or am I just not doing it right?
>
> > > I am using Ruby 1.8.6 via Netbeans 6.8, Firewatir 1.6.5 and Firefox
> > > 3.0.17
>
> > > -Toni
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Watir General" group.
> > > To post to this group, send email to watir-general@googlegroups.com
> > > Before posting, please read the following guidelines:
> > >http://wiki.openqa.org/display/WTR/Support
> > > To unsubscribe from this group, send email to
> > > watir-general-unsubscr...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/watir-general

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: Watir debug logging

2010-02-01 Thread orde
Ruby has a Logger class: http://www.ruby-doc.org/core/classes/Logger.html

It should deliver exactly what you're looking for.  Hope it helps.

orde

On Feb 1, 2:02 am, fharper1961  wrote:
> Hi everyone,
>
> I've started using Watir, and it would seem really useful if Watir
> could generate a DEBUG level log.
>
> What I mean, is that by setting a Watir option, a log would be
> generated that contains all the "user" input.
>
> The result would be something along the lines of
> D, [10:05:15#2372] DEBUG -- : Goto URLhttp://xxx.yyy.com:8020/foo/bar/
> D, [10:05:23#2372] DEBUG -- : Clicking on 
> linkhttp://xxx.yyy.com:8020/foo/bar/viewer/results/list?category=2
>
> Does such a feature already exist?

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: Issue with clicking submit in a site modal window

2010-01-29 Thread orde
Check out http://jira.openqa.org/browse/WTR.  Click Components >
SafariWatir.

On Jan 29, 9:14 am, QAguy  wrote:
> Where can one find the list of open safariwatir bugs to see if this is
> listed?
>
> On Jan 29, 6:01 am, Yuping Zhong  wrote:
>
>
>
> > I think it is a bug for SafariWatir.
>
> > On Wed, Jan 27, 2010 at 1:01 AM, QAguy  wrote:
> > > The site I am testing has a page where I if I click on a specific
> > > element I can modify its properties by opening a modal window. In the
> > > modal window I enter in the needed data then click submit using:
>
> > > browser.link(:class, "create_and_move_button").click
>
> > > The link is highlighted in yellow in the modal window but the link is
> > > not actually clicked (i.e the model never closes and the object's
> > > properties are not updated).
>
> > > I am using Safariwaitr. Has anyone else had this kind of issue?
>
> > > Thanks
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Watir General" group.
> > > To post to this group, send email to watir-general@googlegroups.com
> > > Before posting, please read the following guidelines:
> > >http://wiki.openqa.org/display/WTR/Support
> > > To unsubscribe from this group, send email to
> > > watir-general-unsubscr...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/watir-general

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: "File Download - Security Warning" popup

2010-01-26 Thread orde
I have previously used solution 2 on 
http://wiki.openqa.org/display/WTR/File+Downloads
for downloading files.

You'd have to tweak it (e.g. for starters, change "File Download" to
"File Download - Security Warning"; change "&Save" to "&Run"), but it
should get you going in the right direction.

Hope it helps.

orde



On Jan 25, 4:30 pm, capri  wrote:
> I replaced click with click_no_wait in my code..doesn't seem to work..
> just stalls at this point and doesnt proceed further to click the
> 'Run' button of the file download - security warning window.  any
> thoughts on this?
>
> many thanks..
>
> On Jan 23, 6:19 am, Arihan  wrote:
>
>
>
> > Pls use clicknowait method .. It would work ..
>
> > Sent from my iPhone
>
> > On 22 Jan 2010, at 22:53, capri  wrote:
>
> > > Hi,
>
> > > I tried the below code to identify "file download -security warning"
> > > message using autoit in my watir script.  However it does not seem to
> > > work.  I am trying to click the 'Run' button of this window. On
> > > running the script, it gets struck and doesn't show any errors. Any
> > > thoughts,inputs would be highly appreciated.
>
> > > many thanks.
>
> > > Code:
> > > -
> > > require 'watir'
> > > require 'rubygems'
> > > require 'win32ole' # to invoke Autoit controls
>
> > > ie=Watir::IE.new
> > > autoit=WIN32OLE.new('AutoItX3.Control')
>
> > > ie.goto "http://www.cooliris.com";
>
> > > ie.link(:html,/return InstallHelper.clickedDownload()/).click
>
> > > r=autoit.WinExists("File Download - Security Warning")
> > > puts r
>
> > > res=autoit.WinWait("File Download - Security Warning",'',3)
> > > puts  res
> > > res=autoit.WinActivate("File Download - Security Warning")
> > > puts res
> > > res=ie.autoit.ControlFocus("File Download - Security Warning","",
> > > "&Run")
> > > res=ie.autoit.ControlClick("File Download - Security
> > > Warning","","&Run")
> > > puts res
> > > puts "\n"
>
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "Watir General" group.
> > > To post to this group, send email to watir-general@googlegroups.com
> > > Before posting, please read the following 
> > > guidelines:http://wiki.openqa.org/display/WTR/Support
> > > To unsubscribe from this group, send email to 
> > > watir-general-unsubscr...@googlegroups.com
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/watir-general

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: "File Download - Security Warning" popup

2010-01-22 Thread orde
Try click_no_wait instead of click on this line:

ie.link(:html,/return InstallHelper.clickedDownload()/).click

Also, check out: http://wiki.openqa.org/display/WTR/Basic+Authentication

Hope it helps.

On Jan 22, 2:53 pm, capri  wrote:
> Hi,
>
> I tried the below code to identify "file download -security warning"
> message using autoit in my watir script.  However it does not seem to
> work.  I am trying to click the 'Run' button of this window. On
> running the script, it gets struck and doesn't show any errors. Any
> thoughts,inputs would be highly appreciated.
>
> many thanks.
>
> Code:
> -
> require 'watir'
> require 'rubygems'
> require 'win32ole' # to invoke Autoit controls
>
> ie=Watir::IE.new
> autoit=WIN32OLE.new('AutoItX3.Control')
>
> ie.goto "http://www.cooliris.com";
>
> ie.link(:html,/return InstallHelper.clickedDownload()/).click
>
> r=autoit.WinExists("File Download - Security Warning")
> puts r
>
> res=autoit.WinWait("File Download - Security Warning",'',3)
> puts  res
> res=autoit.WinActivate("File Download - Security Warning")
> puts res
> res=ie.autoit.ControlFocus("File Download - Security Warning","",
> "&Run")
> res=ie.autoit.ControlClick("File Download - Security
> Warning","","&Run")
> puts res
> puts "\n"

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: find out the value in select list

2010-01-21 Thread orde
Try .getSelectedItems[0] to get the currently selected option.

Try .getAllContents to get an array of the available options.

This info from
http://groups.google.com/group/watir-general/browse_thread/thread/22400557ce0ef33d/d2b1ff0fe5559bf4?lnk=gst&q=get+value+of+select_list#d2b1ff0fe5559bf4

Once you have an array of options, you should be able to iterate
through them.

Hope it helps.

orde

On Jan 21, 1:11 pm, Shlomit Gazit  wrote:
> Hello Tiffany and Orde,
>
> getSelectedOptions gave me:undefined method `getSelectedOptions' for
> # error.
>
> In anyhow:
>
> I am doing:
>
>  status_value = $ie.select_list(:name, "selectedImperativeStatusId").value
>
>  status_next_value = (status_value.to_f + 1).to_s
>
>  *puts*(status_next_value.*class*)
>
>  # 2
>
> * puts*(status_next_value)
>
>  # String
>
> * puts*(status_next_value)
>
>  #3.0
>
>  $ie.select_list(:name, "selectedImperativeStatusId").select_value(
> "status_next_value")
>
> Although status_next_value is showing as a String class, I am getting:
>
> Watir::Exception::NoValueFoundException: No option with value of
> status_next_value in this select element.
>
> Somehow it is showing 3.0 instead of 3.
>
> Any idea?
>
> Basically I need each time to select a different selection from the list,
> than the one that has already been selected.
>
>
>
> On Thu, Jan 21, 2010 at 10:34 AM, Tiffany Fodor  wrote:
> > Hi Shlomit!
>
> > You can get the current selected values like this:
>
> > browser.select_list(:id, 'my_select_list').getSelectedOptions
>
> > This returns an array of all selected options, so if there's only
> > one,
>
> > browser.select_list(:id, 'my_select_list').getSelectedOptions[0]
>
> > will give you the text.
>
> > Hope this helps!
>
> > -Tiffany
>
> > On Jan 21, 11:16 am, Shlomit Gazit  wrote:
> > > How can I find out what has been selected in a dropdown?
> > > I would like to always modify the find value but I should know first
> > > what the value was.
>
> > > Any idea anyone?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Watir General" group.
> > To post to this group, send email to watir-general@googlegroups.com
> > Before posting, please read the following guidelines:
> >http://wiki.openqa.org/display/WTR/Support
> > To unsubscribe from this group, send email to
> > watir-general-unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/watir-general
-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general

[wtr-general] Re: popup handling

2010-01-21 Thread orde
I think you need to use click_no_wait on this line:

ie.button(:value, 'Click').click

Also, lots of info here: http://wiki.openqa.org/display/WTR/Pop+Ups

Hope it helps...

orde


On Jan 21, 9:28 am, Naveen devadass  wrote:
> Hi All,
>
>  I am using following script to handle the pop up
>
> but the code is not woking
>
> the code  autoit.Send("{Enter}") is not working .it doesnot  send the
> key strokes properly
>
> please help me in this regard
>
> or please give me some other options to handle the pop up
> effectively.currently  i am using watir 1.6.2
>
> require 'watir'
>  require 'win32ole'
> require 'watir/dialog'
> require 'watir/winClicker'
> require 'watir/contrib/enabled_popup'
>
> # MAIN APPLICATION CODE
> link = '\\\hcl0203\Release 3\Automated Testing\popups Handling
> \Sampl1.html'
>
> ie = Watir::IE.start(link)
> ie.button(:value, 'Click').click
>
> def check_for_popups(title, button)
>     popup=Thread.new {
>         autoit=WIN32OLE.new('AutoItX3.Control')
>         ret=autoit.WinWait(title,"",5)
>         if (ret==1)
>             autoit.WinActivate(title)
>             button.downcase!
>             if button.eql?("ok") || button.eql?("yes") || button.eql?
> ("continue")
>             autoit.Send("{Enter}")
>             else
>                 autoit.Send("{tab}")
>                 autoit.Send("{Enter}")
>             end
>         elsif (ret==0)
>             puts "No popup, please check your code."
>         end
>     }
>     at_exit { Thread.kill(popup) }
> end
>
> check_for_popups("", "OK")
-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general

[wtr-general] Re: how to click the open button in a microsoft window

2009-12-08 Thread orde
Take a look at this page (especially the usage for example #2):
http://wiki.openqa.org/display/WTR/File+Downloads

Use the click_no_wait method on the link that triggers the popup.

Hope that helps.

orde





On Dec 8, 10:06 am, arihan sinha  wrote:
> Can you please try this below and let me know how i will proceed further
> after that .
>
> I need to click the cancel button or open button of that window.
>
> def test_powerpointslide
>         $ie = Watir::IE.new
>         $ie.set_fast_speed
>         $ie.goto("http://content.nejm.org/";)
>          $ie.link(:text, "Sign in").click
>          $ie.text_field(:name, "username").set("arihansinha")
>         $ie.text_field(:name, "code").set("hello123")
>         $ie.button(:name, "signin").click
>         $ie.link(:text, "PAST ISSUES").click
>
>         $ie.link(:text, "2008").click
>         $ie.link(:text, "Jan 3, Vol. 358, No. 1, 1 - 100").click
>
>         $ie.link(:text, "Full Text").click
>         $ie.link(:text, "PowerPoint Slide Set").click
>
>     end
>
> if you need to run this again and again then manually click the *sign out 
> *link
> and then *yes sign me out of the nejm button*.
>
> Thanks
>
> Arihan
>
> On Tue, Dec 8, 2009 at 5:05 PM, mohe  wrote:
> > Can you try this.?
>
> > save_dialog.WinWait("File Download","",40)
> > save_dialog.WinActivate("File Download")
> > save_dialog.Send("{TAB}") 'Use this if you need to tab.
> > save_dialog.Send("{Enter}")
>
> > On Dec 8, 10:37 am, arihan sinha  wrote:
> > > I've the watir version 1.6.2 and when i added the code snippet as
>
> > > prompt_message = "Do you want to open or save this file?"
> > > 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")
>
> > > but its not working. it stuck on that file download window at the
> > begining.
> > > not moving further.. Anything i am missing??
>
> > > thanks
>
> > > Arihan
>
> > > On Tue, Dec 8, 2009 at 4:16 PM, Željko Filipin <
>
> > > zeljko.fili...@wa-research.ch> wrote:
> > > > On Tue, Dec 8, 2009 at 5:14 PM, arihan sinha <
> > arihan.si...@googlemail.com>
> > > > wrote:
> > > > > Then I think I've to install AutoIt ...rt?
>
> > > > Autoit is installed with Watir.
>
> > > > Željko
>
> > > >  --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Watir General" group.
> > > > To post to this group, send email to watir-general@googlegroups.com
> > > > Before posting, please read the following guidelines:
> > > >http://wiki.openqa.org/display/WTR/Support
> > > > To unsubscribe from this group, send email to
> > > > watir-general-unsubscr...@googlegroups.com
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/watir-general-Hide quoted text -
>
> > > - Show quoted text -
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Watir General" group.
> > To post to this group, send email to watir-general@googlegroups.com
> > Before posting, please read the following guidelines:
> >http://wiki.openqa.org/display/WTR/Support
> > To unsubscribe from this group, send email to
> > watir-general-unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/watir-general

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: Click on Image button inside frames not working

2009-12-04 Thread orde
http://wtr.rubyforge.org/rdoc/classes/Watir/Container.html doesn't
specify which method is appropriate for .

I'd try button first: $ie.frame(:name,"Main").frame(:name,"Top").button
(:name,"imgRun").click

Hope that helps.

orde

On Dec 4, 12:27 pm, mohe  wrote:
> Ok..Input type =image here,.
> code is given below.
> 
> p>STARS
>
> On Dec 4, 2:18 pm, orde  wrote:
>
> > Can you post the exact tag for this psuedo code:
>
> >  {This is is the image i need to click on}
>
> > To click an  tag, you'd use the button method; to
> > click , you'd use the checkbox method.
>
> > I don't know the type attribute for  , but that will
> > point to the correct method (in theory).
>
> > orde
>
> > On Dec 4, 12:01 pm, mohe  wrote:
>
> > > the below code is not working.
> > > $ie.input(:type,"image").click
>
> > > On Dec 4, 1:44 pm, orde  wrote:
>
> > > > Looks like you're clicking on a  tag.  The type attribute for
> > > > the  tag should point you in the right direction.
>
> > > > Hope that helps.
>
> > > > orde
>
> > > > On Dec 4, 11:23 am, mohe  wrote:
>
> > > > > Yep .i am using developer tool bar..
> > > > > it is showing structure given below.
> > > > > 
> > > > > frame set
> > > > >         
> > > > >      frame
> > > > >      frame
> > > > >         document
> > > > >            HTML
> > > > >              
> > > > >                 
> > > > >                   document
> > > > >                     
> > > > >                         
> > > > >                          > > > >                         
> > > > >                         {This is is the image i need 
> > > > > to click on}
>
> > > > > On Dec 4, 3:31 am, Željko Filipin 
> > > > > wrote:
>
> > > > > > On Thu, Dec 3, 2009 at 9:42 PM, mohe  
> > > > > > wrote:
> > > > > > > i tried following combinations ..nothing is working
>
> > > > > > Instead of trying combinations, you should inspect the code with a 
> > > > > > tool like
> > > > > > IE dev  toolbar or Firebug. Please let me know if you need help 
> > > > > > with that.
>
> > > > > > Željko
> > > > > > --
> > > > > > watir.com - community manager
> > > > > > watirpodcast.com - host- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: Click on Image button inside frames not working

2009-12-04 Thread orde
Can you post the exact tag for this psuedo code:

 {This is is the image i need to click on}

To click an  tag, you'd use the button method; to
click , you'd use the checkbox method.

I don't know the type attribute for  , but that will
point to the correct method (in theory).

orde



On Dec 4, 12:01 pm, mohe  wrote:
> the below code is not working.
> $ie.input(:type,"image").click
>
> On Dec 4, 1:44 pm, orde  wrote:
>
> > Looks like you're clicking on a  tag.  The type attribute for
> > the  tag should point you in the right direction.
>
> > Hope that helps.
>
> > orde
>
> > On Dec 4, 11:23 am, mohe  wrote:
>
> > > Yep .i am using developer tool bar..
> > > it is showing structure given below.
> > > 
> > > frame set
> > >         
> > >      frame
> > >      frame
> > >         document
> > >            HTML
> > >              
> > >                 
> > >                   document
> > >                     
> > >                         
> > >                          > >                         
> > >                         {This is is the image i need to 
> > > click on}
>
> > > On Dec 4, 3:31 am, Željko Filipin 
> > > wrote:
>
> > > > On Thu, Dec 3, 2009 at 9:42 PM, mohe  wrote:
> > > > > i tried following combinations ..nothing is working
>
> > > > Instead of trying combinations, you should inspect the code with a tool 
> > > > like
> > > > IE dev  toolbar or Firebug. Please let me know if you need help with 
> > > > that.
>
> > > > Željko
> > > > --
> > > > watir.com - community manager
> > > > watirpodcast.com - host- Hide quoted text -
>
> > - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: Click on Image button inside frames not working

2009-12-04 Thread orde
Looks like you're clicking on a  tag.  The type attribute for
the  tag should point you in the right direction.

Hope that helps.

orde

On Dec 4, 11:23 am, mohe  wrote:
> Yep .i am using developer tool bar..
> it is showing structure given below.
> 
> frame set
>         
>      frame
>      frame
>         document
>            HTML
>              
>                 
>                   document
>                     
>                         
>                                                  
>                         {This is is the image i need to 
> click on}
>
> On Dec 4, 3:31 am, Željko Filipin 
> wrote:
>
> > On Thu, Dec 3, 2009 at 9:42 PM, mohe  wrote:
> > > i tried following combinations ..nothing is working
>
> > Instead of trying combinations, you should inspect the code with a tool like
> > IE dev  toolbar or Firebug. Please let me know if you need help with that.
>
> > Željko
> > --
> > watir.com - community manager
> > watirpodcast.com - host

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: Cannot click span element (JAVASCRIPT CALENDAR)

2009-12-04 Thread orde
Can you talk directly with the app developer(s) and explain what
you're trying to do?  That's probably the quickest route to a
solution.

orde

On Dec 4, 11:18 am, juanmaflyer  wrote:
> Hi Tiffany! Thanks for the welcome :)
>
> It's my first time I read that method (fire_event), is very
> interesting... I really can see neither with google chrome (google
> chrome inspector) nor with ie7.0 (ie developer toolbar) nor with
> firefox (firebug)  any event associated with the span tags. I try to
> use onclick event but it doesn't work. I really don't want to bother
> you but could someone help me and see for me if is there any event
> associated?
>
> I also want to ask you why ie developer toolbar show me an extra
> attribute in the span tags, and firefox and google chrome
> doesn't...The attribute name is
>
> jquery123123123 (this number change in each span element) and the
> value is an integer...
>
> Thanks a lot.
>
> On Dec 4, 2:31 pm, Tiffany Fodor  wrote:
>
> > Hi Juan!
>
> > Welcome to Watir General!
>
> > Is there a javascript event associated with the calendar?  If so, you
> > may need to fire the event to get the selected value to stick.
> > Assuming it's associated with your 'a' object and the javascript event
> > is named 'on_select':
>
> > a.fire_event('on_select')
>
> > Hope this helps!
>
> > -Tiffany
>
> > On Dec 4, 10:13 am, juanmaflyer  wrote:
>
> > > Hi people! It's my first post here so let me knoe if I screwed it up
> > > (is screw a regular or irregular verb?)
>
> > > I will go directly to the grain:
>
> > > I'm automating some things in this websitehttp://uat.viajo.com.br/
>
> > > I'm trying to click a date in the calendar, the one that says 'Data de
> > > ida'. Ok, I can open the calendar perfectly and I also can move around
> > > the months, but when i want to click some specific day in order to
> > > select the 'Departure Date' watir seems to fail. It click it but the
> > > date is not written in the text-field (as it should be).
> > > I have try to acces the span elements in different ways but none of
> > > these ways helped me.
>
> > > Strange data: I try to print the span element and also i have flash it
> > > and this worked perfectly... the problem seems to be only when watir
> > > try to click that span element.
>
> > > Here is my code so far:
>
> > > require 'watir'
>
> > > ##open website
> > > ie = Watir::IE.start("http://uat.viajo.com.br/";)
>
> > > #click and open 'Data de ida' calendar
> > > ie.div(:class=>'mainSprite buttonCalendarOn calendarImage').click
>
> > > #select some specific day to set 'departure date'
> > > a = ie.div(:class, /lastMonth/).div(:class, "daysGrid").span(:class =>
> > > 'selectable', :text => '12')
>
> > > # this works well
> > > a.flash
>
> > > # this also works well
> > > puts a
>
> > > # this doesn't work well! the calendar window is closed after
> > > executing this line, but the date selected isn't written in the text-
> > > field
> > > a.click

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: Trying to save an image

2009-11-30 Thread orde
I think the argument of the save method should be enclosed in double-
quotes:

browser.image(:index,1).save("c:\\test\\image.jpg")

Hope that helps.

orde

On Nov 30, 2:15 pm, xguarder  wrote:
> Hello, I am trying to save an image using the following:
>
> $ie.image(:index,1).save(c:\\test\\image.jpg)
>
> The image does get saved. However, I get the following (in irb)...
>
> WIN32OLERuntimeError: GoBack
>     OLE error code:80004005 in 
>       
>     HRESULT error code:0x80020009
>       Exception occurred.
>         from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ie-
> class.rb:36
> 2:in `method_missing'
>         from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ie-
> class.rb:36
> 2:in `back'
>         from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/
> image.rb:119:i
> n `save'
>         from (irb):8
>
> Any suggestions as to how to work around this? When running the above
> method in my script, it causes the whole script to abort after saving
> the image.
>
> Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: what watir method use with img tag?

2009-11-20 Thread orde

.image is the correct method.  You might find this page useful:
http://wtr.rubyforge.org/rdoc/classes/Watir/Container.html

Also, this (very useful) page summarizes the methods supported by
element:

http://wiki.openqa.org/display/WTR/Watir+Methods+Supported+by+HTML+Element

Hope that helps.

orde

On Nov 20, 7:49 am, Rodrigo  wrote:
> Hi everybody,
>
> I'm having some issues working with img tags. I've tried some methods
> like ie.button, ie.image, ie.click but no one of them works when
> running the watir script.
>
> This is the html I have:
> 
>
> What method can I use for clicking or getting the Manage account
> option.
>
> Thanks a lor!
> Rodrigo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Calling def cases into a Class

2009-11-13 Thread orde

Also, check out http://www.ruby-doc.org/core/classes/Test/Unit.html.

Hope it helps.

On Nov 13, 3:10 pm, Tiffany Fodor  wrote:
> Also, you'll need to require the test file (with a relative path, if
> it's not in the same directory):
>
> require 'test'
>
> In case it helps, I've posted an example of a simple Test::Unit
> framework on the examples page.
>
> http://tinyurl.com/yjrrj5a
>
> -Tiffany
>
> On Nov 13, 4:03 pm, Ethan  wrote:
>
> > The method in the Test::Unit::TestCase subclass needs to start with 'test',
> > which 'my_TestCase' does not.
>
> > On Fri, Nov 13, 2009 at 16:45, tester86  wrote:
>
> > > I have one file called test.rb which contains:
>
> > > require 'Watir'
>
> > > def test_text_verfication
>
> > >         ie=Watir::IE.start("go to url")
>
> > >         sleep 5
>
> > >         if ie.text.include? "User Login"
>
> > >                puts " at login page"
>
> > >                else
>
> > >                puts " not at login page"
>
> > >          end
>
> > >        end
>
> > > The Main file where I want to call that def (test case) and execute it
> > > via command line in dos prompt:
>
> > > file name: testfile.rb
>
> > > require 'test/unit'
> > > require 'watir'
> > > require 'watir/testcase'
>
> > > class MyTest < Test::Unit::TestCase
>
> > >        def my_TestCase()
> > >                test_text_verfication()
> > >        end
>
> > > end
>
> > > When I run my test case I get the following output:
>
> > > default_test(MyTest) [final.rb:18]:
> > > No tests were specified.
>
> > > 1 tests, 1 assertions, 1 failures, 0 errors
>
> > > My question is if I have a sepearte file that contains all the def
> > > test cases in class how do I call the def test cases?
>
> > > Thanks,
>
> > > tester86
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



  1   2   >