Converting automated tests from UIAutomator to XCUITest. Facing element identification challenges


I’m running tests on a hybrid app so most of the pages are WebViews. I’m unable to click or validate that a Css element is there. Tests were working perfectly before the move to XCUITest

running test on iOS iPad 9.3.4 using XCUITest (had no choice but to use XCUITest)
appium 1.6.3
java 1.7
selenium-java-2.48.2 (updating to the latest 3.3.1 didn’t fix the issue)
java-client-3.2.0 (updating to 5 beta6 didn’t change anything)



[HTTP] --> POST /wd/hub/session/5f74b0ed-5fda-42de-838d-d03bb4532a26/elements {“using”:“css selector”,“value”:" .title"}
[debug] [MJSONWP] Calling AppiumDriver.findElements() with args: [“css selector”," .title",“5f74b0ed-5fda-42de-838d-d03bb4532a26”]
[debug] [XCUITest] Executing command ‘findElements’
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id
[debug] [BaseDriver] Waiting up to 0 ms for condition
[MJSONWP] Encountered internal error running command: Error: Error while executing atom: Unable to load Atom ‘find_elements’ from file ‘/usr/local/lib/node_modules/appium/node_modules/appium-remote-debugger/atoms/find_elements.js’
at XCUITestDriver.callee$0$0$ (…/…/…/lib/commands/web.js:75:11)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js💯21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)


I couldn’t find any clear document that shows if locating elements still works using Css. Is there a way to avoid rewriting all my page objects to get the tests working ? I prefer to avoid using xPath