Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

316
Views
How do I get a popup validation message from a page using selenium Python?

How do I get the popup validation message "Please tick this box if you want to continue" using Selenium Python in the photo?

<input oninvalid="this.setCustomValidity('Please tick this box if you want to proceed')" oninput="this.setCustomValidity('')" class="form-check-input checkbox-switch-md" type="checkbox" id="registerTermsCheckboxId" required="">
enter image description here

Screenshot

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Try the below, I hope this will solve your issue.

from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait


toolTip = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, 'registerTermsCheckboxId')))
hov = ActionChains(driver).move_to_element(toolTip)
txt = hov.perform()
tooltipText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, 'registerTermsCheckboxId'))).text
print(tooltipText)
about 4 years ago · Juan Pablo Isaza Report

0

Found a solution to the problem, where I was able to extract the text in the validation message with the following JavaScriptExecutor code:

message_element = driver.find_element(By.XPATH, Locators.acceptCheckButton_xpath)
accept_button_message = driver.execute_script("return arguments[0].validationMessage", message_element)
print("Message : ", accept_button_message)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!