Re: [wtr-general] Re: How to access element in a table ?
On Wed, Jul 28, 2010 at 3:57 PM, Chan Nguyen atbl1...@gmail.com wrote: My problem is that in our website, there are a lot of JavaScript. And I currently could not find a way for Watir to deal with JS. :( ! Our site also uses javascript and Watir works just fine. What is the problem? Željko -- 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 ?
Hello Zeljko, I just tried to test our website.From my understanding, Watir has to know the information of attribute of each element.( Eg. id, name...ect ). However, our website have a lot of JavaScripts that deal with each element in a cell of a table. By that, I mean, I can access to the cell of a table. But this cell also has a list of other options. This is the site that I'm currently testing: http://svvarmls.rapmlsqa.com/ username: rapstaff pw: Succ3ss! And this is my script. *require rubygems # the Watir controller require watir # set a variable test_site = http://svvarmls.rapmlsqa.com/; # open the IE browser ie = Watir::IE.new # print some comments puts Beginning of test: Sedona Verde Valley puts Step 1: go to the test site: + test_site ie.goto test_site puts Step 2: enter username : rapstaff in the Agent ID field ie.text_field( :id, txtUserName ).set rapstaff puts Step 3: enter password : Succ3ss! in the Agent ID field` ie.text_field( :id, txtPassword ).set Succ3ss! puts Step 4: click the 'Submit' button. ie.button( :id, btnSubmit ).click puts Step 5: after navigate to http://login.rapmlsqa.com/BroadcastNotices.aspx?hidMLS=SDNA, click 'Read Later' button ie.button( :id, btnReadLater ).click * After clicking the Read Later button, it will prompt me to another page. In this page, from the very top, you can see there are several options: -- - Search - Listing - Tax - Contact - Links - Admin - Help - -- And this is a table with one row and 8 columns. The first element [1][1] is Search, which will call the JS to process all the search options. When you move your mouse over Search, you will see all the others options. I want to click on each individual option of Search( Quick Search, Custom Search ) to test, but I could not find a way to make it work. If you have a chance, would you mind taking a look at it? On Wed, Jul 28, 2010 at 7:33 AM, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Wed, Jul 28, 2010 at 3:57 PM, Chan Nguyen atbl1...@gmail.com wrote: My problem is that in our website, there are a lot of JavaScript. And I currently could not find a way for Watir to deal with JS. :( ! Our site also uses javascript and Watir works just fine. What is the problem? Željko -- 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] Re: How to access element in a table ?
Chan There are many solutions to your problem Try this one as it works for me require 'watir' test_site = http://svvarmls.rapmlsqa.com/; ie = Watir::IE.new ie.goto test_site ie.text_field( :id, txtUserName ).set rapstaff ie.text_field( :id, txtPassword ).set Succ3ss! ie.button( :id, btnSubmit ).click #ie.button( :id, btnReadLater ).click table = ie.table(:id,uwmMainMenu_MainM) table[1][1].fire_event onmouseover table[1][1].fire_event onmousedown table2 = ie.table(:class, SubMenu) table2[7][1].fire_event onmousedown table2[7][1].fire_event onmouseup If your credentials contain sensitive information, I strongly recommend changing the password as google has probably already indexed this thread Good Luck! Basim Baassiri On Wed, Jul 28, 2010 at 10:34 AM, Chan Nguyen atbl1...@gmail.com wrote: Hello Zeljko, I just tried to test our website.From my understanding, Watir has to know the information of attribute of each element.( Eg. id, name...ect ). However, our website have a lot of JavaScripts that deal with each element in a cell of a table. By that, I mean, I can access to the cell of a table. But this cell also has a list of other options. This is the site that I'm currently testing: http://svvarmls.rapmlsqa.com/ username: rapstaff pw: Succ3ss! And this is my script. *require rubygems # the Watir controller require watir # set a variable test_site = http://svvarmls.rapmlsqa.com/; # open the IE browser ie = Watir::IE.new # print some comments puts Beginning of test: Sedona Verde Valley puts Step 1: go to the test site: + test_site ie.goto test_site puts Step 2: enter username : rapstaff in the Agent ID field ie.text_field( :id, txtUserName ).set rapstaff puts Step 3: enter password : Succ3ss! in the Agent ID field` ie.text_field( :id, txtPassword ).set Succ3ss! puts Step 4: click the 'Submit' button. ie.button( :id, btnSubmit ).click puts Step 5: after navigate to http://login.rapmlsqa.com/BroadcastNotices.aspx?hidMLS=SDNA, click 'Read Later' button ie.button( :id, btnReadLater ).click * After clicking the Read Later button, it will prompt me to another page. In this page, from the very top, you can see there are several options: -- - Search - Listing - Tax - Contact - Links - Admin - Help - -- And this is a table with one row and 8 columns. The first element [1][1] is Search, which will call the JS to process all the search options. When you move your mouse over Search, you will see all the others options. I want to click on each individual option of Search( Quick Search, Custom Search ) to test, but I could not find a way to make it work. If you have a chance, would you mind taking a look at it? On Wed, Jul 28, 2010 at 7:33 AM, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Wed, Jul 28, 2010 at 3:57 PM, Chan Nguyen atbl1...@gmail.com wrote: My problem is that in our website, there are a lot of JavaScript. And I currently could not find a way for Watir to deal with JS. :( ! Our site also uses javascript and Watir works just fine. What is the problem? Željko -- 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.com
Re: [wtr-general] Re: How to access element in a table ?
I have just replied in another thread. Željko -- 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, If your credentials contain sensitive information, I strongly recommend changing the password as google has probably already indexed this thread Thanks a lot for your thoughtful concern. We definitely will change the password. Another question is that how where did you find the SubMenu information ? Could you show me? On Wed, Jul 28, 2010 at 7:41 AM, Basim Baassiri ba...@baassiri.ca wrote: Chan There are many solutions to your problem Try this one as it works for me require 'watir' test_site = http://svvarmls.rapmlsqa.com/; ie = Watir::IE.new ie.goto test_site ie.text_field( :id, txtUserName ).set rapstaff ie.text_field( :id, txtPassword ).set Succ3ss! ie.button( :id, btnSubmit ).click #ie.button( :id, btnReadLater ).click table = ie.table(:id,uwmMainMenu_MainM) table[1][1].fire_event onmouseover table[1][1].fire_event onmousedown table2 = ie.table(:class, SubMenu) table2[7][1].fire_event onmousedown table2[7][1].fire_event onmouseup If your credentials contain sensitive information, I strongly recommend changing the password as google has probably already indexed this thread Good Luck! Basim Baassiri On Wed, Jul 28, 2010 at 10:34 AM, Chan Nguyen atbl1...@gmail.com wrote: Hello Zeljko, I just tried to test our website.From my understanding, Watir has to know the information of attribute of each element.( Eg. id, name...ect ). However, our website have a lot of JavaScripts that deal with each element in a cell of a table. By that, I mean, I can access to the cell of a table. But this cell also has a list of other options. This is the site that I'm currently testing: http://svvarmls.rapmlsqa.com/ username: rapstaff pw: Succ3ss! And this is my script. *require rubygems # the Watir controller require watir # set a variable test_site = http://svvarmls.rapmlsqa.com/; # open the IE browser ie = Watir::IE.new # print some comments puts Beginning of test: Sedona Verde Valley puts Step 1: go to the test site: + test_site ie.goto test_site puts Step 2: enter username : rapstaff in the Agent ID field ie.text_field( :id, txtUserName ).set rapstaff puts Step 3: enter password : Succ3ss! in the Agent ID field` ie.text_field( :id, txtPassword ).set Succ3ss! puts Step 4: click the 'Submit' button. ie.button( :id, btnSubmit ).click puts Step 5: after navigate to http://login.rapmlsqa.com/BroadcastNotices.aspx?hidMLS=SDNA, click 'Read Later' button ie.button( :id, btnReadLater ).click * After clicking the Read Later button, it will prompt me to another page. In this page, from the very top, you can see there are several options: -- - Search - Listing - Tax - Contact - Links - Admin - Help - -- And this is a table with one row and 8 columns. The first element [1][1] is Search, which will call the JS to process all the search options. When you move your mouse over Search, you will see all the others options. I want to click on each individual option of Search( Quick Search, Custom Search ) to test, but I could not find a way to make it work. If you have a chance, would you mind taking a look at it? On Wed, Jul 28, 2010 at 7:33 AM, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Wed, Jul 28, 2010 at 3:57 PM, Chan Nguyen atbl1...@gmail.com wrote: My problem is that in our website, there are a lot of JavaScript. And I currently could not find a way for Watir to deal with JS. :( ! Our site also uses javascript and Watir works just fine. What is the problem? Željko -- 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 -- 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:
Re: [wtr-general] Re: How to access element in a table ?
HI Chan From my previous post, I used firebug to identify the element and with combination of irb and sending the events I was able to determine the submenu elements On Wed, Jul 28, 2010 at 10:49 AM, Chan Nguyen atbl1...@gmail.com wrote: Hi Basim, If your credentials contain sensitive information, I strongly recommend changing the password as google has probably already indexed this thread Thanks a lot for your thoughtful concern. We definitely will change the password. Another question is that how where did you find the SubMenu information ? Could you show me? On Wed, Jul 28, 2010 at 7:41 AM, Basim Baassiri ba...@baassiri.ca wrote: Chan There are many solutions to your problem Try this one as it works for me require 'watir' test_site = http://svvarmls.rapmlsqa.com/; ie = Watir::IE.new ie.goto test_site ie.text_field( :id, txtUserName ).set rapstaff ie.text_field( :id, txtPassword ).set Succ3ss! ie.button( :id, btnSubmit ).click #ie.button( :id, btnReadLater ).click table = ie.table(:id,uwmMainMenu_MainM) table[1][1].fire_event onmouseover table[1][1].fire_event onmousedown table2 = ie.table(:class, SubMenu) table2[7][1].fire_event onmousedown table2[7][1].fire_event onmouseup If your credentials contain sensitive information, I strongly recommend changing the password as google has probably already indexed this thread Good Luck! Basim Baassiri On Wed, Jul 28, 2010 at 10:34 AM, Chan Nguyen atbl1...@gmail.com wrote: Hello Zeljko, I just tried to test our website.From my understanding, Watir has to know the information of attribute of each element.( Eg. id, name...ect ). However, our website have a lot of JavaScripts that deal with each element in a cell of a table. By that, I mean, I can access to the cell of a table. But this cell also has a list of other options. This is the site that I'm currently testing: http://svvarmls.rapmlsqa.com/ username: rapstaff pw: Succ3ss! And this is my script. *require rubygems # the Watir controller require watir # set a variable test_site = http://svvarmls.rapmlsqa.com/; # open the IE browser ie = Watir::IE.new # print some comments puts Beginning of test: Sedona Verde Valley puts Step 1: go to the test site: + test_site ie.goto test_site puts Step 2: enter username : rapstaff in the Agent ID field ie.text_field( :id, txtUserName ).set rapstaff puts Step 3: enter password : Succ3ss! in the Agent ID field` ie.text_field( :id, txtPassword ).set Succ3ss! puts Step 4: click the 'Submit' button. ie.button( :id, btnSubmit ).click puts Step 5: after navigate to http://login.rapmlsqa.com/BroadcastNotices.aspx?hidMLS=SDNA, click 'Read Later' button ie.button( :id, btnReadLater ).click * After clicking the Read Later button, it will prompt me to another page. In this page, from the very top, you can see there are several options: -- - Search - Listing - Tax - Contact - Links - Admin - Help - -- And this is a table with one row and 8 columns. The first element [1][1] is Search, which will call the JS to process all the search options. When you move your mouse over Search, you will see all the others options. I want to click on each individual option of Search( Quick Search, Custom Search ) to test, but I could not find a way to make it work. If you have a chance, would you mind taking a look at it? On Wed, Jul 28, 2010 at 7:33 AM, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Wed, Jul 28, 2010 at 3:57 PM, Chan Nguyen atbl1...@gmail.com wrote: My problem is that in our website, there are a lot of JavaScript. And I currently could not find a way for Watir to deal with JS. :( ! Our site also uses javascript and Watir works just fine. What is the problem? Željko -- 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:
Re: [wtr-general] Re: How to access element in a table ?
Hi Basim, Thanks a lot for your clean explanation. ;) On Wed, Jul 28, 2010 at 8:27 AM, Basim Baassiri ba...@baassiri.ca wrote: HI Chan From my previous post, I used firebug to identify the element and with combination of irb and sending the events I was able to determine the submenu elements On Wed, Jul 28, 2010 at 10:49 AM, Chan Nguyen atbl1...@gmail.com wrote: Hi Basim, If your credentials contain sensitive information, I strongly recommend changing the password as google has probably already indexed this thread Thanks a lot for your thoughtful concern. We definitely will change the password. Another question is that how where did you find the SubMenu information ? Could you show me? On Wed, Jul 28, 2010 at 7:41 AM, Basim Baassiri ba...@baassiri.cawrote: Chan There are many solutions to your problem Try this one as it works for me require 'watir' test_site = http://svvarmls.rapmlsqa.com/; ie = Watir::IE.new ie.goto test_site ie.text_field( :id, txtUserName ).set rapstaff ie.text_field( :id, txtPassword ).set Succ3ss! ie.button( :id, btnSubmit ).click #ie.button( :id, btnReadLater ).click table = ie.table(:id,uwmMainMenu_MainM) table[1][1].fire_event onmouseover table[1][1].fire_event onmousedown table2 = ie.table(:class, SubMenu) table2[7][1].fire_event onmousedown table2[7][1].fire_event onmouseup If your credentials contain sensitive information, I strongly recommend changing the password as google has probably already indexed this thread Good Luck! Basim Baassiri On Wed, Jul 28, 2010 at 10:34 AM, Chan Nguyen atbl1...@gmail.comwrote: Hello Zeljko, I just tried to test our website.From my understanding, Watir has to know the information of attribute of each element.( Eg. id, name...ect ). However, our website have a lot of JavaScripts that deal with each element in a cell of a table. By that, I mean, I can access to the cell of a table. But this cell also has a list of other options. This is the site that I'm currently testing: http://svvarmls.rapmlsqa.com/ username: rapstaff pw: Succ3ss! And this is my script. *require rubygems # the Watir controller require watir # set a variable test_site = http://svvarmls.rapmlsqa.com/; # open the IE browser ie = Watir::IE.new # print some comments puts Beginning of test: Sedona Verde Valley puts Step 1: go to the test site: + test_site ie.goto test_site puts Step 2: enter username : rapstaff in the Agent ID field ie.text_field( :id, txtUserName ).set rapstaff puts Step 3: enter password : Succ3ss! in the Agent ID field` ie.text_field( :id, txtPassword ).set Succ3ss! puts Step 4: click the 'Submit' button. ie.button( :id, btnSubmit ).click puts Step 5: after navigate to http://login.rapmlsqa.com/BroadcastNotices.aspx?hidMLS=SDNA, click 'Read Later' button ie.button( :id, btnReadLater ).click * After clicking the Read Later button, it will prompt me to another page. In this page, from the very top, you can see there are several options: -- - Search - Listing - Tax - Contact - Links - Admin - Help - -- And this is a table with one row and 8 columns. The first element [1][1] is Search, which will call the JS to process all the search options. When you move your mouse over Search, you will see all the others options. I want to click on each individual option of Search( Quick Search, Custom Search ) to test, but I could not find a way to make it work. If you have a chance, would you mind taking a look at it? On Wed, Jul 28, 2010 at 7:33 AM, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Wed, Jul 28, 2010 at 3:57 PM, Chan Nguyen atbl1...@gmail.com wrote: My problem is that in our website, there are a lot of JavaScript. And I currently could not find a way for Watir to deal with JS. :( ! Our site also uses javascript and Watir works just fine. What is the problem? Željko -- 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
Re: [wtr-general] Re: How to access element in a table ?
Hi Basim, Could you help me explain why table[7][1] is a Quick Search ? I'm a bit confused about this case. Thanks, Chan Nguyen On Wed, Jul 28, 2010 at 8:29 AM, Chan Nguyen atbl1...@gmail.com wrote: Hi Basim, Thanks a lot for your clean explanation. ;) On Wed, Jul 28, 2010 at 8:27 AM, Basim Baassiri ba...@baassiri.ca wrote: HI Chan From my previous post, I used firebug to identify the element and with combination of irb and sending the events I was able to determine the submenu elements On Wed, Jul 28, 2010 at 10:49 AM, Chan Nguyen atbl1...@gmail.com wrote: Hi Basim, If your credentials contain sensitive information, I strongly recommend changing the password as google has probably already indexed this thread Thanks a lot for your thoughtful concern. We definitely will change the password. Another question is that how where did you find the SubMenu information ? Could you show me? On Wed, Jul 28, 2010 at 7:41 AM, Basim Baassiri ba...@baassiri.cawrote: Chan There are many solutions to your problem Try this one as it works for me require 'watir' test_site = http://svvarmls.rapmlsqa.com/; ie = Watir::IE.new ie.goto test_site ie.text_field( :id, txtUserName ).set rapstaff ie.text_field( :id, txtPassword ).set Succ3ss! ie.button( :id, btnSubmit ).click #ie.button( :id, btnReadLater ).click table = ie.table(:id,uwmMainMenu_MainM) table[1][1].fire_event onmouseover table[1][1].fire_event onmousedown table2 = ie.table(:class, SubMenu) table2[7][1].fire_event onmousedown table2[7][1].fire_event onmouseup If your credentials contain sensitive information, I strongly recommend changing the password as google has probably already indexed this thread Good Luck! Basim Baassiri On Wed, Jul 28, 2010 at 10:34 AM, Chan Nguyen atbl1...@gmail.comwrote: Hello Zeljko, I just tried to test our website.From my understanding, Watir has to know the information of attribute of each element.( Eg. id, name...ect ). However, our website have a lot of JavaScripts that deal with each element in a cell of a table. By that, I mean, I can access to the cell of a table. But this cell also has a list of other options. This is the site that I'm currently testing: http://svvarmls.rapmlsqa.com/ username: rapstaff pw: Succ3ss! And this is my script. *require rubygems # the Watir controller require watir # set a variable test_site = http://svvarmls.rapmlsqa.com/; # open the IE browser ie = Watir::IE.new # print some comments puts Beginning of test: Sedona Verde Valley puts Step 1: go to the test site: + test_site ie.goto test_site puts Step 2: enter username : rapstaff in the Agent ID field ie.text_field( :id, txtUserName ).set rapstaff puts Step 3: enter password : Succ3ss! in the Agent ID field` ie.text_field( :id, txtPassword ).set Succ3ss! puts Step 4: click the 'Submit' button. ie.button( :id, btnSubmit ).click puts Step 5: after navigate to http://login.rapmlsqa.com/BroadcastNotices.aspx?hidMLS=SDNA, click 'Read Later' button ie.button( :id, btnReadLater ).click * After clicking the Read Later button, it will prompt me to another page. In this page, from the very top, you can see there are several options: -- - Search - Listing - Tax - Contact - Links - Admin - Help - -- And this is a table with one row and 8 columns. The first element [1][1] is Search, which will call the JS to process all the search options. When you move your mouse over Search, you will see all the others options. I want to click on each individual option of Search( Quick Search, Custom Search ) to test, but I could not find a way to make it work. If you have a chance, would you mind taking a look at it? On Wed, Jul 28, 2010 at 7:33 AM, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Wed, Jul 28, 2010 at 3:57 PM, Chan Nguyen atbl1...@gmail.com wrote: My problem is that in our website, there are a lot of JavaScript. And I currently could not find a way for Watir to deal with JS. :( ! Our site also uses javascript and Watir works just fine. What is the problem? Željko -- 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:
[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);
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