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

0
need help in selenium web driver

Solved 1 Answers 58 Views Test Automation
0 1

Hi,

I got struck in somewhere:

http://store.demoqa.com/tools-qa/?action=register

Please can you suggest how to code :

"Please enter the answer in digit"

Many thanks,
Soham

1 Answer

0
Best answer
0
Hi Soham,

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

/html/body/div[1]/form/div/strong

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.
...