英文:
Unable to close the cdk dropdown in automation using selenium with javascript and jest framewok
问题
在CDK多选下拉框中,当我点击下拉以打开它时,它在整个屏幕上创建一个遮罩,因此屏幕外的元素都不可点击,因此我无法通过Selenium WebDriver执行点击事件。它始终显示一个元素不可交互的异常,当我提供隐式等待时,它不会显示任何异常,但下拉框仍然保持打开状态。
英文:
In CDK multi-select dropdown, when I click dropdown to open it make a mask on whole screen as a result there are no elements outside that is clickable, due to this I am not able to perform click event on it through selenium webdriver. It always shows an exception that element not interactable and when I provide implicit wait then it does not shows any exception but the dropdown remains open.
答案1
得分: 0
我搜索了很多,最终找到了一个解决方法,即在Selenium Web驱动中有一个executeScript
方法可以解决我的问题。我在参数中使用了driver.executeScript("")
,我以字符串的形式插入了DOM方法,以点击坐标来关闭下拉菜单,但我不明白它是如何工作的。
英文:
I search a lot and finally got a solution that there is an executeScript
in selenium web-driver which solve my problem. I used driver.executeScript("")
in parameter I inserted DOM method in form of string to click the coordinate to close the dropdown but I don't get how it works.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论