Let me know how to enter values in the input field with multiple elements during test script.
Hello Dipen,
All you need to do is try to find the complete input field, get the list of elements and then using the loop, you can input values in all the elements available. Use the below code:
List<MobileElement> otp = driver.findElementsByXPath("//android.widget.TextView[@text=\"\"]");
for (MobileElement e : otp) {
driver.getKeyboard().sendKeys("0000");
}
Here,
has four elements, after getting them in a list we are passing 0 to all the four elements using the for loop.