Re: [Wtr-general] how click on image with div class id

2007-04-30 Thread Željko Filipin

Please post HTML of the image.

In the meantime, try this.

ie.image(:id, research).click

Zeljko
--
ZeljkoFilipin.com
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] how to click on a image with this HTML code

2007-04-30 Thread Željko Filipin

On 4/30/07, SHALINI GUPTA [EMAIL PROTECTED] wrote:


div id=research



Hi Shalini,

You can not click that tag with ie.image because it is a div, not an image.

Try this instead.

ie.div(:id,research).click

Zeljko
--
ZeljkoFilipin.com
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Why ie.span(:name,..).click no use?

2007-04-30 Thread Željko Filipin

On 4/29/07, shqy [EMAIL PROTECTED] wrote:


Concatenate and print out the contents of all emails in your inbox.



Hi shqy,

When you log in, use this code to get some information about messages in
inbox

ie.frame(:name, main).frame(:id, v1).table(:id, tb)[1][3].text # from
ie.frame(:name, main).frame(:id, v1).table(:id, tb)[1][5].text #
subject and beginning of body
ie.frame(:name, main).frame(:id, v1).table(:id, tb)[1][7].text # sent
time

Zeljko
--
ZeljkoFilipin.com
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Watir - Scrpting issues with Dynamic HTML

2007-04-30 Thread Paul Rogers
we cant help at all without seeing the html you are trying to access.
If its truly dynamic html then you wont see it in view source, you will however 
see it if you do

ie.html in irb


- Original Message -
From: Anna [EMAIL PROTECTED]
Date: Monday, April 30, 2007 9:14 am
Subject: [Wtr-general] Watir - Scrpting issues with Dynamic HTML

 Helo,
 
   I am having an issue to click on the drop down menu from DHTML 
 Menu. Please can you provide some help.
 
 This is what i am doing --
 Steps
 
 1) Open the Url with link.
 2) pass the login info
 3) From home selected the  Self dynamic Html Menu - it is 
 clicking correctly with the following code - this is an example 
 website   ie.link(:text,/Self/).fireEvent(onMouseOver)
   Self has 2 drop down menu items.
  Self line by customer
  Self line by Admin 
 4) Issue when i try to click on Self line by customer or  Self 
 line by Admin
 
  ie.Link(:text, /Self line by 
 customer/).fire_event(onmouseover) 
 
 Recieved this error
 
 Watir::Exception::UnknownObjectException: Unable to locate object, 
 using text and (?-mix:Self line by customer)
c:/ruby/lib/ruby/gems/1.8/gems/watir-
 1.5.1.1164/./watir.rb:2414:in `assert_exists'
c:/ruby/lib/ruby/gems/1.8/gems/watir-
 1.5.1.1164/./watir.rb:2643:in `enabled?'
c:/ruby/lib/ruby/gems/1.8/gems/watir-
 1.5.1.1164/./watir.rb:2418:in `assert_enabled'
c:/ruby/lib/ruby/gems/1.8/gems/watir-
 1.5.1.1164/./watir.rb:2613:in `fireEvent'
Portal.rb:24:in `test_recorded'
 
 and also tried 
 
 ie.div(:id, Life Event Enrollment).fire_event(onmouseover) 
 
 recieing the same rror.
 
 Please can you help me,
 
 Thanks,
 Anna
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
 
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Do AutoIt3 scripts also work in Firewatir?

2007-04-30 Thread Bret Pettichord
Angrez Singh wrote:
 AutoIt3 is not supported by FireWatir. This is done so as to make 
 Firewatir platform independent. Only 'alert' and 'confirm' javascript 
 pop ups are supported as of now. We are looking into the 
 alternatives/solutions were we can support other dialogs like Save 
 File etc
Of course, any user can choose to use AutoIt3 with Firefox. It will work 
(on windows).

Bret
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Watir - Scrpting issues with Dynamic HTML

2007-04-30 Thread Paul Rogers
not really,

I dont want to have to go through all the stuff on your web site.

I'm happy to try and help, but I need to see the HTML you are trying to access, 
the code you are using, and any exceptions that occur

Paul

- Original Message -
From: Anna [EMAIL PROTECTED]
Date: Monday, April 30, 2007 11:18 am
Subject: Re: [Wtr-general] Watir - Scrpting issues with Dynamic HTML

 paul,
 
 Example website is -- www.ceridian.com
 From there we have DHTML menus available. you can pick any menu 
 items. i hope this helps to direct me.
 
 Thanks,
 
 Anna
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
 
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Watir - Scrpting issues with Dynamic HTML

2007-04-30 Thread Anna
Paul,

This is what watir recorder is returning when i record the menu item News menu. 
 

ie.goto('http://www.ceridian.com/corp/nav/1,2869,10923,00.html') --   when i 
playback. it is directly opening the page from the url. 


but i need to click on the menu item and open through the menu. ( how the real 
user does). 
   

This is what i used to click 

ie.Link(:text, /News/).fire_event(onmouseover) 

Recieved this error

Watir::Exception::UnknownObjectException: Unable to locate object, 
using text and (?-mix:Self line by customer)
c:/ruby/lib/ruby/gems/1.8/gems/watir-
1.5.1.1164/./watir.rb:2414:in `assert_exists'
c:/ruby/lib/ruby/gems/1.8/gems/watir-
1.5.1.1164/./watir.rb:2643:in `enabled?'
c:/ruby/lib/ruby/gems/1.8/gems/watir-
1.5.1.1164/./watir.rb:2418:in `assert_enabled'
c:/ruby/lib/ruby/gems/1.8/gems/watir-
1.5.1.1164/./watir.rb:2613:in `fireEvent'
Portal.rb:24:in `test_recorded'


FYI -- Same issue i solved with Rtaional Robot Using Low level recording. Not 
always rely on this utility.

Please hep me.

Thanks,
anna
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Watir - Scrpting issues with Dynamic HTML

2007-04-30 Thread Charley Baker

The main dhtml menu is pretty straighforward using Watir 1.5.1:

require 'watir'
include Watir

ie = IE.start('http://www.ceridian.com/')
ie.table(:id, 'STM0_0__5___').fire_event('onmouseover')
ie.cell(:id, 'STM0_5__1___MTD').click

-Charley

On 4/30/07, Paul Rogers [EMAIL PROTECTED] wrote:


not really,

I dont want to have to go through all the stuff on your web site.

I'm happy to try and help, but I need to see the HTML you are trying to
access, the code you are using, and any exceptions that occur

Paul

- Original Message -
From: Anna [EMAIL PROTECTED]
Date: Monday, April 30, 2007 11:18 am
Subject: Re: [Wtr-general] Watir - Scrpting issues with Dynamic HTML

 paul,

 Example website is -- www.ceridian.com
 From there we have DHTML menus available. you can pick any menu
 items. i hope this helps to direct me.

 Thanks,

 Anna
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Why ie.span(:name,..).click no use?

2007-04-30 Thread shqy
OH,I solved the problem,thanks a lot!
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Cannot run example test case

2007-04-30 Thread Kui Zhang
Thanks Charley!  I download Watir from another link and installed it.  It is 
working now.

Kui
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Unable to locate object

2007-04-30 Thread Kui Zhang
Hello,

I just started to write a test script below.  When run the script, I always 
received  error message: C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in 
`assert_exists': Unable to locate object.  HTML source is attached.

What did I missing here?  Should I be able to use smokeId to identify the 
elements?  Please help.

Thanks!
Kui

require 'watir'

test_site = 'http://x'

ie = Watir::IE.new

ie.goto(test_site)

sleep(5)

ie.text_field(:label, Username).set(aa)
ie.text_field(:text, Password).set(bb)

ie.button(:smokeId, submit).click


Source:
input type=hidden name=1_1 id=1_1 
smokeId=__msgs__trtdnbsp;/tdtd align=rightspan 
class=login-input-labelUsername/span/tdtd align=leftinput 
type=text name=1_2 id=1_2 smokeId=username label=Username value= 
onChange=if (EventHandlers.valueChanged(this)==false) return false; 
onKeyDown=DHTML.cancelBubbleIfNoAltKeyOrEnter(); contenteditable=true 
delayOnChange=false class=txt style=text-align: left size=20 
helpText=__UseTitle__ onfocus=EventHandlers.onFocus() 
onblur=EventHandlers.onBlur()/td/tr
trtdnbsp;/tdtd align=rightspan 
class=login-input-labelPassword/span/tdtd align=leftinput value= 
type=password class=txt smokeId=password id=1_3 helpText=__UseTitle__ 
delayOnChange=false label=Password onfocus=EventHandlers.onFocus() 
onChange=if (EventHandlers.valueChanged(this)==false) return false; size=20 
name=1_3 onblur=EventHandlers.onBlur()/td/tr
trtd colspan=2nbsp;/tdtdbutton smokeId=submit 
onclick=Events.invokeEvent('1_4_act', true) class=login-button 
onrecordclick=Recorder.recordLogin() isDefault=trueLogin/button/td/tr
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Watir - Scrpting issues with Dynamic HTML

2007-04-30 Thread annapurna
Charley,

 where did you captured this info. 'STM0_0__5___ 

can you explain to how to do it.

thanks,
anna
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Watir - Scrpting issues with Dynamic HTML

2007-04-30 Thread Charley Baker

This is the id I got off of that control in your menus using ie developer
toolbar:

http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038displaylang=en

Watir works off of how and what. How would you like to access a dom element?
What can you use to identify it?

ie.div(:how, 'what').click

In this case the how is :id and the what is the string. Clicked on the menu
and refreshed the toolbar, find element by click and clicked on the open
menu item.

We should probably add examples like this to the User Guide.

-Charley

On 4/30/07, annapurna [EMAIL PROTECTED] wrote:


Charley,

where did you captured this info. 'STM0_0__5___

can you explain to how to do it.

thanks,
anna
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Unable to locate object

2007-04-30 Thread Charley Baker

smokeid means nothing in standard dom. You can use :text to identify the
control. Watir works off of standard html attributes and the DOM, this is
some sort of custom attribute. This should work.

ie.button(:text, 'Login').click

-Charley

On 4/30/07, Kui Zhang [EMAIL PROTECTED] wrote:


Hello,

I just started to write a test script below.  When run the script, I
always received  error message:
C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists': Unable to
locate object.  HTML source is attached.

What did I missing here?  Should I be able to use smokeId to identify the
elements?  Please help.

Thanks!
Kui

require 'watir'

test_site = 'http://x'

ie = Watir::IE.new

ie.goto(test_site)

sleep(5)

ie.text_field(:label, Username).set(aa)
ie.text_field(:text, Password).set(bb)

ie.button(:smokeId, submit).click


Source:
input type=hidden name=1_1 id=1_1
smokeId=__msgs__trtdnbsp;/tdtd align=rightspan
class=login-input-labelUsername/span/tdtd align=leftinput
type=text name=1_2 id=1_2 smokeId=username label=Username value=
onChange=if (EventHandlers.valueChanged(this)==false) return false;
onKeyDown=DHTML.cancelBubbleIfNoAltKeyOrEnter(); contenteditable=true
delayOnChange=false class=txt style=text-align: left size=20
helpText=__UseTitle__ onfocus=EventHandlers.onFocus() onblur=
EventHandlers.onBlur()/td/tr
trtdnbsp;/tdtd align=rightspan
class=login-input-labelPassword/span/tdtd align=leftinput
value= type=password class=txt smokeId=password id=1_3
helpText=__UseTitle__ delayOnChange=false label=Password onfocus=
EventHandlers.onFocus() onChange=if (EventHandlers.valueChanged(this)==false)
return false; size=20 name=1_3 onblur=EventHandlers.onBlur
()/td/tr
trtd colspan=2nbsp;/tdtdbutton smokeId=submit onclick=
Events.invokeEvent('1_4_act', true) class=login-button onrecordclick=
Recorder.recordLogin() isDefault=trueLogin/button/td/tr
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Watir - Scrpting issues with Dynamic HTML

2007-04-30 Thread annapurna
Thank you very much. i dd downloaded the IE-toolbar. just now i will run and 
see.

Anna
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Unable to locate object

2007-04-30 Thread Kui Zhang
Thanks Charley for the quick response!
I tried with your suggestion (ie.button(:text, “Login”).click) and still 
received the same error message.

Here is DOM for the login button.  I also tried with the ie.form(:name, 
“mainForm”).button(:text, “Login”).click.  Not working.  Anything I can try?

Really appreciate your help!
Kui 

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//ENMETA 
http-equiv=Content-Type content=text/html; charset=utf-8
 
HTMLBODY leftMargin=0 topMargin=0 marginwidth=0 marginheight=0 
SogouAutoLinkDocFORM name=mainForm 
action=http://benicia.guidewire.com:10402/cc402/ClaimCenter.do; 
method=postTABLE id=mainTable height=100% cellSpacing=0 
cellPadding=0 width=100% border=0TBODYTRTD id=topDivision 
vAlign=top width=100% height=100%DIV style=HEIGHT: 100%DIV 
style=Z-INDEX: 10; LEFT: 0px; POSITION: absolute; TOP: 36pxTABLE 
cellSpacing=0 cellPadding=0 width=100%TBODYTRTDTABLE 
class=login-table cellSpacing=0 cellPadding=0 width=600 
align=centerTBODYTRTD class=login-content-gray vAlign=top 
align=left width=460 height=117TABLE cellSpacing=0 cellPadding=2 
border=0TBODYTRTD
 
BUTTON class=login-button onclick=Events.invokeEvent('1_4_act', true) 
smokeId=submit isDefault=true 
onrecordclick=Recorder.recordLogin()Login/BUTTON
 
/TD/TR/TBODY/TABLE/TD/TR/TBODY/TABLE/TD/TR/TBODY/TABLE/DIV/DIV/TD/TR/TBODY/TABLE/FORM/BODY/HTML
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Watir - Scrpting issues with Dynamic HTML

2007-04-30 Thread annapurna
Thank you very much Charley for you rhelp. This helps us a lot.

Anna
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Unable to locate object

2007-04-30 Thread Charley Baker

Install the latest gem for Watir 1.5.1 and try it again if you can . Here's
a link for how to do just that:
http://wiki.openqa.org/display/WTR/Development+Builds

Follow the instructions on the right pane To Install.

-Charley

On 4/30/07, Kui Zhang [EMAIL PROTECTED] wrote:


Thanks Charley for the quick response!
I tried with your suggestion (ie.button(:text, �Login�).click) and still
received the same error message.

Here is DOM for the login button.  I also tried with the ie.form(:name,
�mainForm�).button(:text, �Login�).click.  Not working.  Anything I can try?

Really appreciate your help!
Kui

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//ENMETA
http-equiv=Content-Type content=text/html; charset=utf-8

HTMLBODY leftMargin=0 topMargin=0 marginwidth=0 marginheight=0
SogouAutoLinkDocFORM name=mainForm action=
http://benicia.guidewire.com:10402/cc402/ClaimCenter.do;
method=postTABLE id=mainTable height=100% cellSpacing=0
cellPadding=0 width=100% border=0TBODYTRTD id=topDivision
vAlign=top width=100% height=100%DIV style=HEIGHT: 100%DIV
style=Z-INDEX: 10; LEFT: 0px; POSITION: absolute; TOP: 36pxTABLE
cellSpacing=0 cellPadding=0 width=100%TBODYTRTDTABLE
class=login-table cellSpacing=0 cellPadding=0 width=600
align=centerTBODYTRTD class=login-content-gray vAlign=top
align=left width=460 height=117TABLE cellSpacing=0 cellPadding=2
border=0TBODYTRTD

BUTTON class=login-button onclick=Events.invokeEvent('1_4_act', true)
smokeId=submit isDefault=true onrecordclick=Recorder.recordLogin
()Login/BUTTON


/TD/TR/TBODY/TABLE/TD/TR/TBODY/TABLE/TD/TR/TBODY/TABLE/DIV/DIV/TD/TR/TBODY/TABLE/FORM/BODY/HTML
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Unable to locate object

2007-04-30 Thread Charley Baker

Yep, we still include autoit.

-c

On 4/30/07, Kui Zhang [EMAIL PROTECTED] wrote:


Hi Charley,

Follow your instruction, installed the latest Watir gem.  It works now!

One question, if I installed the Watir gem, does this include autoit which
I need to use in the testing?  Or how to check if the autoit is installed
with Watir?

Thanks so much for your help.

Kui
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Unable to locate object

2007-04-30 Thread Kui Zhang
Hi Charley,

I installed latest gem, the test case ran fine.  Then, I restarted IntelliJ, 
now when run the test, IE browser is not open.  It is the same in the irb 
command line window.  

Is there something I need to change?

Thanks.
Kui
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] manipulating dos prompt with watir

2007-04-30 Thread Chris McMahon
Look up ruby system or exec commands.
Also consider connecting to the DB directly with ODBC or DBI.
-Chris

On 4/30/07, alan [EMAIL PROTECTED] wrote:
 In my watir script i would like to have it go to open a dos command window 
 and start sqlplus, then run a simple query to see if a member exists, the 
 flow would be something like:
 open cmd.exe
 log in as [EMAIL PROTECTED]
 pass the password somewhere around here
 do query select * from members where name = 'testername'
 if cmd contains(testername)
 puts 'yay'
 else
 puts 'drat'
 end

 is this easily done? so far after spending most of the day in google and 
 trying some different ideas I still have nothing. suggestions?
 i'm new to sql and watir, but since i did make watir send results to and 
 excel file I figure this must also be doable.
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] how to handle popup windows

2007-04-30 Thread SHALINI GUPTA

hi all,

i have a problem in my project.i have to handle a popup window.In my project
after clicking on 'Download ' button.it Opens a popup window named as:-
http://cfo-bat.ceb.com/Members/Popup/Download.aspx?cid=9563293-MicrosoftInternet
Explorer and then it automatically opens a File DIalog
window.which contains 'save' and 'cancel' button...

i tried this:without successs
def start_jsalert_clicker
   Thread.new{ system(ruby \c:\\wev2\\jscriptExtraAlert.rb\) }
 end

code is:-
$ie.div(:id,graphics).click()
   start_jsalert_clicker
$ie.image(:src,http://cfo-bat.ceb.com/Images/btn_browse_download.gif
).click
$ie.wait_for_browser

it generates these errors:-

NoMethodError: undefined method `wait_for_browser' for
#Watir::IE:0x2e150a8
   lo.rb:36:in `download'
   lo.rb:17:in `start'
   lo.rb:30:in `test_start_app'

i have two problems

first is...first window named :-'
http://cfo-bat.ceb.com/Members/Popup/Download.aspx?cid=9563293-MicrosoftInternet
Explorer' does not automatically open that File Dialog window when
i do this through script.but when i do this manually it opens that file
dialog window..

and second is:-how to click on 'save' and 'cancel' button..and how to
specify path

please help as soon as possible.
it very urgent

Thanks In advance

regards
Shalini Gupta
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general