|
RE: links: msg#00062web.selenium.user
Excerpt from Reference.html: <quote> Without a locator prefix, Selenium uses: * dom, for locators starting with "document." * xpath, for locators starting with "//" * identifier, otherwise </quote> This means that: xpath=//td[text()='Problems'] is the same thing as: //td[text()='Problems'] Note: @text() is not valid. ===== | click | //td[text()='Problems'] | | Means: Simulate a click on the first <td> you find for which the text inside it is 'Problems'. This will find a <td> like this: <td anything="anything"...>Problems</td> and simulate a click on that <td>. Attached is a TestSuite.html and Test1.html that will do just that. Dump those in your selenium/tests directory and try it. - Guillaume Boudreau -----Original Message----- From: Chen, Shu-Dan [mailto:SCHEN8-1MWEUZGqHkXRnqqr4xx/QQ@xxxxxxxxxxxxxxxx] Sent: Monday, October 17, 2005 3:38 PM To: bougu-TvhO4Lsh14F0ubjbjo6WXg@xxxxxxxxxxxxxxxx; selenium-users-EcuzILgp2tAZVhN9JVcPDEqbzN8AcRLmILAQCsJbaHk@xxxxxxxxxxxxxxxx Subject: RE: [Selenium-users] links I'm sorry. I am still new at this. It didn't work for me. I've even changed it to this to see if it made any difference: click xpath=//td[@text()='Problems'] Could you please explain why you did the following? Thanks a lot! -----Original Message----- From: selenium-users-bounces-EcuzILgp2tAZVhN9JVcPDEqbzN8AcRLmILAQCsJbaHk@xxxxxxxxxxxxxxxx [mailto:selenium-users-bounces-EcuzILgp2tAZVhN9JVcPDEqbzN8AcRLmILAQCsJbaHk@xxxxxxxxxxxxxxxx]On Behalf Of Guillaume Boudreau Sent: Friday, October 14, 2005 3:46 PM To: selenium-users-EcuzILgp2tAZVhN9JVcPDEqbzN8AcRLmILAQCsJbaHk@xxxxxxxxxxxxxxxx Subject: RE: [Selenium-users] links click //td[text()='Problems'] To test, I changed "banner.handleDestinationTable(8,null,this)" in your HTML to "document.location.href='http://www.google.com'" and this click action indeed made Google load in the test frame. Bam! :) - Guillaume Boudreau -----Original Message----- From: selenium-users-bounces-EcuzILgp2tAZVhN9JVcPDEqbzN8AcRLmILAQCsJbaHk@xxxxxxxxxxxxxxxx [mailto:selenium-users-bounces-EcuzILgp2tAZVhN9JVcPDEqbzN8AcRLmILAQCsJbaHk@xxxxxxxxxxxxxxxx] On Behalf Of Chen, Shu-Dan Sent: Friday, October 14, 2005 3:30 PM To: selenium-users-EcuzILgp2tAZVhN9JVcPDEqbzN8AcRLmILAQCsJbaHk@xxxxxxxxxxxxxxxx Subject: [Selenium-users] links Hi - I am trying to click on the link Problems, but I don't know how to. How would I write a script to click on a link like this one? <tr destination="/problems.asp"> <td class="banner_SelectCell" onmouseover="banner.handleDestinationTable(3,this)" onmouseout="banner.handleDestinationTable(4,this)"><img height="10" width="10" src="/oncall/graphics/banner/check.gif" style="visibility: hidden"></td> <td class="banner_SelectCell" onclick="banner.handleDestinationTable(8,null,this)" onmouseover="banner.handleDestinationTable(5,null,this)" onmouseout="banner.handleDestinationTable(6,null,this)" nowrap="true">Problems</td> </tr> Thanks! _______________________________________________ Selenium-users mailing list Selenium-users-EcuzILgp2tAZVhN9JVcPDEqbzN8AcRLmILAQCsJbaHk@xxxxxxxxxxxxxxxx http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users _______________________________________________ Selenium-users mailing list Selenium-users-EcuzILgp2tAZVhN9JVcPDEqbzN8AcRLmILAQCsJbaHk@xxxxxxxxxxxxxxxx http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users
Selenium-users mailing list Selenium-users-EcuzILgp2tAZVhN9JVcPDEqbzN8AcRLmILAQCsJbaHk@xxxxxxxxxxxxxxxx http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users |
|
||||||||||||||||||||||
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: links: 00062, Chen, Shu-Dan |
|---|---|
| Next by Date: | RE: Select and Close "PDF" Popup Window: 00062, Guillaume Boudreau |
| Previous by Thread: | RE: linksi: 00062, Chen, Shu-Dan |
| Next by Thread: | Using variables for open command's url: 00062, Guillaume Boudreau |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |