Re: [Wonder-disc] ERSelenium without ERExtensions
Re: [Wonder-disc] ERSelenium without ERExtensions
- Subject: Re: [Wonder-disc] ERSelenium without ERExtensions
- From: Denis Frolov <email@hidden>
- Date: Sat, 30 Jun 2007 15:27:29 +0400
On Jun 30, 2007, at 3:08 PM, Michael Bushkov wrote:
How do you handle "clicking" on component action links?
We try to use "link" locators and simple xpath where possible:
|clickAndWait|link=Return Hat||
and
|clickAndWait|//button[@value='Next']||
Here is also the ugly, but powerful example from the BugTracker's
set of tests (I guess it's the only way there to emulate clicking
on the 'Comment' link in the '__SeleniumBugSubject' bug's row):
|clickAndWait|//td[contains(text(), '__SeleniumBugSubject')]/
parent::*/preceding-sibling::tr[position() = 1]//a[text() =
'Comment']||
Here is a somewhat cleaner example of xpath which will locate a link
in the cell of the row with '__SeleniumBugSubject' text in it (we
assume here that there only one link in a row):
//tr[contains(string(), '__SeleniumBugSubject')]/td/a
Not that ugly, huh? Xpath is not as clean as id locator, but it is
pretty powerful. I tend to think that it is a better choice for
developer than applying ids to all the needed elements.
--
Denis
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden