facebookarchive / WebDriverAgent

A WebDriver server for iOS that runs inside the Simulator.
Other
4.15k stars 1.38k forks source link

driver.findElement command is not working #869

Open JeevaTamil opened 6 years ago

JeevaTamil commented 6 years ago

The problem

I am testing iOS application. in the initial page, I need to tap on a button. I am getting below error: [MJSONWP] Encountered internal error running command: Error: An error occurred at JWProxy.command$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:176:15) at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/node_modules/babel-runtime/regenerator/runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/node_modules/babel-runtime/regenerator/runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/node_modules/babel-runtime/regenerator/runtime.js:100:21) at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/node_modules/babel-runtime/regenerator/runtime.js:136:37) at [HTTP] <-- GET /wd/hub/session/78a0a9c6-0b25-46f2-a2a9-8468e2692db7 500 50 ms - 188 [XCUITest] Connection to WDA timed out [iProxy] recv failed: Operation not permitted

Code used

simple find element command-> WebElement btn = driver.findElement(By.xpath("//*[@label= 'Allow & Sign in']"));

Environment

Details

I can able to launch the application. In the application, I need to perform 3 swipes to reach the sign in button page and I can able to perform that swipe as well. My only problem is finding the element.

NOTE: I can able to find the element in The inspector.

Link to Appium logs

Eclipse Error message

Code To Reproduce Issue [ Good To Have ]

marekcirkos commented 6 years ago

Xpath is known to be slow, which would explain why you get timeout. Can you try locating element by simple locator with label value?

JeevaTamil commented 6 years ago

I have tried to find the element using Name/ID Attributes as well. But, No luck. Getting same error message