English 中文(简体)
登峰时的测试 st。
原标题:Test gets stuck when popup appears

我有一个网络驾驶考试,在点击链接上打开了一张 j印确认书,但一旦确认书出现,测试就会陷入停顿。 在我人工点击确认箱中的O或Cancel之前,测试中的其余编码线没有执行。 请参看以下守则:

private WebDriver webDriver;

@Test
public void testClickButton() {

webDriver = getFireFoxDriver();

webDriver.findElement(By.xpath("//a[text() =  Delete ]")).click();

//JAVASCRIPT CONFIRMATION COMES UP AND THE TEST GETS STUCK!
//THE BELOW LINE DOES NOT EXECUTE UNTIL THE CONFIRMATION IS MANUALLY CLICKED.
closePopUp();
}

我只想到这一问题。 测试对IEE以及 Chrome进行罚款。

https://stackoverflow.com/questions/8034497/webdriver-closing-the-popup>。 网络司机在填满时,建议用java文字将烟pop化作为周围的工作。 不过,我想知道,在不使用java文字的情况下,是否还有其他选择。 这可能有助于我理解这一问题的根源。 我试图在连接点点点点击后再加起来,只剩下几毫秒钟,但却没有帮助。 疏远,也无帮助。

任何想法?

问题回答

我接受这种结束语:

Alert alert = driver.switchTo().alert();
alert.accept();

它不是 j,而是发挥作用。 你们也可以解雇。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签