Welcome to the Question and Answer site for Software Testing Professionals

You can get your queries resolved from Software Testing Professionals.

Ask a Question

Get answers and give answers to questions from other members.

View All Questions

Get votes and earn points to build your reputation in community.

View Hot Questions

Unable to close the pop up modal (Note : Pop up modal is application related and not from the browser)

Open 1 Answers 25 Views
1 1
The code should create the task modal and should close the modal. Am not getting any exception or error but the modal window is not closing. Below is the code:

public void addTask() throws Exception {

            driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);
            WebElement titleField =  driver.findElement(By.id("form-task_name"));
            //driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);
            if(titleField.getAttribute("value").isEmpty()) {
                System.out.println("Please enter Title for the task");
                System.out.println("Task has been created");
            driver.findElement(By.className("close")).click(); -> This line is not working

1 Answer

If the pop up is not part of your browser window, it can not be handled by selenium. As selenium is totally developed using JavaScript. JavaScript can not handle such pop ups as it's not a part of browser. So, selenium will not be able to work with it.


You should start using third party tools like Sikuli or AutoIT.
answered Sep 13, 2017 by anonymous
commented Sep 14, 2017 by Priyanka91 (91 points)
Thank you for the reply!

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

We have resolved 1.2k+ Software Testing queries!

Software Testing Board Weekly update

We will send you handpicked questions that you would love to answer.

View previous campaigns.

Top Contributors