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 24, 2020 in Selenium by Mayank
• 120 points
5,435 views
Create a login account and try automating it.. or else use alerts to close the pop up

4 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, 2020 by Sirajul
• 59,230 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, 2020 by Pavan Andi
0 votes

use this command

driver.switchTo().alert().dismiss()
answered Jun 30, 2020 by Purushottam Rockks
0 votes
did you find solution for this?
answered Nov 5, 2020 by anonymous

reshown Nov 5, 2020 by Sirajul
Hey, Have you tried the solutions mentioned above?
Yes, but it's not working. can you please send me code. I am struggling it for whole day
Hey, what's the error you are getting?

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 6, 2018 in Selenium by nsv999
• 5,500 points
10,529 views
0 votes
2 answers

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

JavascriptExecutor jsx = (JavascriptExecutor)driver; jsx.executeScript("window.scrollBy(0,555)", ""); or Action classes ...READ MORE

answered Sep 6, 2020 in Selenium by Sri
• 3,190 points
18,882 views
+10 votes
17 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
197,754 views
0 votes
2 answers
0 votes
2 answers

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,500 points
13,598 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,099 views
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,910 points
7,189 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,848 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
• 59,230 points
7,946 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, 2020 in Selenium by Sirajul
• 59,230 points
2,079 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP