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:[EMAIL PROTECTED] 
Sent: Monday, October 17, 2005 3:38 PM
To: [EMAIL PROTECTED]; selenium-users@lists.public.thoughtworks.org
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=//[EMAIL PROTECTED]()='Problems']

Could you please explain why you did the following?

Thanks a lot!

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Guillaume Boudreau
Sent: Friday, October 14, 2005 3:46 PM
To: selenium-users@lists.public.thoughtworks.org
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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Chen, Shu-Dan
Sent: Friday, October 14, 2005 3:30 PM
To: selenium-users@lists.public.thoughtworks.org
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@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users

_______________________________________________
Selenium-users mailing list
Selenium-users@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users
Click on your td
Test a click on a td
Test a click on a td
open tests/your_page.html
click //td[text()='Problems']
_______________________________________________
Selenium-users mailing list
Selenium-users@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users

Reply via email to