More common locators

Jakub Raczek edited this page Apr 24, 2017 · 5 revisions

Web element locators in our framework can be parameterized "//*[@title='{0}' and @ms.title='{1}']" by using 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("first_file.txt")).Click();
this.Driver.GetElement(this.fileLink.Format("second_file.txt")).Click();
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.