Skip to content

More common locators

Jakub Raczek edited this page Aug 14, 2016 · 5 revisions

Web elements locators can be parameterized "//*[@title='{0}' and @ms.title='{1}']" by Format method.

Example how to use it:

private readonly ElementLocator fileLink = new ElementLocator(Locator.CssSelector, "a[href='download/{0}']");
...
this.Driver.GetElement(this.fileLink.Format("some-file.txt")).Click();
Clone this wiki locally