I'm setting up a system to automate a routine here in the company, but it has a specific site that uses the form
field within TD
's / TR
' s, so I used:
driver.FindElement(By.XPath("//input[@name='user']")).SendKeys("Teste");
But it returns me:
OpenQA.Selenium.NoSuchElementException: 'Unable to find element with xpath == // input [@ name =' user ']'
But validating in Chrome Xpath, is correct.
Note: I tried to use FindElements
, there it finds, but I can not get the SendKeys
command is not part of it.
BelowisalsotheformHTMLthatI'maccessing.
<tbody><tr><td colspan="2" bgcolor="#ffffff" align="center"><font size="3" face="Verdana"><b>Identificação do Usuário</b></font></td></tr>
<tr><td> </td></tr>
<tr>
<td><font size="2" face="Verdana"><b>Usuário</b></font></td>
<td align="right"><input name="user"></td>
</tr>
<tr>
<td><font size="2" face="Verdana"><b>Senha</b></font></td>
<td align="right"><input type="password" name="passwd"></td>
</tr>
<tr>
<td><font size="2" face="Verdana"><b>Ramal</b></font></td>
<td align="right"><input name="ramal" maxlength="10"></td>
</tr>
<tr><td> </td></tr>
<tr><td colspan="2" align="center">
<input type="submit" name="entrar" value="Acessar" style="width:100px" language="javascript" onclick="return entrar_onclick()">
<input type="submit" name="senha" value="Alterar Senha" style="width:100px" language="javascript" onclick="return senha_onclick()">
</td></tr>