l am locating the element using the below xpath driver.findElement(By.xpath("/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.View/android.view.View/android.view.View/android.view.View/android.view.View/android.view.View[2]")).sendKeys("728192");
my tests is not failing but its not entering the values in the element circled on the left.
Kindly assist
@Aleksei thanks for the response. l am pretty new to appium so please pardon me if l sound naive. so l am getting the OTP from the DB and saved in a variable called OTP like in the code below
Database db = new Database(āv3_Authenticationā);
String otp = db.getAgentOtp(phoneNumber);
db.closeDbConnection();
How do l enter this value using the keyboard
SLF4J: Failed to load class āorg.slf4j.impl.StaticLoggerBinderā.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
e[35m[Appium]e[39m Welcome to Appium v2.0.0-beta.42
e[35m[Appium]e[39m Non-default server args:
e[35m[Appium]e[39m { address: e[32mā127.0.0.1āe[39m }
e[35m[Appium]e[39m Attempting to load driver uiautomator2ā¦
[debug] e[35m[Appium]e[39m Requiring driver at C:\Users\mataga.appium\node_modules\appium-uiautomator2-driver
e[35m[Appium]e[39m Attempting to load driver flutterā¦
[debug] e[35m[Appium]e[39m Requiring driver at C:\Users\mataga.appium\node_modules\appium-flutter-driver
e[35m[Appium]e[39m Appium REST http interface listener started on 127.0.0.1:4723
e[35m[Appium]e[39m Available drivers:
e[35m[Appium]e[39m - [email protected] (automationName āUiAutomator2ā)
e[35m[Appium]e[39m - [email protected] (automationName āFlutterā)
e[35m[Appium]e[39m No plugins have been installed. Use the āappium pluginā command to install the one(s) you want to use.
868821
PASSED: agent.AgentRegistrationTest.RegisterAgent
===============================================
Default test
Tests run: 1, Failures: 0, Skips: 0
===============================================
Default suite
Total tests run: 1, Passes: 1, Failures: 0, Skips: 0
appium --log-level debug --relaxed-security
[Appium] Welcome to Appium v2.0.0-beta.35
[Appium] Non-default server args:
[Appium] {
[Appium] relaxedSecurityEnabled: true
[Appium] }
[Appium] Attempting to load driver uiautomator2...
[debug] [Appium] Requiring driver at /Users/xx/.appium/node_modules/appium-uiautomator2-driver
[Appium] Attempting to load driver xcuitest...
[debug] [Appium] Requiring driver at /Users/xx/.appium/node_modules/appium-xcuitest-driver
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[Appium] Available drivers:
[Appium] - [email protected] (automationName 'UiAutomator2')
[Appium] - [email protected] (automationName 'XCUITest')
[Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use.
when l use the below xpath to locate the first element driver.findElement(By.xpath("/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.View/android.view.View/android.view.View/android.view.View/android.view.View/android.view.View[2]/android.widget.EditText[1][@index='1']")).click(); driver.findElement(By.xpath("/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.View/android.view.View/android.view.View/android.view.View/android.view.View/android.view.View[2]/android.widget.EditText[1][@index='1']")).sendKeys("[email protected]");
it works well. but when l add the below xpath to my code, l get an error saying the first xpath is not located