I have a code that works in other computer, but when I tried to build in mine, I had error.
Severity Code Description Project File Line Suppression State Error CS1528 Expected ; or = (cannot specify constructor arguments in declaration)"
protected IWebElement GetElementByCssSelector(string selector, int? timeout = null, bool useTimeout = true)
{
IWebElement GetElement() => Driver.FindElement(By.CssSelector(selector)); // LINE WITH ERROR //
if (!useTimeout)
return GetElement();
timeout = timeout ?? defaultTimeout;
var wait = new WebDriverWait(Driver, TimeSpan.FromSeconds(timeout.Value));
wait.Until(x => GetElement().Displayed);
return GetElement();
}
I already tried to update the references and it didn´t work.