In webdriver, with c#, you can define a html element using this:
//Textfields
public static IWebElement userFieldElement
{
get {return Configuration.driver.FindElement(By.XPath(".//input[@name='USER']"));}
}
Is it there an abbreviated way of defining the same? I have tried:
public static IWebElement passwordFiedfElement = Configuration.driver.FindElement(By.XPath(".//input[@name='USER']"));
But it is invalid because webdriver tries to find all the elements defined in this way if the class that contains them is called for any reason. The first method works, anyway.