[英]OpenQA.Selenium.ElementNotInteractableException : element not interactable
i was doing some test and when i run a test with a searcher that i already work for and this error appear我正在做一些测试,当我使用我已经为之工作的搜索器运行测试时,出现了这个错误
System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
----> OpenQA.Selenium.ElementNotInteractableException : element not interactable
then i tried to run a test that i knew that worked and when it was time to use the searcher, the same error appear, it's kinda weird because i don't see any diference in the HTML code, and the searcher does work if i enter to the page manually.然后我尝试运行一个我知道有效的测试,当该使用搜索器时,出现相同的错误,这有点奇怪,因为我没有看到 HTML 代码有任何差异,如果我搜索器确实可以工作手动进入页面。
this is my code to manipulate the searcher:这是我操纵搜索器的代码:
[FindsBy(How = How.CssSelector, Using = "input")]
private IWebElement buscadorConfig;
public ConfigurationUsuario buscarTabla(string input_search)
{
buscadorConfig.SendKeys(input_search);
return new ConfigurationUsuario(driver);
}
Here is an example of any test that use it:以下是使用它的任何测试的示例:
usuario.clickConfiguration();
System.Threading.Thread.Sleep(2000);
configuracion.buscarTabla("041097");
System.Threading.Thread.Sleep(2000);
And this is the HTML code for the searcher:这是搜索器的 HTML 代码:
<div id="table_filter" class="dataTables_filter">
<label>Search:<input type="search" class="" placeholder="" aria-controls="table"></label>
</div>
To be honest i don't know why all of a sudden the searcher stop working in my test script, i have like 10 test that use it and know none of them works, i literally change anything, i don't know if the devs did but i hope you guys can help me.老实说,我不知道为什么搜索者突然停止在我的测试脚本中工作,我有 10 个使用它的测试并且知道它们都不起作用,我真的改变了任何东西,我不知道开发人员是否做了,但我希望你们能帮助我。
You can use a more canonical Locator Strategy as follows:您可以使用更规范的定位器策略,如下所示:
[FindsBy(How = How.CssSelector, Using = "input[aria-controls='table'][type='search']")]
private IWebElement buscadorConfig;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.