Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

need help in selenium web driver

Solved 1 Answers 64 Views Test Automation
0 1


I got struck in somewhere:

Please can you suggest how to code :

"Please enter the answer in digit"

Many thanks,

1 Answer

Best answer
Hi Soham,

I analyzed the pattern. You have to first identify element using xpath.


Now, get text from that element and split string with space " ".

String[] splitStr = text.split(" ");

Now your splitStr[0] will be your first number/number in word format
splitStr[1] will be arithmetic operator (+,-,*,/)
splitStr[2] will be another number/number in word format.

Now from above you can easily find out the calculation and do sendKeys into result text box.

Hope it helps.
answered by
selected by

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.