Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
756 views
in Technique[技术] by (71.8m points)

javascript - Using jQuery to close alert, get alert's text

I am working on a Java project and I need to use jQuery (it is my task). Now I need to handle an alert and verify that the message I need is displayed. I dug up a bunch of information, but all of it is about creating alerts and etc.

enter image description here

Could someone explain it to me how it works and how I need to use it? Maybe it is impossible? I am using jQuery in my task.

At this time I have this code and I need to add functionality described above.

public void getCoordinates() {
    JavascriptExecutor js = (JavascriptExecutor) driver;

    js.executeScript("var position = $('.flash').position();" +
    "$('#top').val(Math.round(position.top));" +
    "$('#left').val(Math.round(position.left));" +
    "$('#process').click();");
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...