0
I am unable to use the Firstordefault method with Selenium
public IWebElement RetornaRegistro(string titulo)
{
var trs = _driver.FindElement(By.CssSelector("table tbody tr"));
var alvo = trs.FirstOrDefault(tr => tr.Text.Contains(titulo));
if (alvo == null)
{
throw new System.ArgumentException("Erro ao buscar a tarefa cadastrada.");
}
return alvo;
}
Displays the following error:
Severity Code Description Project File Line Suppression State Error CS1061 'Iwebelement' does not contain a Definition for 'Firstordefault' and no Extension method 'Firstordefault' Accepting a first argument of type 'Iwebelement' could be found (are you Missing a using Directive or an Assembly Reference?) Mark7 C: Users Rodrigo.rebes source Mark7 Mark7 Pages Taskpage.Cs 33 Active