我有以下问题: 我有一个使用硒(版本:2.43.0)的Java代码来解析我的登录网页(我无法更改)与Firefox的驱动程序。 在我的Windows机器上 - 我能够得到我的元素,并使用sendKeys填充,然后使用安装的Firefox提交表单。ElementNotVisibleException只在亚马逊EC2实例与硒,Firefox和xvfb运行
我现在感兴趣搬到ec2。我创建了一个亚马逊实例 (os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.35-43.137.amzn1.x86_64', java.version: '1.7.0_51'
)。
为了运行硒,我安装了Firefox,使用this blog post进行了微小的修改(安装了firefox版本:32.0.3,而不是原始脚本),并且我使用xvfb-run来运行firefox。
的页面似乎在机器上加载,我要寻找的元素被发现(或者至少看起来是这样),但是当我尝试element.sendKeys("testUserName");
我得到以下异常: org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with
其他答案建议使用Actions actions = new Actions(driver); actions.moveToElement(element).build().perform();
但这并没有帮助。我仍然得到相同的例外。
任何想法?
你有没有找到一个解决这个?我想我有同样的问题:http://stackoverflow.com/questions/35607021/elementnotvisibleexception-only-in-virtual-display – Sheena 2016-02-24 16:03:51