Re: [Wtr-general] Why it is always failed?

2007-05-23 Thread Kui Zhang
Got it.  Thanks Zeljko!

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


Re: [Wtr-general] How to select option on Menu button with multiple levels of the option list

2007-05-22 Thread Kui Zhang
Hi Zeljko,

Yes.  it works.  I did not specify the correct frame that caused me a trouble.  
Works fine now.

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


[Wtr-general] Why it is always failed?

2007-05-22 Thread Kui Zhang
Hello,

I need to assert the text is displayed in the frame.  Using the following 
assert statement, I always get failed result. 

When I use selectFrame(inet-menu-tree-frame) in selenium, it works.  Not sure 
why it is not working in Watir?

Attached html code. Please help.


assert(ie.frame(:name, top_frame).frame(:name, 
inet-menu-tree-frame).contains_text(Welcome manager!))


!DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//ENMETA 
http-equiv=Content-Type content=text/html; charset=utf-8
 
HTML
HEADSTYLE 
/* No matching styles were found. */
 
/STYLE/HEAD
BODY style=BORDER-RIGHT: #99 1px solid; BORDER-TOP: #99 0px solid; 
BORDER-LEFT: #99 0px solid; BORDER-BOTTOM: #99 0px solid 
bottomMargin=0 bgColor=#dbe7ee leftMargin=0 topMargin=0 rightMargin=0 
SogouAutoLinkDocTABLE cellSpacing=0 cellPadding=0 width=100% 
border=0TBODYTRTD noWrap align=leftDIV style=FONT-SIZE: 
12pxFONT face=Arial color=#00

B 
FONT color=#ffWelcomenbsp;manager!/FONT
 
/B/FONT/DIV/TD/TR/TBODY/TABLE/BODY/HTML

*
assert(ie.frame(:name, top_frame).frame(:name, 
inet-menu-tree-frame).contains_text(Report Repository))


!DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//ENMETA 
http-equiv=Content-Type content=text/html; charset=utf-8
 
HTML
HEADSTYLE 
/* No matching styles were found. */
 
/STYLE/HEAD
BODY style=BORDER-RIGHT: #99 1px solid; BORDER-TOP: #99 0px solid; 
BORDER-LEFT: #99 0px solid; BORDER-BOTTOM: #99 0px solid 
bottomMargin=0 bgColor=#dbe7ee leftMargin=0 topMargin=0 rightMargin=0 
SogouAutoLinkDocDIV id=__inetsoft__/ style=VISIBILITY: visible; POSITION: 
absolute; TOP: 15pxTABLETBODYTRTD noWrapDIV style=FONT-SIZE: 12px
 
FONT face=Arial color=#00IMG height=16 
src=http://localhost:7070/sree/Examples?op=resourcename=%2finetsoft%2fsree%2fportal%2fportalimages%2ftreelist%2fdefault%2froot%2egif;
 width=16 align=textTop border=0 /nbsp;Report RepositoryBR //FONT
 
/DIV/TD/TR/TBODY/TABLE/DIV/BODY/HTML

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


[Wtr-general] How to select option on Menu button with multiple levels of the option list

2007-05-18 Thread Kui Zhang
Hello,

I need to select an option in the Menu button with multiple levels of the 
option list.

1. Click on the menu button, a list of option is displayed
2. Move mouse over to the option 3, a list of option is displayed for option 3
3. Select the option 3.2

I tried with “span(:id, “xxx”).click”.  It works on step 1, but not for step 2 
and 3.   What method should I use to select an option in step 2 and 3?   Please 
help!

Html for the option I want to select in step 2:
SPAN class=menu_item_link_menubutton 
id=Claim:ClaimMenuActions:ClaimMenuActions_NewDocument hideFocus 
onclick=Recorder.click(this);null;void(0);MenuImpl_hideAllMenus();;event.cancelBubble=true
 smokeId=ClaimMenuActions_NewDocumentNUe/Uw Document/SPAN


Html for the option I want to select in step 3:
SPAN class=menu_item_link_menubutton 
id=Claim:ClaimMenuActions:ClaimMenuActions_NewDocument:ClaimNewDocumentMenuItemSet:ClaimNewDocumentMenuItemSet_Link
 hideFocus style=TEXT-DECORATION: underline 
onclick=Recorder.click(this);MenuImpl_hideAllMenus();;Events.invokeEvent('Claim:ClaimMenuActions:ClaimMenuActions_NewDocument:ClaimNewDocumentMenuItemSet:ClaimNewDocumentMenuItemSet_Link_act',
 true);event.cancelBubble=true 
smokeId=ClaimNewDocumentMenuItemSet_LinkUL/Uink an existing document to 
this claim/SPAN

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


[Wtr-general] The test case should be failed, bu t it is not

2007-05-15 Thread Kui Zhang
Hello,

I have a question for the test case below.  When the Notepad window is not 
open, the test case run and complete without warning or error.  Looks like 
autoit statements do not provide warning and assert is passed.  

I thought if the Notepad is not open, autoit statements should provide warning 
and assert should fail.

Can you please confirm?  If it should be failed, why it is not…

Thanks!
Kui


def test_file_Exists
goto_page
….

autoit = WIN32OLE.new('AutoItX3.Control')

autoit.WinWait(test.txt - Notepad, nil, 5)
autoit.WinActive(test.txt - Notepad)
assert(autoit.WinExists(test.txt - Notepad))
puts (Window exist)
autoit.WinKill(test.txt - Notepad)

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


Re: [Wtr-general] Handling popup message

2007-05-14 Thread Kui Zhang
Thanks Mark!  After correcting the misspelled word, the script works now.
Kui
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] WIN32OLERuntimeError

2007-05-07 Thread Kui Zhang
Hello,

I have a test case below:

1. Open IE browser window, change the language setting using autoit.  Then, 
close the window.
2. Open a web page in IE to do a sample testing.  Then, close IE window.
3. Open IE browser window, reset the language setting using autoit.  Then, 
close the window.

The code for step 1 is:
ie = Watir::IE.new
autoit = WIN32OLE.new('AutoItX3.Control')

autoit.WinWaitActive(Blank Page - Windows Internet Explorer provided by 
Yahoo!)
autoit.Send (!to)   #sends Alt T (Tools) and O (options) to open Internet 
Options
autoit.WinWaitActive(Internet Options)
autoit.Send (!l)
autoit.Send (!a)
…

When running the script for step 1 and 2, the setps get completed fine.  

But, at step 3, received error message and IE browser is not open: 
C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1570:in 
`initialize': failed to create WIN32OLE object from 
`InternetExplorer.Application' (WIN32OLERuntimeError)
HRESULT error code:0x80004002
  No such interface supported   from 
C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1570:in `new'
from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1570:in 
`create_browser_window'
from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1477:in 
`initialize'
from C:/depot/eng/bedrock/active/qa/all/cc/qa/Ruby/test.rb:51:in `new'
from C:/depot/eng/bedrock/active/qa/all/cc/qa/Ruby/test.rb:51

Step3 is very similar to the step1. Why it is working in step 1, but not 
working in step 3?  Please help!
Thanks.
Kui
___
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] 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] 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