Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: [Wonder-disc] ERSelenium without ERExtensions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Wonder-disc] ERSelenium without ERExtensions



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


References: 
 >Re: [Wonder-disc] ERSelenium without ERExtensions (From: Chuck Hill <email@hidden>)
 >Re: [Wonder-disc] ERSelenium without ERExtensions (From: Steven Mark McCraw <email@hidden>)
 >Re: [Wonder-disc] ERSelenium without ERExtensions (From: Chuck Hill <email@hidden>)
 >Re: [Wonder-disc] ERSelenium without ERExtensions (From: Michael Bushkov <email@hidden>)
 >Re: [Wonder-disc] ERSelenium without ERExtensions (From: Chuck Hill <email@hidden>)
 >Re: [Wonder-disc] ERSelenium without ERExtensions (From: Michael Bushkov <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.