# Automation Setup
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchAttributeException, NoAlertPresentException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import time
# Setting the path for Chrome driver
PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
# Opening Badoo website
driver.get("https://am1.badoo.com/sv/mobile/")
driver.maximize_window()
username = "*************"
password = "*************"
print(driver.title)
time.sleep(5)
# Logging in
search = driver.find_element_by_xpath('//*[@id="header"]/div/div[2]/div/div[2]/a')
search = driver.find_element_by_partial_link_text('Logga in')
search.send_keys(Keys.RETURN)
time.sleep(5)
print("Logging in")
search = driver.find_element_by_name('email')
search.send_keys(username)
search = driver.find_element_by_name('password')
search.send_keys(password)
time.sleep(2)
search = driver.find_element_by_xpath('//*[@id="page"]/div[1]/div[3]/section/div/div/div[1]/form/div[5]/div/div[1]/button').click()
time.sleep(5)
# Clicking on the like button
search = driver.find_element_by_xpath('//*[@id="mm_cc"]/div[1]/section/div/div[2]/div/div[2]/div[1]/div[1]').click()
time.sleep(1)
# Handling popup
search = driver.switch_to.alert
message=search.text
print ("Alert shows following message: "+ message )
time.sleep(2)
search.dismiss()
I am struggling to handle a popup while automating interactions with the Badoo dating application. The popup appears when you like someone, and I need help figuring out how to interact with it by clicking accept or decline.
Can anyone provide guidance on this issue?
Thank you in advance :)
Screenshots of the popup can be viewed here: https://i.sstatic.net/jWSNp.png
Unfortunately, I am unable to copy the HTML code, but screenshots are available here: https://i.sstatic.net/EDIxu.jpg https://i.sstatic.net/xLNww.jpg