如何使用 selenium 在模态中向下滚动
我不知道如何向下滚动模式窗口。 我尝试了下面的方法,但是整个外部窗口的滚动向下,而不是模态窗口。
WebElement element = webDriver.findElement(By.xpath("//body/*[last()]"));
((JavascriptExecutor) webDriver).executeScript("arguments[0].scrollIntoView(true)", element);
我将附上该网站,但您必须尝试登录才能在模式窗口中查看作者列表
I don't know how to scroll down the modal window.
I tried the method below, but the scroll of the entire outer window goes down, not the modal window.
WebElement element = webDriver.findElement(By.xpath("//body/*[last()]"));
((JavascriptExecutor) webDriver).executeScript("arguments[0].scrollIntoView(true)", element);
I will attach the site, but you have to try to log in to check the list of authors in the modal window
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果模式位于 Iframe 中,请切换到 iFrame,然后尝试向下滚动
或使用下面的
方法 1
方法 2
If modal is in Iframe than, Switch to iFrame and then try to scroll down
or use the below
Method 1
Method 2