How to close login pop up message in Selenium Webdriver?

0 votes

I am a beginner in learning Selenium and I am stuck at an issue.

I was trying to automate the make my trip website and right after opening the website using get() method, I am getting a login pop up.

Please help me to understand as to how do I close the pop up? Screenshot attached:

URL used: https://www.makemytrip.com/

Jun 23 in Selenium by Mayank
• 120 points
112 views
Create a login account and try automating it.. or else use alerts to close the pop up

3 answers to this question.

0 votes

Assuming it to be a simple pop-up that appears when you are entering the page and it is present in main window itself. Use the below code to close it.

driver.find_element_by_xpath('//div[contains(@class,"ui-dialog") and @aria-describedby="dialogContent2"]//button[@title="Close"]').click()
answered Jun 24 by Sirajul
• 55,220 points
0 votes

PlZ use this element and click it

//p[contains(text(),’Login or Create Account’)] 

it will move focus from pop up

answered Jun 25 by Pavan Andi
0 votes

use this command

driver.switchTo().alert().dismiss()
answered Jun 30 by Purushottam Rockks

Related Questions In Selenium

0 votes
1 answer

How to handle Pop-up in Selenium WebDriver using Java

Actually, its pretty simple. Use this code ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,510 points
7,066 views
0 votes
1 answer

How to scroll the Page up or down in Selenium WebDriver? (using java)

Its pretty simple. Check out the below ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,510 points
12,556 views
+9 votes
15 answers

How to automate gmail login process using selenium webdriver in java?

Check the below code: Here is the working ...READ MORE

answered Apr 24, 2018 in Selenium by Vardy
• 2,360 points
113,222 views
0 votes
2 answers
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,510 points
3,078 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,890 points
2,341 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,890 points
2,487 views
+2 votes
1 answer

C Sharp with Selenium -- How to Switch one tab to another tab in Csharp selenium

You could use Session.Driver.WindowHandles which is basically to switch ...READ MORE

answered Dec 23, 2019 in Selenium by Sirajul
• 55,220 points
1,135 views
+3 votes
1 answer

How to read excel file numeric data of all rows and column in selenium? I have 10 rows and 5 column but I read Only String value not a Numeric value?

Hey, @Mahendra, check this thread https://www.edureka.co/community/52170/read-numeric-data-from-excel-sheet-using-selenium-webdriver It deals with ...READ MORE

answered Jan 27 in Selenium by Sirajul
• 55,220 points
296 views