Captcha Field in Web Page

Web Elements & Operations on the Web Elements, Selenium Element Locators, Selenium WebDriver API Commands, Writing Test Steps, Inserting Verification Points, Inserting Comments and exception Handling.
Post Reply
Gowtham Ramesh
Posts: 66
Joined: Thu Nov 22, 2018 5:23 am

Captcha Field in Web Page

Post by Gowtham Ramesh » Mon Dec 03, 2018 1:42 pm

How to handle captcha field in web forms?
(Can Selenium Read Data from Captcha and Enter or Manually we enter Captch data for Test Cases)

ramarajak
Posts: 4
Joined: Fri Nov 30, 2018 12:11 pm

Re: Captcha Field in Web Page

Post by ramarajak » Wed Dec 12, 2018 3:54 am

Captcha mainly introduced to prevent from automation code or robot. The Captcha Code generated automatically so we can't read it and also in selenium webdriver there is no method to handle captcha.

if you need to solve in your testing URL Means ask developer or System admin to disable captcha generation.

srini
Posts: 85
Joined: Thu Jan 03, 2019 3:58 am

Re: Captcha Field in Web Page

Post by srini » Fri Jan 04, 2019 3:53 am

String capchavalue = driver.findElement(By.xpath("")).getText();
int firstinteger= Integer.parseInt(capchavalue.substring(0, 2));
int secondinteger= Integer.parseInt(capchavalue.substring(5, 6));
int calc= firstinteger+secondinteger;
String final_value= String.valueOf(calc);
driver.findElement(By.xpath("")).sendKeys(final_value);

Sridhar G
Posts: 53
Joined: Fri Nov 30, 2018 3:19 am

Re: Captcha Field in Web Page

Post by Sridhar G » Wed Mar 13, 2019 7:12 am

We can handle Captcha (Verification Code) field in web forms by providing input manually by reading the verification code while Test Case execution.

We can't prepare the Test Data for Captcha fields before Test Case execution, during Test Case Execution only we can provide the data manually.

Selenium can't read the value from Captcha fields.

Post Reply

Return to “Writing Selenium Test Cases”