Re: [wtr-general] Re: Getting error (JsshSocket::JSReferenceError)
Hi Every one, Pls help me to solve this issue, I am unable to work with firefox browser. Thanks,Chethan --- On Mon, 26/7/10, chethan sarathy chethan2...@yahoo.co.in wrote: From: chethan sarathy chethan2...@yahoo.co.in Subject: Re: [wtr-general] Re: Getting error (JsshSocket::JSReferenceError) To: watir-general@googlegroups.com Date: Monday, 26 July, 2010, 2:40 PM Hi Currently I am getting following error following error, C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/jssh_socket.rb:12:in `js_eval': Components is not definedReferenceError: Components is not definedReferenceError: Components is not definedReferenceError: Components is not defined (JsshSocket::JSReferenceError) from C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/firefox.rb:195:in `goto' Pls help me out for solving this problem. Thanks, Chethan --- On Mon, 26/7/10, chethan sarathy chethan2...@yahoo.co.in wrote: From: chethan sarathy chethan2...@yahoo.co.in Subject: Re: [wtr-general] Re: Getting error (JsshSocket::JSReferenceError) To: watir-general@googlegroups.com Date: Monday, 26 July, 2010, 12:20 PM Hi, I have uninstalled installed a 3.6.2 version, Added new Jssh again for 3.6 version. Still I am getting the same error, More over telnet localhost 9997 request is not getting connected. Pls help me on this. Thanks, Chethan --- On Fri, 23/7/10, Tiffany Fodor tcfo...@comcast.net wrote: From: Tiffany Fodor tcfo...@comcast.net Subject: [wtr-general] Re: Getting error (JsshSocket::JSReferenceError) To: Watir General watir-general@googlegroups.com Date: Friday, 23 July, 2010, 9:01 PM Hi! I think Firefox 3.6.7 is a new build. Have you installed the new jssh extension for it? Hope this helps! -Tiffany On Jul 23, 5:54 am, Chethan chethan2...@gmail.com wrote: Hi Every one, I am trying to run my script in firefox, I am getting following error :/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ jssh_socket.rb:12:in `js_eval': Components is not defined (JsshSocket::JSReferenceError) from C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ firefox.rb:195:in `goto' from C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ firefox.rb:164:in `start' from C:/Ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.5/lib/watir/ browser.rb:71:in `start' Pls help me to solve this, I am executing this with window-XP- Firefox3.6.7 Thanks, Chethan -- 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 -- 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 -- 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 -- 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: UTF8 encode in FireWatir under Mac
Hi, Thanks Ethan... It works like a charm!! :) I need to do more test with Vapir to be sure that all tests work like with FireWatir. Just to be clear. I am wondering about the Vapir updates. Will you support it to have all such functionalities as Watir and FireWatir? Cause if all will go smoothly than I would think about moving to Vapir but would like to have clear view about the point that if new support or fix, implementation will be made for FireWatir will you try to merge it into Vapir project? Br, GS On Jul 26, 7:26 pm, Ethan notet...@gmail.com wrote: I've added a wiki page for this at:http://wiki.github.com/vapir/vapir/getting-started On Mon, Jul 26, 2010 at 05:46, gs grzegorz.q...@googlemail.com wrote: Hi Ethan, Could you provide me with script example how to user vapir? As I have installed it (vapir-common, vapir-firefox) and how to continue with it? Shall I start my script with: require 'firewatir' ff = FireWatir::Firefox.new ? Br, GS On Jul 24, 1:52 am, Ethan notet...@gmail.com wrote: This is fixed in Vapir-Firefox, an improved fork of firewatir - see the page for that project athttp://vapir.org/andits wiki athttp:// wiki.github.com/vapir/vapir/ On Fri, Jul 23, 2010 at 11:23, gs grzegorz.q...@googlemail.com wrote: Hi, I am using Firewatir under Mac I've faced an issue with clicking on link: ff.link(:text, Löschen).click Watir::Exception::UnknownObjectException: Unable to locate element, using :text, L\303\266schen Does any one has an idea why Löschen is being parsed by firewatir as L\303\266schen ? And any solution for such a problem? Br, GS -- 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.comwatir-general%2bunsubscr...@goog legroups.com watir-general%2bunsubscr...@goog 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.comwatir-general%2bunsubscr...@goog 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: UTF8 encode in FireWatir under Mac
Just noticed that Vapir is working very slownly under Mac...any possibilities to speed it up? Also I am using in my test startClicker (in FireWatir) it does not throw an exception so if it will not be found than it proceedes..but in Vapir..it throws an exception that modal was not found. Any advice of omitting this behavior? Sorry for so many questions :) Br, GS On Jul 27, 9:58 am, gs grzegorz.q...@googlemail.com wrote: Hi, Thanks Ethan... It works like a charm!! :) I need to do more test with Vapir to be sure that all tests work like with FireWatir. Just to be clear. I am wondering about the Vapir updates. Will you support it to have all such functionalities as Watir and FireWatir? Cause if all will go smoothly than I would think about moving to Vapir but would like to have clear view about the point that if new support or fix, implementation will be made for FireWatir will you try to merge it into Vapir project? Br, GS On Jul 26, 7:26 pm, Ethan notet...@gmail.com wrote: I've added a wiki page for this at:http://wiki.github.com/vapir/vapir/getting-started On Mon, Jul 26, 2010 at 05:46, gs grzegorz.q...@googlemail.com wrote: Hi Ethan, Could you provide me with script example how to user vapir? As I have installed it (vapir-common, vapir-firefox) and how to continue with it? Shall I start my script with: require 'firewatir' ff = FireWatir::Firefox.new ? Br, GS On Jul 24, 1:52 am, Ethan notet...@gmail.com wrote: This is fixed in Vapir-Firefox, an improved fork of firewatir - see the page for that project athttp://vapir.org/anditswiki athttp:// wiki.github.com/vapir/vapir/ On Fri, Jul 23, 2010 at 11:23, gs grzegorz.q...@googlemail.com wrote: Hi, I am using Firewatir under Mac I've faced an issue with clicking on link: ff.link(:text, Löschen).click Watir::Exception::UnknownObjectException: Unable to locate element, using :text, L\303\266schen Does any one has an idea why Löschen is being parsed by firewatir as L\303\266schen ? And any solution for such a problem? Br, GS -- 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.comwatir-general%2bunsubscr...@goog legroups.com watir-general%2bunsubscr...@goog 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.comwatir-general%2bunsubscr...@goog 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: cant get an element
Thanks for the replies. I posted the question on Stack Overflow and figured it out from there. my_span = @@ie.span(:id, dnn_ctr353_Main_ctl00_ctl00_ctl00_ctl07_Field_048b9dfa-bc64-42e4-8bd5- b45385e5f45b_view_value) my_p = my_span.p(:class, wpFieldValue) return my_p.text On Jul 20, 7:16 pm, George george.sand...@gmail.com wrote: It looks like it's wrapped in a p tag, which should be accessible via Watir: puts @browser.p(:class, wpFieldValue).text This has worked for me in the past. -George On Jul 15, 2:18 am, ryanthescot ryanthes...@hotmail.com wrote: span class=wpFieldViewContent id=dnn_ctr353_Main_ctl00_ctl00_ctl00_ctl07_Field_048b9dfa- bc64-42e4-8bd5-b45385e5f45b_view_value p class=wpFieldValue Bishop/p /span I am trying to get the value 'Bishop' from this HTML to use in an if statement, but I cant find a way of getting the element. Can someone advise how i might do so? -- 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
Re: [wtr-general] Re: Check out the Watir Stack Exchange site!
I was away for a few weeks snorkeling and brewing, but I see Watir community was busy. :) Our Stack Exchange site [1] just got 60th follower! (Thanks to our old friend MarekJ.) But why did not it move from define to commit phase?! (Like Selenium site [2] did some time ago?) The answer is in the top right hand corner of the front page: This proposal is in: Definition. The topic and audience are still being decided. It needs 0 followers, 5 on-topic questions, 5 off-topic questions to move to the next phase. We have 35 example questions, but for a question to count as on- or off-topic, it has to have at least 20 votes (if I got it right by looking other sites). What do you have to do? - go to http://bit.ly/watirse - take a look at the questions (35 of them, it would take you a few minutes) - vote if questions are on- or off-topic (you have 5 votes, so again just a few minutes) If you have the time, you can submit more questions (again up to 5). Thanks a lot to all of you who have contributed to the site. I think it is the best thing that could happen to Watir support. If you want more information, you can listen to a podcast [3] where Felipe and I talk about the site in detail for about an hour. Željko -- [1] http://bit.ly/watirse [2] http://area51.stackexchange.com/proposals/4693/selenium [3] http://watirpodcast.com/35-zeljko-filipin-on-watir-stack-exchange-site/ -- 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
http://stackoverflow.com/questions/3291956/if-i-start-a-new-should-i-start-with-watir-webdriver http://stackoverflow.com/questions/3277442/watir-can-i-tunnel-through-an-external-http-socks-proxy-over-firefox -- 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: new page has no focus
The closest thing I've come across is when a page isn't finished loading and IE or Firefox times out. It doesn't really sound like that's your problem though. You're right, that's not it. It's completely loaded and will just sit there patiently waiting until I click on it with the mouse. Then the automated script action starts again. Have you tried using AutoIt send_keys to send a tab to put the focus on an element? $ie.send_keys({TAB}) It didn't help. Since programming isn't my knack, I wanted to check if there was something that WATIR/Ruby could do to handle it. I can get the developers to put a default start point/focus into the app. It won't be the first time I pester them with my agenda....*THIS* I have a knack for. :o) Thanks Tiffany! Kim On Jul 26, 1:29 pm, KimBrown kimbro...@yahoo.com wrote: There are a couple of spots in my application where nothing happens. I think it's because a page with no defaulted active field (ie., blinking cursor). Can I get watir to activate these pages? I've searched in the archives and found a focus command: $ie.text_field(:id, 'name'').focus() but it doesn't do the trick. Only with me clicking on the webpage, will this command and any others that I try in my script continue to run. Until I click on the page nothing happens. Has anyone run into this? thanks, Kim- Hide quoted text - - Show quoted text - -- 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
Re: [wtr-general] facing issue with clicking buttons
Hi Raveendran, Thanks for the reply... I tried with the all the possibilities you provided.None of them are working. Getting error as Unable to locate element. Please let me know if any other options. Thanks, Praveen On Tue, Jul 27, 2010 at 11:09 AM, Raveendran P jazzezr...@gmail.com wrote: Hi Praveen, Have you tried these possibilities ? *canvas_frame.div(:class, 'J-Zh-I J-J5-Ji Bq L3').flash* * canvas_frame.div(:id, ': 15m ').flash canvas_frame.div(:id, ': 15m ').flash * On Fri, Jul 23, 2010 at 1:32 PM, praveen kumar praveen454gr...@gmail.comwrote: Hi John, I have tried with div, but unable to click on button. Following is the code: require 'watir' require 'test/unit' require 'win32ole' class TC_article_example Test::Unit::TestCase def test_data $ie = Watir::IE.new $ie.goto(http://mail.google.com/mail/?ui=html;) #Define the excel file excel= WIN32OLE::new(excel.Application) wrkbook=excel.Workbooks.Open(C:\\test.xls) wrksheet = wrkbook.worksheets(1) wrksheet.select #read the data from excel file rows = 2 $username=wrksheet.cells(rows,A) ['text'] #puts $field $password=wrksheet.cells(rows,B) ['text'] $ie.text_field(:name,Email).set($username) $ie.text_field(:id,Passwd).set($password) $ie.button(:id, 'signIn' ).click #browser.show_frames # We need the iframe with ID 'canvas_frame'. Store it in a var. #$ie.goto(http://mail.google.com/mail/?ui=html;) canvas_frame = $ie.frame(:id, 'canvas_frame') # Get the current user's email address. We'll be sending email to it. my_address = $username mail_subject = 'Hello Watir world!' mail_body_text = 'Hi.' canvas_frame.span(:text, 'Compose Mail').click # Compose new mail canvas_frame.text_field(:name, 'to').set(my_address) canvas_frame.text_field(:name, 'subject').set(mail_subject) mail_body_frame = canvas_frame.frame(:index, 1) mail_body_frame.document.body.setproperty('innerText', mail_body_text) #$ie.goto(http://mail.google.com/mail/?ui=html;) * canvas_frame.div(:text, 'Send').click# Send the message I am facing problem here to click on Send button. It has no attributes like type, value* #canvas_frame.link(:text, 'Sent Mail').click # Browse to sent mail page #assert(canvas_frame.contains_text('Hello Watir world!')) #canvas_frame.link(:text, 'Inbox').click # Return to the inbox page $ie.link(:href,'https://mail.google.com/mail/?logouthl=en').clickhttps://mail.google.com/mail/?logouthl=en%27%29.click $ie.close #rows=rows+1 end end I have also tried with the attribute id, but that is also not working. Please help me and let me know if require any details. Praveen On Thu, Jul 22, 2010 at 10:23 PM, John Fitisoff jfitis...@yahoo.comwrote: Try treating it as a div rather than a button? -- *From:* praveen kumar praveen454gr...@gmail.com *To:* watir-general@googlegroups.com *Sent:* Thu, July 22, 2010 5:42:59 AM *Subject:* [wtr-general] facing issue with clicking buttons Hi All, I am trying to automate the gmail by clicking on the compose mail and entering to address , subject and body content. I am facing problem in clicking the Send button. The button has following HTML elements *div tabindex=1 class=J-Zh-I J-J5-Ji Bq L3 id=:15m role=button style=-moz-user-select: none;bSend/b/div * I have tried with following script *canvas_frame.button(:text, 'Send').click * canvas_frame is the variable in which the frame is stored. I am confusing because there is no type attribute. It has role attribute i.e role=button. Please help me in going forward... Thanks, Praveen -- 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.comwatir-general%2bunsubscr...@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.comwatir-general%2bunsubscr...@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.comwatir-general%2bunsubscr...@googlegroups.com -- Regards, P.Raveendran http://raveendran.wordpress.com -- Before posting, please read http://watir.com/support. In short: search before you
[wtr-general] Re: How can I fill in a form with username and password ?
Got it solved, just use ie.text_field( :id, username ).set some user name Thanks everyone for reading this thread ;) -- 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] How to access element in a table ?
down vote favorite Hi everyone, I'm current writing a test script for our MLS( Multiple Listing System ) systems. The website is mainly written in C# .NET. Here is the screenshot that I got: http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif And this is the HTML source: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//ENMETA http- equiv=Content-Type content=text/html; charset=utf-8 HTML sizcache=33 sizset=1BODY style=POSITION: relative ! important; OVERFLOW-X: hidden scroll=no xmlns:ignav=http:// schemas.infragistics.com/ASPNET/WebControls/WebMenu sizcache=33 sizset=1FORM id=Form1 method=post name=Form1 action=Menu.aspx?hidMLS=SDNA sizcache=33 sizset=1DIV id=divControlPanel class=ControlPanel sizcache=33 sizset=1DIV id=divMenu class=Menu sizcache=33 sizset=1DIV id=divNavigation class=Navigation sizcache=33 sizset=1DIV id=divNavContainer class=MenuWrapper TABLE style=BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER- BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; CURSOR: default id=uwmMainMenu_MainM onmouseup=javascript:igmenu_mouseup(this, event); onselectstart=javascript:igmenu_selectStart(); class=WebMenu onmouseover=javascript:igmenu_mouseover(this, event); onmouseout=javascript:igmenu_mouseout(this, event); onmousedown=javascript:igmenu_mousedown(this, event); border=0 cellSpacing=1 cellPadding=2 igLevel=0 submenu=1 TBODY TR TD accessKey=S onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_1 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_1M igHov=IGMenuItemHover igTag=1 igClass=IGMenuItem US/Uearches /TD TD accessKey=L onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_2 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_2M igHov=IGMenuItemHover igTag=2 igClass=IGMenuItem UL/Uistings /TD TD accessKey=T onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_3 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=26 igFrame=_Script igUrl=menuOneLevelItemClick('http://realist2.firstamres.com/ propertylink? UserID=rapstaffAgentLastName=StaffAgentFirstName=RapattoniCustomerGroupName=Sedona Verde ValleyUserPW=sedona','_Realist') igClass=IGMenuItem UT/Uax /TD TD accessKey=R onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_4 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=3 igFrame=_Script igUrl=Cart_OnClick() igClass=IGMenuItem CaUr/Ut /TD TD accessKey=C onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_5 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_5M igHov=IGMenuItemHover igTag=4 igClass=IGMenuItem UC/Uontacts /TD TD accessKey=N onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_6 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_6M igHov=IGMenuItemHover igTag=5 igClass=IGMenuItem LiUn/Uks /TD TD accessKey=A onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_7 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_7M igHov=IGMenuItemHover igTag=6 igClass=IGMenuItem UA/Udmin /TD TD accessKey=H onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_8 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_8M igHov=IGMenuItemHover igTag=7 igClass=IGMenuItem UH/Uelp /TD /TR /TBODY /TABLE /DIV/DIV/DIV/DIV/FORM/BODY/HTML I tried to use TestWise Recorder on Firefox to see what actual element that I currently access, but FF does not recognize it. :( Anyone could give me a hint where I missed ? 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
Re: [wtr-general] How to access element in a table ?
Hi Chan You can try and use firebug to identify element http://getfirebug.com/downloads http://getfirebug.com/downloadsBasim On Tue, Jul 27, 2010 at 3:17 PM, Chan Nguyen atbl1...@gmail.com wrote: down vote favorite Hi everyone, I'm current writing a test script for our MLS( Multiple Listing System ) systems. The website is mainly written in C# .NET. Here is the screenshot that I got: http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif And this is the HTML source: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//ENMETA http- equiv=Content-Type content=text/html; charset=utf-8 HTML sizcache=33 sizset=1BODY style=POSITION: relative ! important; OVERFLOW-X: hidden scroll=no xmlns:ignav=http:// schemas.infragistics.com/ASPNET/WebControls/WebMenu sizcache=33 sizset=1FORM id=Form1 method=post name=Form1 action=Menu.aspx?hidMLS=SDNA sizcache=33 sizset=1DIV id=divControlPanel class=ControlPanel sizcache=33 sizset=1DIV id=divMenu class=Menu sizcache=33 sizset=1DIV id=divNavigation class=Navigation sizcache=33 sizset=1DIV id=divNavContainer class=MenuWrapper TABLE style=BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER- BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; CURSOR: default id=uwmMainMenu_MainM onmouseup=javascript:igmenu_mouseup(this, event); onselectstart=javascript:igmenu_selectStart(); class=WebMenu onmouseover=javascript:igmenu_mouseover(this, event); onmouseout=javascript:igmenu_mouseout(this, event); onmousedown=javascript:igmenu_mousedown(this, event); border=0 cellSpacing=1 cellPadding=2 igLevel=0 submenu=1 TBODY TR TD accessKey=S onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_1 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_1M igHov=IGMenuItemHover igTag=1 igClass=IGMenuItem US/Uearches /TD TD accessKey=L onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_2 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_2M igHov=IGMenuItemHover igTag=2 igClass=IGMenuItem UL/Uistings /TD TD accessKey=T onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_3 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=26 igFrame=_Script igUrl=menuOneLevelItemClick('http://realist2.firstamres.com/ propertylink? UserID=rapstaffAgentLastName=StaffAgentFirstName=RapattoniCustomerGroupName=Sedona Verde ValleyUserPW=sedona','_Realist') igClass=IGMenuItem UT/Uax /TD TD accessKey=R onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_4 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=3 igFrame=_Script igUrl=Cart_OnClick() igClass=IGMenuItem CaUr/Ut /TD TD accessKey=C onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_5 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_5M igHov=IGMenuItemHover igTag=4 igClass=IGMenuItem UC/Uontacts /TD TD accessKey=N onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_6 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_6M igHov=IGMenuItemHover igTag=5 igClass=IGMenuItem LiUn/Uks /TD TD accessKey=A onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_7 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_7M igHov=IGMenuItemHover igTag=6 igClass=IGMenuItem UA/Udmin /TD TD accessKey=H onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_8 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_8M igHov=IGMenuItemHover igTag=7 igClass=IGMenuItem UH/Uelp /TD /TR /TBODY /TABLE /DIV/DIV/DIV/DIV/FORM/BODY/HTML I tried to use TestWise Recorder on Firefox to see what actual element that I currently access, but FF does not recognize it. :( Anyone could give me a hint where I missed ? 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.comwatir-general%2bunsubscr...@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
Re: [wtr-general] How to access element in a table ?
Hi Basim, Thanks a lot for your quick response. I just found out that element is actually a table. I accessed to a particular table like this : my_table = ie.table( :id, uwmMainMenu_MainM ) Next, I need to access the each element of the first row of this table, but I got stuck at this point. Could you give me a minimal example to access table? Further, I don't know how to click an option in this list? http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif On Tue, Jul 27, 2010 at 12:59 PM, Basim Baassiri ba...@baassiri.ca wrote: Hi Chan You can try and use firebug to identify element http://getfirebug.com/downloads http://getfirebug.com/downloadsBasim On Tue, Jul 27, 2010 at 3:17 PM, Chan Nguyen atbl1...@gmail.com wrote: down vote favorite Hi everyone, I'm current writing a test script for our MLS( Multiple Listing System ) systems. The website is mainly written in C# .NET. Here is the screenshot that I got: http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif And this is the HTML source: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//ENMETA http- equiv=Content-Type content=text/html; charset=utf-8 HTML sizcache=33 sizset=1BODY style=POSITION: relative ! important; OVERFLOW-X: hidden scroll=no xmlns:ignav=http:// schemas.infragistics.com/ASPNET/WebControls/WebMenu sizcache=33 sizset=1FORM id=Form1 method=post name=Form1 action=Menu.aspx?hidMLS=SDNA sizcache=33 sizset=1DIV id=divControlPanel class=ControlPanel sizcache=33 sizset=1DIV id=divMenu class=Menu sizcache=33 sizset=1DIV id=divNavigation class=Navigation sizcache=33 sizset=1DIV id=divNavContainer class=MenuWrapper TABLE style=BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER- BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; CURSOR: default id=uwmMainMenu_MainM onmouseup=javascript:igmenu_mouseup(this, event); onselectstart=javascript:igmenu_selectStart(); class=WebMenu onmouseover=javascript:igmenu_mouseover(this, event); onmouseout=javascript:igmenu_mouseout(this, event); onmousedown=javascript:igmenu_mousedown(this, event); border=0 cellSpacing=1 cellPadding=2 igLevel=0 submenu=1 TBODY TR TD accessKey=S onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_1 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_1M igHov=IGMenuItemHover igTag=1 igClass=IGMenuItem US/Uearches /TD TD accessKey=L onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_2 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_2M igHov=IGMenuItemHover igTag=2 igClass=IGMenuItem UL/Uistings /TD TD accessKey=T onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_3 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=26 igFrame=_Script igUrl=menuOneLevelItemClick('http://realist2.firstamres.com/ propertylink? UserID=rapstaffAgentLastName=StaffAgentFirstName=RapattoniCustomerGroupName=Sedona Verde ValleyUserPW=sedona','_Realist') igClass=IGMenuItem UT/Uax /TD TD accessKey=R onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_4 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=3 igFrame=_Script igUrl=Cart_OnClick() igClass=IGMenuItem CaUr/Ut /TD TD accessKey=C onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_5 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_5M igHov=IGMenuItemHover igTag=4 igClass=IGMenuItem UC/Uontacts /TD TD accessKey=N onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_6 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_6M igHov=IGMenuItemHover igTag=5 igClass=IGMenuItem LiUn/Uks /TD TD accessKey=A onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_7 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_7M igHov=IGMenuItemHover igTag=6 igClass=IGMenuItem UA/Udmin /TD TD accessKey=H onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_8 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_8M igHov=IGMenuItemHover igTag=7 igClass=IGMenuItem UH/Uelp /TD /TR /TBODY /TABLE /DIV/DIV/DIV/DIV/FORM/BODY/HTML I tried to use TestWise Recorder on Firefox to see what actual element that I currently access, but FF does not recognize it. :( Anyone could give me a hint where I missed ? 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:
[wtr-general] Re: How to access element in a table ?
Hi! The Watir Cheat Sheet (http://wiki.openqa.org/display/WTR/Cheat+Sheet) has an example of working with table elements: td = browser.table(:name, 'recent_records')[2][1] td is now the cell at row 2, column 1 of your table. There's more information on the Table class in the Watir API reference: http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Table.html Hope this helps! -Tiffany On Jul 27, 2:04 pm, Chan Nguyen atbl1...@gmail.com wrote: Hi Basim, Thanks a lot for your quick response. I just found out that element is actually a table. I accessed to a particular table like this : my_table = ie.table( :id, uwmMainMenu_MainM ) Next, I need to access the each element of the first row of this table, but I got stuck at this point. Could you give me a minimal example to access table? Further, I don't know how to click an option in this list? http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif On Tue, Jul 27, 2010 at 12:59 PM, Basim Baassiri ba...@baassiri.ca wrote: Hi Chan You can try and use firebug to identify element http://getfirebug.com/downloads http://getfirebug.com/downloadsBasim On Tue, Jul 27, 2010 at 3:17 PM, Chan Nguyen atbl1...@gmail.com wrote: down vote favorite Hi everyone, I'm current writing a test script for our MLS( Multiple Listing System ) systems. The website is mainly written in C# .NET. Here is the screenshot that I got: http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif And this is the HTML source: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//ENMETA http- equiv=Content-Type content=text/html; charset=utf-8 HTML sizcache=33 sizset=1BODY style=POSITION: relative ! important; OVERFLOW-X: hidden scroll=no xmlns:ignav=http:// schemas.infragistics.com/ASPNET/WebControls/WebMenu sizcache=33 sizset=1FORM id=Form1 method=post name=Form1 action=Menu.aspx?hidMLS=SDNA sizcache=33 sizset=1DIV id=divControlPanel class=ControlPanel sizcache=33 sizset=1DIV id=divMenu class=Menu sizcache=33 sizset=1DIV id=divNavigation class=Navigation sizcache=33 sizset=1DIV id=divNavContainer class=MenuWrapper TABLE style=BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER- BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; CURSOR: default id=uwmMainMenu_MainM onmouseup=javascript:igmenu_mouseup(this, event); onselectstart=javascript:igmenu_selectStart(); class=WebMenu onmouseover=javascript:igmenu_mouseover(this, event); onmouseout=javascript:igmenu_mouseout(this, event); onmousedown=javascript:igmenu_mousedown(this, event); border=0 cellSpacing=1 cellPadding=2 igLevel=0 submenu=1 TBODY TR TD accessKey=S onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_1 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_1M igHov=IGMenuItemHover igTag=1 igClass=IGMenuItem US/Uearches /TD TD accessKey=L onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_2 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_2M igHov=IGMenuItemHover igTag=2 igClass=IGMenuItem UL/Uistings /TD TD accessKey=T onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_3 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=26 igFrame=_Script igUrl=menuOneLevelItemClick('http://realist2.firstamres.com/ propertylink? UserID=rapstaffAgentLastName=StaffAgentFirstName=RapattoniCustomerGroupName=Sedona Verde ValleyUserPW=sedona','_Realist') igClass=IGMenuItem UT/Uax /TD TD accessKey=R onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_4 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=3 igFrame=_Script igUrl=Cart_OnClick() igClass=IGMenuItem CaUr/Ut /TD TD accessKey=C onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_5 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_5M igHov=IGMenuItemHover igTag=4 igClass=IGMenuItem UC/Uontacts /TD TD accessKey=N onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_6 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_6M igHov=IGMenuItemHover igTag=5 igClass=IGMenuItem LiUn/Uks /TD TD accessKey=A onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_7 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_7M igHov=IGMenuItemHover igTag=6 igClass=IGMenuItem UA/Udmin /TD TD accessKey=H onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_8 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1
Re: [wtr-general] Re: How to access element in a table ?
Hello Tiffany, Thanks for your help. I actually did go through that example, but in that cell there are a list of options that I have to pick one: - Quick Search - Saved Search - Standard Search ...etc and there is no click option for a cell. I really struggle with this :( ! Can you give me some more hints? Thanks, On Tue, Jul 27, 2010 at 1:22 PM, Tiffany Fodor tcfo...@comcast.net wrote: Hi! The Watir Cheat Sheet (http://wiki.openqa.org/display/WTR/Cheat+Sheet) has an example of working with table elements: td = browser.table(:name, 'recent_records')[2][1] td is now the cell at row 2, column 1 of your table. There's more information on the Table class in the Watir API reference: http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Table.html Hope this helps! -Tiffany On Jul 27, 2:04 pm, Chan Nguyen atbl1...@gmail.com wrote: Hi Basim, Thanks a lot for your quick response. I just found out that element is actually a table. I accessed to a particular table like this : my_table = ie.table( :id, uwmMainMenu_MainM ) Next, I need to access the each element of the first row of this table, but I got stuck at this point. Could you give me a minimal example to access table? Further, I don't know how to click an option in this list? http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif On Tue, Jul 27, 2010 at 12:59 PM, Basim Baassiri ba...@baassiri.ca wrote: Hi Chan You can try and use firebug to identify element http://getfirebug.com/downloads http://getfirebug.com/downloadsBasim On Tue, Jul 27, 2010 at 3:17 PM, Chan Nguyen atbl1...@gmail.com wrote: down vote favorite Hi everyone, I'm current writing a test script for our MLS( Multiple Listing System ) systems. The website is mainly written in C# .NET. Here is the screenshot that I got: http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif And this is the HTML source: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//ENMETA http- equiv=Content-Type content=text/html; charset=utf-8 HTML sizcache=33 sizset=1BODY style=POSITION: relative ! important; OVERFLOW-X: hidden scroll=no xmlns:ignav=http:// schemas.infragistics.com/ASPNET/WebControls/WebMenu sizcache=33 sizset=1FORM id=Form1 method=post name=Form1 action=Menu.aspx?hidMLS=SDNA sizcache=33 sizset=1DIV id=divControlPanel class=ControlPanel sizcache=33 sizset=1DIV id=divMenu class=Menu sizcache=33 sizset=1DIV id=divNavigation class=Navigation sizcache=33 sizset=1DIV id=divNavContainer class=MenuWrapper TABLE style=BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER- BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; CURSOR: default id=uwmMainMenu_MainM onmouseup=javascript:igmenu_mouseup(this, event); onselectstart=javascript:igmenu_selectStart(); class=WebMenu onmouseover=javascript:igmenu_mouseover(this, event); onmouseout=javascript:igmenu_mouseout(this, event); onmousedown=javascript:igmenu_mousedown(this, event); border=0 cellSpacing=1 cellPadding=2 igLevel=0 submenu=1 TBODY TR TD accessKey=S onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_1 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_1M igHov=IGMenuItemHover igTag=1 igClass=IGMenuItem US/Uearches /TD TD accessKey=L onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_2 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_2M igHov=IGMenuItemHover igTag=2 igClass=IGMenuItem UL/Uistings /TD TD accessKey=T onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_3 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=26 igFrame=_Script igUrl=menuOneLevelItemClick('http://realist2.firstamres.com/ propertylink? UserID=rapstaffAgentLastName=StaffAgentFirstName=RapattoniCustomerGroupName=Sedona Verde ValleyUserPW=sedona','_Realist') igClass=IGMenuItem UT/Uax /TD TD accessKey=R onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_4 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=3 igFrame=_Script igUrl=Cart_OnClick() igClass=IGMenuItem CaUr/Ut /TD TD accessKey=C onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_5 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_5M igHov=IGMenuItemHover igTag=4 igClass=IGMenuItem UC/Uontacts /TD TD accessKey=N onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_6 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_6M igHov=IGMenuItemHover igTag=5
Re: [wtr-general] Re: How to access element in a table ?
Hi Chan You might need to use the fire_event method to trigger the javascript in the hover menu. browser.table(:id, uwmMainMenu_MainM).fire_event onmouseover td = browser.table(:id, uwmMainMenu_MainM')[2][1] td.fire_event onfocus # or td.fire_event onclick Basim On Tue, Jul 27, 2010 at 4:22 PM, Tiffany Fodor tcfo...@comcast.net wrote: Hi! The Watir Cheat Sheet (http://wiki.openqa.org/display/WTR/Cheat+Sheet) has an example of working with table elements: td = browser.table(:name, 'recent_records')[2][1] td is now the cell at row 2, column 1 of your table. There's more information on the Table class in the Watir API reference: http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Table.html Hope this helps! -Tiffany On Jul 27, 2:04 pm, Chan Nguyen atbl1...@gmail.com wrote: Hi Basim, Thanks a lot for your quick response. I just found out that element is actually a table. I accessed to a particular table like this : my_table = ie.table( :id, uwmMainMenu_MainM ) Next, I need to access the each element of the first row of this table, but I got stuck at this point. Could you give me a minimal example to access table? Further, I don't know how to click an option in this list? http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif On Tue, Jul 27, 2010 at 12:59 PM, Basim Baassiri ba...@baassiri.ca wrote: Hi Chan You can try and use firebug to identify element http://getfirebug.com/downloads http://getfirebug.com/downloadsBasim On Tue, Jul 27, 2010 at 3:17 PM, Chan Nguyen atbl1...@gmail.com wrote: down vote favorite Hi everyone, I'm current writing a test script for our MLS( Multiple Listing System ) systems. The website is mainly written in C# .NET. Here is the screenshot that I got: http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif And this is the HTML source: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//ENMETA http- equiv=Content-Type content=text/html; charset=utf-8 HTML sizcache=33 sizset=1BODY style=POSITION: relative ! important; OVERFLOW-X: hidden scroll=no xmlns:ignav=http:// schemas.infragistics.com/ASPNET/WebControls/WebMenu sizcache=33 sizset=1FORM id=Form1 method=post name=Form1 action=Menu.aspx?hidMLS=SDNA sizcache=33 sizset=1DIV id=divControlPanel class=ControlPanel sizcache=33 sizset=1DIV id=divMenu class=Menu sizcache=33 sizset=1DIV id=divNavigation class=Navigation sizcache=33 sizset=1DIV id=divNavContainer class=MenuWrapper TABLE style=BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER- BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; CURSOR: default id=uwmMainMenu_MainM onmouseup=javascript:igmenu_mouseup(this, event); onselectstart=javascript:igmenu_selectStart(); class=WebMenu onmouseover=javascript:igmenu_mouseover(this, event); onmouseout=javascript:igmenu_mouseout(this, event); onmousedown=javascript:igmenu_mousedown(this, event); border=0 cellSpacing=1 cellPadding=2 igLevel=0 submenu=1 TBODY TR TD accessKey=S onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_1 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_1M igHov=IGMenuItemHover igTag=1 igClass=IGMenuItem US/Uearches /TD TD accessKey=L onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_2 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_2M igHov=IGMenuItemHover igTag=2 igClass=IGMenuItem UL/Uistings /TD TD accessKey=T onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_3 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=26 igFrame=_Script igUrl=menuOneLevelItemClick('http://realist2.firstamres.com/ propertylink? UserID=rapstaffAgentLastName=StaffAgentFirstName=RapattoniCustomerGroupName=Sedona Verde ValleyUserPW=sedona','_Realist') igClass=IGMenuItem UT/Uax /TD TD accessKey=R onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_4 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=3 igFrame=_Script igUrl=Cart_OnClick() igClass=IGMenuItem CaUr/Ut /TD TD accessKey=C onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_5 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_5M igHov=IGMenuItemHover igTag=4 igClass=IGMenuItem UC/Uontacts /TD TD accessKey=N onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_6 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_6M igHov=IGMenuItemHover igTag=5 igClass=IGMenuItem LiUn/Uks /TD TD
[wtr-general] Re: How to access element in a table ?
I think you should be able to access the link as an element in the table cell: ie.table(:id, uwmMainMenu_MainM )[2][1].link(:text, 'Quick Search').click or, if you assign your element to a variable: my_cell = ie.table(:id, uwmMainMenu_MainM )[2][1] my_cell.link(:text, 'Quick Search').click -Tiffany On Jul 27, 2:25 pm, Chan Nguyen atbl1...@gmail.com wrote: Hello Tiffany, Thanks for your help. I actually did go through that example, but in that cell there are a list of options that I have to pick one: - Quick Search - Saved Search - Standard Search ...etc and there is no click option for a cell. I really struggle with this :( ! Can you give me some more hints? Thanks, On Tue, Jul 27, 2010 at 1:22 PM, Tiffany Fodor tcfo...@comcast.net wrote: Hi! The Watir Cheat Sheet (http://wiki.openqa.org/display/WTR/Cheat+Sheet) has an example of working with table elements: td = browser.table(:name, 'recent_records')[2][1] td is now the cell at row 2, column 1 of your table. There's more information on the Table class in the Watir API reference: http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Table.html Hope this helps! -Tiffany On Jul 27, 2:04 pm, Chan Nguyen atbl1...@gmail.com wrote: Hi Basim, Thanks a lot for your quick response. I just found out that element is actually a table. I accessed to a particular table like this : my_table = ie.table( :id, uwmMainMenu_MainM ) Next, I need to access the each element of the first row of this table, but I got stuck at this point. Could you give me a minimal example to access table? Further, I don't know how to click an option in this list? http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif On Tue, Jul 27, 2010 at 12:59 PM, Basim Baassiri ba...@baassiri.ca wrote: Hi Chan You can try and use firebug to identify element http://getfirebug.com/downloads http://getfirebug.com/downloadsBasim On Tue, Jul 27, 2010 at 3:17 PM, Chan Nguyen atbl1...@gmail.com wrote: down vote favorite Hi everyone, I'm current writing a test script for our MLS( Multiple Listing System ) systems. The website is mainly written in C# .NET. Here is the screenshot that I got: http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif And this is the HTML source: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//ENMETA http- equiv=Content-Type content=text/html; charset=utf-8 HTML sizcache=33 sizset=1BODY style=POSITION: relative ! important; OVERFLOW-X: hidden scroll=no xmlns:ignav=http:// schemas.infragistics.com/ASPNET/WebControls/WebMenu sizcache=33 sizset=1FORM id=Form1 method=post name=Form1 action=Menu.aspx?hidMLS=SDNA sizcache=33 sizset=1DIV id=divControlPanel class=ControlPanel sizcache=33 sizset=1DIV id=divMenu class=Menu sizcache=33 sizset=1DIV id=divNavigation class=Navigation sizcache=33 sizset=1DIV id=divNavContainer class=MenuWrapper TABLE style=BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER- BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; CURSOR: default id=uwmMainMenu_MainM onmouseup=javascript:igmenu_mouseup(this, event); onselectstart=javascript:igmenu_selectStart(); class=WebMenu onmouseover=javascript:igmenu_mouseover(this, event); onmouseout=javascript:igmenu_mouseout(this, event); onmousedown=javascript:igmenu_mousedown(this, event); border=0 cellSpacing=1 cellPadding=2 igLevel=0 submenu=1 TBODY TR TD accessKey=S onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_1 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_1M igHov=IGMenuItemHover igTag=1 igClass=IGMenuItem US/Uearches /TD TD accessKey=L onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_2 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_2M igHov=IGMenuItemHover igTag=2 igClass=IGMenuItem UL/Uistings /TD TD accessKey=T onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_3 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=26 igFrame=_Script igUrl=menuOneLevelItemClick('http://realist2.firstamres.com/ propertylink? UserID=rapstaffAgentLastName=StaffAgentFirstName=RapattoniCustomerGroupName=Sedona Verde ValleyUserPW=sedona','_Realist') igClass=IGMenuItem UT/Uax /TD TD accessKey=R onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_4 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=3 igFrame=_Script igUrl=Cart_OnClick() igClass=IGMenuItem CaUr/Ut /TD TD accessKey=C onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_5
Re: [wtr-general] Re: How to access element in a table ?
Hi Tiffany, I tried your method, but it gave me errors. I use NetBean IDE Beginning of test: Sedona Verde Valley Step 1: go to the test site: http://svvarmls.rapmlsqa.com/ Step 2: enter username : rapstaff in the Agent ID field Step 3: enter password : Succ3ss! in the Agent ID field` Step 4: click the 'Submit' button. Step 5: after navigate to http://login.rapmlsqa.com/BroadcastNotices.aspx?hidMLS=SDNA, click 'Read Later' button 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 :text, Quick Search (Watir::Exception::UnknownObjectException) from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:288:in `enabled?' from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:60:in `assert_enabled' from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:233:in `click!' from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:219:in `click' Step 6: Choose a 'Quick Search' from C:/NetBeans Project/RubyApplication2/lib/main.rb:47 On Tue, Jul 27, 2010 at 1:38 PM, Tiffany Fodor tcfo...@comcast.net wrote: I think you should be able to access the link as an element in the table cell: ie.table(:id, uwmMainMenu_MainM )[2][1].link(:text, 'Quick Search').click or, if you assign your element to a variable: my_cell = ie.table(:id, uwmMainMenu_MainM )[2][1] my_cell.link(:text, 'Quick Search').click -Tiffany On Jul 27, 2:25 pm, Chan Nguyen atbl1...@gmail.com wrote: Hello Tiffany, Thanks for your help. I actually did go through that example, but in that cell there are a list of options that I have to pick one: - Quick Search - Saved Search - Standard Search ...etc and there is no click option for a cell. I really struggle with this :( ! Can you give me some more hints? Thanks, On Tue, Jul 27, 2010 at 1:22 PM, Tiffany Fodor tcfo...@comcast.net wrote: Hi! The Watir Cheat Sheet (http://wiki.openqa.org/display/WTR/Cheat+Sheet) has an example of working with table elements: td = browser.table(:name, 'recent_records')[2][1] td is now the cell at row 2, column 1 of your table. There's more information on the Table class in the Watir API reference: http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Table.html Hope this helps! -Tiffany On Jul 27, 2:04 pm, Chan Nguyen atbl1...@gmail.com wrote: Hi Basim, Thanks a lot for your quick response. I just found out that element is actually a table. I accessed to a particular table like this : my_table = ie.table( :id, uwmMainMenu_MainM ) Next, I need to access the each element of the first row of this table, but I got stuck at this point. Could you give me a minimal example to access table? Further, I don't know how to click an option in this list? http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif On Tue, Jul 27, 2010 at 12:59 PM, Basim Baassiri ba...@baassiri.ca wrote: Hi Chan You can try and use firebug to identify element http://getfirebug.com/downloads http://getfirebug.com/downloadsBasim On Tue, Jul 27, 2010 at 3:17 PM, Chan Nguyen atbl1...@gmail.com wrote: down vote favorite Hi everyone, I'm current writing a test script for our MLS( Multiple Listing System ) systems. The website is mainly written in C# .NET. Here is the screenshot that I got: http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif And this is the HTML source: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//ENMETA http- equiv=Content-Type content=text/html; charset=utf-8 HTML sizcache=33 sizset=1BODY style=POSITION: relative ! important; OVERFLOW-X: hidden scroll=no xmlns:ignav=http:// schemas.infragistics.com/ASPNET/WebControls/WebMenu sizcache=33 sizset=1FORM id=Form1 method=post name=Form1 action=Menu.aspx?hidMLS=SDNA sizcache=33 sizset=1DIV id=divControlPanel class=ControlPanel sizcache=33 sizset=1DIV id=divMenu class=Menu sizcache=33 sizset=1DIV id=divNavigation class=Navigation sizcache=33 sizset=1DIV id=divNavContainer class=MenuWrapper TABLE style=BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER- BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; CURSOR: default id=uwmMainMenu_MainM onmouseup=javascript:igmenu_mouseup(this, event); onselectstart=javascript:igmenu_selectStart(); class=WebMenu onmouseover=javascript:igmenu_mouseover(this, event); onmouseout=javascript:igmenu_mouseout(this, event); onmousedown=javascript:igmenu_mousedown(this, event); border=0 cellSpacing=1 cellPadding=2 igLevel=0 submenu=1 TBODY TR TD accessKey=S onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_1 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event);
[wtr-general] Understanding Modules and Classes a little better
Hey team, I might post a few discussions here over the coming days trying to better improve my framework, and to start I want to make sense of Modules and Classes. Previously I've just written a whole lot of methods, loaded every script and called each method as required, with little or no concept of placing these within Modules or Classes. it works fine, but surely I can do better. I just don't quite understand them and how to effectively use them well enough, so I'm wondering if anyone can point me in the direction of some good tutorials, or even better, some Watir-specific examples that use them well. Thanks, Jason -- 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] Having a Devil of a time accessing this button...
Hello All, I'm having a devil of a time executing this javascript button event, I tried using ie.button(:id, generate::0).fire_event('onmousedown'), ie.button(:id, generate::0).fire_event('onclick') and a couple other ways to click this button, all to no avail. Here's the code snippit of the control I'm trying to click Code: tdtable align='' cellspacing='0' border='0' cellpadding='4' summary='Table to hold button.'trtd class='whitebg'input onFocus=root.hover(this, 'win-btn-over') onMouseOver=root.hover(this, 'win-btn-over') onMouseOut=root.hover(this, 'win-btn') onClick='root.handleOnClick(document, this)' class='win-btn' id='generate::0' name='generate::0' value='Add' onBlur=root.hover(this, 'win-btn') type='BUTTON'/td/tr/table/td Many Thanks in Advance, 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
Re: [wtr-general] Re: How to access element in a table ?
Hi Basim, Thanks a lot for your help. Your solution makes a lot of sense to me. To be honest, I'm a newbie to Ruby, HTML, and web environment. I'm working as an intern. My strongest skill is C++, but this company is all about C#, .NET, ASP.NET, Java... I have to learn 3 languages for about a month not including Ruby :( ! Now the search is opened, so how I can I choose a Quick Search ( e.g ) in that tab? Thanks, On Tue, Jul 27, 2010 at 1:34 PM, Basim Baassiri ba...@baassiri.ca wrote: Hi Chan You might need to use the fire_event method to trigger the javascript in the hover menu. browser.table(:id, uwmMainMenu_MainM).fire_event onmouseover td = browser.table(:id, uwmMainMenu_MainM')[2][1] td.fire_event onfocus # or td.fire_event onclick Basim On Tue, Jul 27, 2010 at 4:22 PM, Tiffany Fodor tcfo...@comcast.netwrote: Hi! The Watir Cheat Sheet (http://wiki.openqa.org/display/WTR/Cheat+Sheet) has an example of working with table elements: td = browser.table(:name, 'recent_records')[2][1] td is now the cell at row 2, column 1 of your table. There's more information on the Table class in the Watir API reference: http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Table.html Hope this helps! -Tiffany On Jul 27, 2:04 pm, Chan Nguyen atbl1...@gmail.com wrote: Hi Basim, Thanks a lot for your quick response. I just found out that element is actually a table. I accessed to a particular table like this : my_table = ie.table( :id, uwmMainMenu_MainM ) Next, I need to access the each element of the first row of this table, but I got stuck at this point. Could you give me a minimal example to access table? Further, I don't know how to click an option in this list? http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif On Tue, Jul 27, 2010 at 12:59 PM, Basim Baassiri ba...@baassiri.ca wrote: Hi Chan You can try and use firebug to identify element http://getfirebug.com/downloads http://getfirebug.com/downloadsBasim On Tue, Jul 27, 2010 at 3:17 PM, Chan Nguyen atbl1...@gmail.com wrote: down vote favorite Hi everyone, I'm current writing a test script for our MLS( Multiple Listing System ) systems. The website is mainly written in C# .NET. Here is the screenshot that I got: http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif And this is the HTML source: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//ENMETA http- equiv=Content-Type content=text/html; charset=utf-8 HTML sizcache=33 sizset=1BODY style=POSITION: relative ! important; OVERFLOW-X: hidden scroll=no xmlns:ignav=http:// schemas.infragistics.com/ASPNET/WebControls/WebMenu sizcache=33 sizset=1FORM id=Form1 method=post name=Form1 action=Menu.aspx?hidMLS=SDNA sizcache=33 sizset=1DIV id=divControlPanel class=ControlPanel sizcache=33 sizset=1DIV id=divMenu class=Menu sizcache=33 sizset=1DIV id=divNavigation class=Navigation sizcache=33 sizset=1DIV id=divNavContainer class=MenuWrapper TABLE style=BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER- BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; CURSOR: default id=uwmMainMenu_MainM onmouseup=javascript:igmenu_mouseup(this, event); onselectstart=javascript:igmenu_selectStart(); class=WebMenu onmouseover=javascript:igmenu_mouseover(this, event); onmouseout=javascript:igmenu_mouseout(this, event); onmousedown=javascript:igmenu_mousedown(this, event); border=0 cellSpacing=1 cellPadding=2 igLevel=0 submenu=1 TBODY TR TD accessKey=S onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_1 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_1M igHov=IGMenuItemHover igTag=1 igClass=IGMenuItem US/Uearches /TD TD accessKey=L onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_2 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_2M igHov=IGMenuItemHover igTag=2 igClass=IGMenuItem UL/Uistings /TD TD accessKey=T onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_3 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=26 igFrame=_Script igUrl=menuOneLevelItemClick('http://realist2.firstamres.com/ propertylink? UserID=rapstaffAgentLastName=StaffAgentFirstName=RapattoniCustomerGroupName=Sedona Verde ValleyUserPW=sedona','_Realist') igClass=IGMenuItem UT/Uax /TD TD accessKey=R onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_4 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=3 igFrame=_Script igUrl=Cart_OnClick() igClass=IGMenuItem CaUr/Ut /TD TD accessKey=C onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_5 class=IGMenuItem
Re: [wtr-general] Re: How to access element in a table ?
Hi Chan What code did you try to choose Quick Search? Basim On Tue, Jul 27, 2010 at 4:55 PM, Chan Nguyen atbl1...@gmail.com wrote: Hi Basim, Thanks a lot for your help. Your solution makes a lot of sense to me. To be honest, I'm a newbie to Ruby, HTML, and web environment. I'm working as an intern. My strongest skill is C++, but this company is all about C#, .NET, ASP.NET, Java... I have to learn 3 languages for about a month not including Ruby :( ! Now the search is opened, so how I can I choose a Quick Search ( e.g ) in that tab? Thanks, On Tue, Jul 27, 2010 at 1:34 PM, Basim Baassiri ba...@baassiri.ca wrote: Hi Chan You might need to use the fire_event method to trigger the javascript in the hover menu. browser.table(:id, uwmMainMenu_MainM).fire_event onmouseover td = browser.table(:id, uwmMainMenu_MainM')[2][1] td.fire_event onfocus # or td.fire_event onclick Basim On Tue, Jul 27, 2010 at 4:22 PM, Tiffany Fodor tcfo...@comcast.netwrote: Hi! The Watir Cheat Sheet (http://wiki.openqa.org/display/WTR/Cheat+Sheet) has an example of working with table elements: td = browser.table(:name, 'recent_records')[2][1] td is now the cell at row 2, column 1 of your table. There's more information on the Table class in the Watir API reference: http://wtr.rubyforge.org/rdoc/1.6.5/classes/Watir/Table.html Hope this helps! -Tiffany On Jul 27, 2:04 pm, Chan Nguyen atbl1...@gmail.com wrote: Hi Basim, Thanks a lot for your quick response. I just found out that element is actually a table. I accessed to a particular table like this : my_table = ie.table( :id, uwmMainMenu_MainM ) Next, I need to access the each element of the first row of this table, but I got stuck at this point. Could you give me a minimal example to access table? Further, I don't know how to click an option in this list? http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif On Tue, Jul 27, 2010 at 12:59 PM, Basim Baassiri ba...@baassiri.ca wrote: Hi Chan You can try and use firebug to identify element http://getfirebug.com/downloads http://getfirebug.com/downloadsBasim On Tue, Jul 27, 2010 at 3:17 PM, Chan Nguyen atbl1...@gmail.com wrote: down vote favorite Hi everyone, I'm current writing a test script for our MLS( Multiple Listing System ) systems. The website is mainly written in C# .NET. Here is the screenshot that I got: http://i235.photobucket.com/albums/ee62/rox_rook/Ex-1.gif And this is the HTML source: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML Transitional//ENMETA http- equiv=Content-Type content=text/html; charset=utf-8 HTML sizcache=33 sizset=1BODY style=POSITION: relative ! important; OVERFLOW-X: hidden scroll=no xmlns:ignav=http:// schemas.infragistics.com/ASPNET/WebControls/WebMenu sizcache=33 sizset=1FORM id=Form1 method=post name=Form1 action=Menu.aspx?hidMLS=SDNA sizcache=33 sizset=1DIV id=divControlPanel class=ControlPanel sizcache=33 sizset=1DIV id=divMenu class=Menu sizcache=33 sizset=1DIV id=divNavigation class=Navigation sizcache=33 sizset=1DIV id=divNavContainer class=MenuWrapper TABLE style=BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER- BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; CURSOR: default id=uwmMainMenu_MainM onmouseup=javascript:igmenu_mouseup(this, event); onselectstart=javascript:igmenu_selectStart(); class=WebMenu onmouseover=javascript:igmenu_mouseover(this, event); onmouseout=javascript:igmenu_mouseout(this, event); onmousedown=javascript:igmenu_mousedown(this, event); border=0 cellSpacing=1 cellPadding=2 igLevel=0 submenu=1 TBODY TR TD accessKey=S onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_1 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_1M igHov=IGMenuItemHover igTag=1 igClass=IGMenuItem US/Uearches /TD TD accessKey=L onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_2 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igChildId=uwmMainMenu_2M igHov=IGMenuItemHover igTag=2 igClass=IGMenuItem UL/Uistings /TD TD accessKey=T onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_3 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=26 igFrame=_Script igUrl=menuOneLevelItemClick('http://realist2.firstamres.com/ propertylink? UserID=rapstaffAgentLastName=StaffAgentFirstName=RapattoniCustomerGroupName=Sedona Verde ValleyUserPW=sedona','_Realist') igClass=IGMenuItem UT/Uax /TD TD accessKey=R onkeydown=igmenu_kbMD(this,event); id=uwmMainMenu_4 class=IGMenuItem onfocus=igmenu_kbFocus(this,event); onkeyup=igmenu_kbNav(this,event); align=center igTop=1 igHov=IGMenuItemHover igTag=3 igFrame=_Script
Re: [wtr-general] Understanding Modules and Classes a little better
Hello, Jason. The Programming Ruby 1.9 book, found at pragprog.com is great and has a quite extensive chapter on classes and modules. I highly recommend you to buy it (I can send you a 40% discount code if you want :) I won't reproduce the entire chapter here, but the main difference is that modules cannot be instantiated. This FAQ [1] defines both as follows: 8.8 What is the difference between a class and a module? Modules are collections of methods and constants. They cannot generate instances. Classes may generate instances (objects), and have per-instance state (instance variables). Modules may be mixed in to classes and other modules. The mixed-in module's constants and methods blend into that class's own, augmenting the class's functionality. Classes, however, cannot be mixed in to anything. A class may inherit from another class, but not from a module. A module may not inherit from anything. -- So, applying these concepts to your framework, I would create modules as helper classes, providing commonly used methods like file operations, logging, etc that are not part of the application business. Navigation functions should be placed in classes representing your application pages, for example: Class MainPage is instantiated with a @ie.attach(:title, /Home Page/) object, should have a login(username, password) method and so on. This might leave you with something like the Page Object Model [2], which is a very interesting way to model your tests. Was it helpful? [1] http://www.rootr.net/rubyfaq-8.html [2] http://code.google.com/p/selenium/wiki/PageObjects On Tue, Jul 27, 2010 at 5:48 PM, Jason freezingki...@gmail.com wrote: Hey team, I might post a few discussions here over the coming days trying to better improve my framework, and to start I want to make sense of Modules and Classes. Previously I've just written a whole lot of methods, loaded every script and called each method as required, with little or no concept of placing these within Modules or Classes. it works fine, but surely I can do better. I just don't quite understand them and how to effectively use them well enough, so I'm wondering if anyone can point me in the direction of some good tutorials, or even better, some Watir-specific examples that use them well. Thanks, Jason -- 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 -- 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: Having a Devil of a time accessing this button...
Try matching the case on the event name with the ones in the source, instead of all lower case e.g. browser.button(:id, generate::0).fire_event('onClick') In terms of 'not working' it helps if we get a bit more detail in terms of things like 'does anything happen? do you get an error? (if so, what IS the error) etc. On Jul 27, 2:09 pm, Eric Mathiesen mathiese...@gmail.com wrote: Hello All, I'm having a devil of a time executing this javascript button event, I tried using ie.button(:id, generate::0).fire_event('onmousedown'), ie.button(:id, generate::0).fire_event('onclick') and a couple other ways to click this button, all to no avail. Here's the code snippit of the control I'm trying to click Code: tdtable align='' cellspacing='0' border='0' cellpadding='4' summary='Table to hold button.'trtd class='whitebg'input onFocus=root.hover(this, 'win-btn-over') onMouseOver=root.hover(this, 'win-btn-over') onMouseOut=root.hover(this, 'win-btn') onClick='root.handleOnClick(document, this)' class='win-btn' id='generate::0' name='generate::0' value='Add' onBlur=root.hover(this, 'win-btn') type='BUTTON'/td/tr/table/td Many Thanks in Advance, 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
Re: [wtr-general] Re: Having a Devil of a time accessing this button...
I have audio on my automation test machine, and I have it setup for an audible click when it simulates a mouse click. Watir is driving the mouseclick on the element under test, however Internet Explorer just stays idle on the page and WATIR reports; Loaded suite Started Finished in 0.0 seconds. 0 tests, 0 assertions, 0 failures, 0 errors Tried changing case of the onClick event to no avail... Cheers, Eric On Tue, Jul 27, 2010 at 3:38 PM, Chuck van der Linden sqa...@gmail.comwrote: Try matching the case on the event name with the ones in the source, instead of all lower case e.g. browser.button(:id, generate::0).fire_event('onClick') In terms of 'not working' it helps if we get a bit more detail in terms of things like 'does anything happen? do you get an error? (if so, what IS the error) etc. On Jul 27, 2:09 pm, Eric Mathiesen mathiese...@gmail.com wrote: Hello All, I'm having a devil of a time executing this javascript button event, I tried using ie.button(:id, generate::0).fire_event('onmousedown'), ie.button(:id, generate::0).fire_event('onclick') and a couple other ways to click this button, all to no avail. Here's the code snippit of the control I'm trying to click Code: tdtable align='' cellspacing='0' border='0' cellpadding='4' summary='Table to hold button.'trtd class='whitebg'input onFocus=root.hover(this, 'win-btn-over') onMouseOver=root.hover(this, 'win-btn-over') onMouseOut=root.hover(this, 'win-btn') onClick='root.handleOnClick(document, this)' class='win-btn' id='generate::0' name='generate::0' value='Add' onBlur=root.hover(this, 'win-btn') type='BUTTON'/td/tr/table/td Many Thanks in Advance, 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.comwatir-general%2bunsubscr...@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: facing issue with clicking buttons
Frankly I'd find some other thing to try and automate. GMAIL intentionally makes their UI difficult to automate. ID's are uniquely regenerated each time you instantiate the compose mail page (and different each time) Classes look fairly randomized and I'd place no bets on Gmail not updating them on some rotating basis. That div with 'send' in it, consists of about 5 nested divs, and I've no idea which of them is 'wired' to respond to the click. Even if we figured out the right class etc to make it work, who's to say it would stay working an hour or a day from now. (consider for a moment all the 'evil' that could be caused by people abusing an easily scriptable gmail interface and you'll understand why there's no incentive on google's part to make any of this easy for anyone., and in fact quite a bit of incentive to make it very difficult) If it's possible at all, it's likely going to take something like Xpath to do it, or practically reverse engineering the DOM on the fly On Jul 27, 6:43 am, praveen kumar praveen454gr...@gmail.com wrote: Hi Raveendran, Thanks for the reply... I tried with the all the possibilities you provided.None of them are working. Getting error as Unable to locate element. Please let me know if any other options. Thanks, Praveen On Tue, Jul 27, 2010 at 11:09 AM, Raveendran P jazzezr...@gmail.com wrote: Hi Praveen, Have you tried these possibilities ? *canvas_frame.div(:class, 'J-Zh-I J-J5-Ji Bq L3').flash* * canvas_frame.div(:id, ': 15m ').flash canvas_frame.div(:id, ': 15m ').flash * On Fri, Jul 23, 2010 at 1:32 PM, praveen kumar praveen454gr...@gmail.comwrote: Hi John, I have tried with div, but unable to click on button. Following is the code: require 'watir' require 'test/unit' require 'win32ole' class TC_article_example Test::Unit::TestCase def test_data $ie = Watir::IE.new $ie.goto(http://mail.google.com/mail/?ui=html;) #Define the excel file excel= WIN32OLE::new(excel.Application) wrkbook=excel.Workbooks.Open(C:\\test.xls) wrksheet = wrkbook.worksheets(1) wrksheet.select #read the data from excel file rows = 2 $username=wrksheet.cells(rows,A) ['text'] #puts $field $password=wrksheet.cells(rows,B) ['text'] $ie.text_field(:name,Email).set($username) $ie.text_field(:id,Passwd).set($password) $ie.button(:id, 'signIn' ).click #browser.show_frames # We need the iframe with ID 'canvas_frame'. Store it in a var. #$ie.goto(http://mail.google.com/mail/?ui=html;) canvas_frame = $ie.frame(:id, 'canvas_frame') # Get the current user's email address. We'll be sending email to it. my_address = $username mail_subject = 'Hello Watir world!' mail_body_text = 'Hi.' canvas_frame.span(:text, 'Compose Mail').click # Compose new mail canvas_frame.text_field(:name, 'to').set(my_address) canvas_frame.text_field(:name, 'subject').set(mail_subject) mail_body_frame = canvas_frame.frame(:index, 1) mail_body_frame.document.body.setproperty('innerText', mail_body_text) #$ie.goto(http://mail.google.com/mail/?ui=html;) * canvas_frame.div(:text, 'Send').click # Send the message I am facing problem here to click on Send button. It has no attributes like type, value* # canvas_frame.link(:text, 'Sent Mail').click # Browse to sent mail page # assert(canvas_frame.contains_text('Hello Watir world!')) # canvas_frame.link(:text, 'Inbox').click # Return to the inbox page $ie.link(:href,'https://mail.google.com/mail/?logouthl=en').clickhttps://mail.google.com/mail/?logouthl=en%27%29.click $ie.close #rows=rows+1 end end I have also tried with the attribute id, but that is also not working. Please help me and let me know if require any details. Praveen On Thu, Jul 22, 2010 at 10:23 PM, John Fitisoff jfitis...@yahoo.comwrote: Try treating it as a div rather than a button? -- *From:* praveen kumar praveen454gr...@gmail.com *To:* watir-general@googlegroups.com *Sent:* Thu, July 22, 2010 5:42:59 AM *Subject:* [wtr-general] facing issue with clicking buttons Hi All, I am trying to automate the gmail by clicking on the compose mail and entering to address , subject and body content. I am facing problem in clicking the Send button. The button has following HTML elements *div tabindex=1 class=J-Zh-I J-J5-Ji Bq L3 id=:15m role=button style=-moz-user-select: none;bSend/b/div * I have tried with following script *canvas_frame.button(:text, 'Send').click * canvas_frame is the variable in which the frame is stored. I am confusing because there is no type attribute. It has role attribute i.e role=button. Please help me in going forward... Thanks, Praveen -- Before posting, please readhttp://watir.com/support. In
[wtr-general] Re: Having a Devil of a time accessing this button...
did you try onMouseOver first, then the click? that would sort of be the natural sequence On Jul 27, 3:44 pm, Eric Mathiesen mathiese...@gmail.com wrote: I have audio on my automation test machine, and I have it setup for an audible click when it simulates a mouse click. Watir is driving the mouseclick on the element under test, however Internet Explorer just stays idle on the page and WATIR reports; Loaded suite Started Finished in 0.0 seconds. 0 tests, 0 assertions, 0 failures, 0 errors Tried changing case of the onClick event to no avail... Cheers, Eric On Tue, Jul 27, 2010 at 3:38 PM, Chuck van der Linden sqa...@gmail.comwrote: Try matching the case on the event name with the ones in the source, instead of all lower case e.g. browser.button(:id, generate::0).fire_event('onClick') In terms of 'not working' it helps if we get a bit more detail in terms of things like 'does anything happen? do you get an error? (if so, what IS the error) etc. On Jul 27, 2:09 pm, Eric Mathiesen mathiese...@gmail.com wrote: Hello All, I'm having a devil of a time executing this javascript button event, I tried using ie.button(:id, generate::0).fire_event('onmousedown'), ie.button(:id, generate::0).fire_event('onclick') and a couple other ways to click this button, all to no avail. Here's the code snippit of the control I'm trying to click Code: tdtable align='' cellspacing='0' border='0' cellpadding='4' summary='Table to hold button.'trtd class='whitebg'input onFocus=root.hover(this, 'win-btn-over') onMouseOver=root.hover(this, 'win-btn-over') onMouseOut=root.hover(this, 'win-btn') onClick='root.handleOnClick(document, this)' class='win-btn' id='generate::0' name='generate::0' value='Add' onBlur=root.hover(this, 'win-btn') type='BUTTON'/td/tr/table/td Many Thanks in Advance, Eric -- 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.comwatir-general%2bunsubscr...@goog 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
RE: [wtr-general] Re: facing issue with clicking buttons
Or, someone might take the lazy way out and use the ruby-gmail gem. But that's just me. Automating email handling through some sort of client (web, Outlook, etc.) is just plain dumb. I sometimes use something similar in Perl if/when I need to generate/send email. When all you have is a hammer, everything pretty much looks like a nail. Sometimes you have to think outside the box to solve your problems. (Note: This is not directly in response to Chuck...rather, in response to the insanity that is test automation.) -Original Message- From: watir-general@googlegroups.com [mailto:watir- gene...@googlegroups.com] On Behalf Of Chuck van der Linden Sent: Tuesday, July 27, 2010 5:59 PM To: Watir General Subject: [wtr-general] Re: facing issue with clicking buttons Frankly I'd find some other thing to try and automate. GMAIL intentionally makes their UI difficult to automate. ID's are uniquely regenerated each time you instantiate the compose mail page (and different each time) Classes look fairly randomized and I'd place no bets on Gmail not updating them on some rotating basis. That div with 'send' in it, consists of about 5 nested divs, and I've no idea which of them is 'wired' to respond to the click. Even if we figured out the right class etc to make it work, who's to say it would stay working an hour or a day from now. (consider for a moment all the 'evil' that could be caused by people abusing an easily scriptable gmail interface and you'll understand why there's no incentive on google's part to make any of this easy for anyone., and in fact quite a bit of incentive to make it very difficult) If it's possible at all, it's likely going to take something like Xpath to do it, or practically reverse engineering the DOM on the fly On Jul 27, 6:43 am, praveen kumar praveen454gr...@gmail.com wrote: Hi Raveendran, Thanks for the reply... I tried with the all the possibilities you provided.None of them are working. Getting error as Unable to locate element. Please let me know if any other options. Thanks, Praveen On Tue, Jul 27, 2010 at 11:09 AM, Raveendran P jazzezr...@gmail.com wrote: Hi Praveen, Have you tried these possibilities ? *canvas_frame.div(:class, 'J-Zh-I J-J5-Ji Bq L3').flash* * canvas_frame.div(:id, ': 15m ').flash canvas_frame.div(:id, ': 15m ').flash * On Fri, Jul 23, 2010 at 1:32 PM, praveen kumar praveen454gr...@gmail.comwrote: Hi John, I have tried with div, but unable to click on button. Following is the code: require 'watir' require 'test/unit' require 'win32ole' class TC_article_example Test::Unit::TestCase def test_data $ie = Watir::IE.new $ie.goto(http://mail.google.com/mail/?ui=html;) #Define the excel file excel= WIN32OLE::new(excel.Application) wrkbook=excel.Workbooks.Open(C:\\test.xls) wrksheet = wrkbook.worksheets(1) wrksheet.select #read the data from excel file rows = 2 $username=wrksheet.cells(rows,A) ['text'] #puts $field $password=wrksheet.cells(rows,B) ['text'] $ie.text_field(:name,Email).set($username) $ie.text_field(:id,Passwd).set($password) $ie.button(:id, 'signIn' ).click #browser.show_frames # We need the iframe with ID 'canvas_frame'. Store it in a var. #$ie.goto(http://mail.google.com/mail/?ui=html;) canvas_frame = $ie.frame(:id, 'canvas_frame') # Get the current user's email address. We'll be sending email to it. my_address = $username mail_subject = 'Hello Watir world!' mail_body_text = 'Hi.' canvas_frame.span(:text, 'Compose Mail').click # Compose new mail canvas_frame.text_field(:name, 'to').set(my_address) canvas_frame.text_field(:name, 'subject').set(mail_subject) mail_body_frame = canvas_frame.frame(:index, 1) mail_body_frame.document.body.setproperty('innerText', mail_body_text) #$ie.goto(http://mail.google.com/mail/?ui=html;) * canvas_frame.div(:text, 'Send').click # Send the message I am facing problem here to click on Send button. It has no attributes like type, value* # canvas_frame.link(:text, 'Sent Mail').click # Browse to sent mail page # assert(canvas_frame.contains_text('Hello Watir world!')) # canvas_frame.link(:text, 'Inbox').click # Return to the inbox page $ie.link(:href,'https://mail.google.com/mail/?logouthl=en').clickhttp s://mail.google.com/mail/?logouthl=en%27%29.click $ie.close #rows=rows+1 end end I have also tried with the attribute id, but that is also not working. Please help me and let me know if require any details. Praveen On Thu, Jul 22, 2010 at 10:23 PM, John Fitisoff jfitis...@yahoo.comwrote: Try treating it as a div rather than a button?