Java Selenium元素当前不可见,因此可能无法与角度模态对话框交互
我正试图与隐藏在Div中的一个角度引导模式对话框进行交互,单击链接时弹出该对话框,Selenium正在抛出Java Selenium元素当前不可见,因此可能无法与角度模态对话框交互,java,html,eclipse,selenium-webdriver,angular-ui-bootstrap,Java,Html,Eclipse,Selenium Webdriver,Angular Ui Bootstrap,我正试图与隐藏在Div中的一个角度引导模式对话框进行交互,单击链接时弹出该对话框,Selenium正在抛出 org.openqa.selenium.ElementNotVisibleException: Element is not currently visible. 因为它不是JavaScript警报,也不是新窗口,所以我不能使用警报或WindowHandles Api 我的心流走了 driver.findElement(By.xpath("//span[text()='Promotio
org.openqa.selenium.ElementNotVisibleException: Element is not currently visible.
因为它不是JavaScript警报,也不是新窗口,所以我不能使用警报或WindowHandles Api
我的心流走了
driver.findElement(By.xpath("//span[text()='Promotional Code']")).click(); //link in menu that launches the dialog box
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); //I do an implicit wait to make sure the dialog box loads
driver.findElement(By.id("promobox")).sendKeys("test");//Attempting to enter test in dialog box, but error gets thrown.
我可以用
System.out.println(driver.findElement(By.id("promobox")).isDisplayed());
它将在控制台上打印为true,但当我尝试执行
driver.findElement(By.id("promobox")).sendKeys("test");
我有个例外
有什么想法吗?否则,我们将不胜感激。我正在使用最新版本的SWD 2.45和FF 35.01,提前谢谢 我觉得
隐式等待()
不是你想象的那样。尝试运行一个PauseAction
(如中所示),然后您可能会得到您需要的。谢谢!这让我走上了正确的方向,我现在至少可以点击弹出窗口中的取消和提交按钮,这样做谢谢!这让我走上了正确的方向,我现在至少可以单击弹出窗口中的“取消”和“提交”按钮来执行此驱动程序。findelelement(By.xpath(//span[text()='Promotional Code'])。click();Actions promobox=新操作(驱动程序);暂停(30);promobox.build().perform();但是,如果我试图通过执行promobox.sendKeys(driver.findElement(by.xpath(“./*[@id='promobox'])),“test”)向框中输入任何内容;我有一个移动目标是自动边界有什么想法吗?