Test URL: https://demo.automationtesting.in/Ale...
Playwright Code:
def handle_dialog(dialog):
message = dialog.message
text_alert.append(message)
dialog.accept()
with sync_playwright() as p:
browser = p.chromium.launch(headless=False)
page = browser.new_page()
page.goto('https://demo.automationtesting.in/Ale...)
page.wait_for_selector('//a[@href="#CancelTab"]').click()
page.wait_for_timeout(2000)
page.on("dialog",handle_dialog)
page.wait_for_selector('//div[@id="CancelTab"]/button').click()
page.wait_for_timeout(2000)
print(text_alert[0])
To Contact:
Twitter : / 10prasanth1994
Facebook: / prasanth31395
Telegram: https://t.me/Prasanth23494
LinkedIn: / prasanth-. .
Instagram: / prasanth23494
#softwaretesting #automationtesting #qaautomation #interviewpreparation #latestjobs #manualtesting #webautomation #microsoft