C#Selenium webelement.Click抛出异常不可交互
href =“ https://i.sstatic.net/ij4sm.jpg” rel =“ nofollow noreferrer”>在这里输入映像
当我启动程序时,它启动并运行正常,直到它进行到我希望驱动程序单击按钮的地步,它给我抛出了Web元素的异常,这并不棘手。我尝试了很多方法,但它们都没有用。我认为的问题是,当此按钮单击时,HTML会更改。请帮助:D
这是使我驱动异常的代码行(C#):
driver.FindElement(By.XPath("//button[@id='exifInfoMobile']")).Click();
错误:OpenQA.Selenium.ElementNotInteractableException:'元素不可交互 (会话信息:Chrome = 103.0.5060.114)'
这是HTML:
<li class="photo-info">
<button class="btn btn-photo-info" id="exifInfoMobile">
<span class="text">info</span>
</button>
</li>
我尝试使用WebDriverWait,按class Name和ID尝试,但它不起作用。我认为这与模型有关,因为当单击此按钮时,网站html通过在右侧添加信息面板来更改。再次对不起问题,但这是我第一次在这里问一个。
When I start the program, it starts and runs fine until it goes to the point where I want the driver to click the button and it throws me the exception the web element not intractable. I've tried a lot of methods but none of them worked. The problem I think is that when this button is clicked the HTMl changes. Please help :D
this is the line of code that trows me the exception (C#) :
driver.FindElement(By.XPath("//button[@id='exifInfoMobile']")).Click();
error : OpenQA.Selenium.ElementNotInteractableException: 'element not interactable
(Session info: chrome=103.0.5060.114)'
and this is the HTML :
<li class="photo-info">
<button class="btn btn-photo-info" id="exifInfoMobile">
<span class="text">info</span>
</button>
</li>
I've tried with WebDriverWait , By class name and by id but it didn't work. I think it has something to do with a model because when this button is clicked, the sites html changes by adding an info panel on the right. Sorry again for the bad question but its my first time asking one here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论