I have list of edittext in single screen and I used the following code snippet for locating and sending the values to edittext.
List edit_text = driver.findElements(By.className(“android.widget.EditText”));
edit_text.get(0).sendKeys(“xxxx”);
edit_text.get(1).sendKeys(“1234”);
The above is working fine .
I need to change the above code by using By.classname.
File1.java
List edit_text = (List) By.className(“android.widget.EditText”);
public void driver_mobile(){
driver.findElementsByClassName(edit_text);
}
File2.java:
Need to call the driver_mobile() method in this file for different index of edit_text.
File1 obj= new File1(driver)
obj.driver_mobile().edit_text(0).sendKeys(“xxxx”);
obj.driver_mobile().edit_text(1).sendKeys(“1234”);
The error is showing in the file2 snippet and in file 1 driver.findElementsByClassName(edit_text); line. I dont know how to use this properly. Can anyone say how to proceed with this?