Is it true that XCUITest doesn't support CSS selectors?

I'm running Appium with Xcode 8.2.1, Appium 1.6.4(beta), and XCUITest for iOS Simulator and real devices.


I have it working on the simulator and tap actions are working (appium server command for this is:


appium -g ~/appium_server.log --log-timestamp --local-timezone --debug-log-spacing --tmp ~/tmp --default-capabilities '{"showXcodeLog": true, "automationName": "XCUITest", "cssSelectorsEnabled": true, "nativeWebTap": true, "nativeEvents": true, "autoWebView": true}'


Note the capability settings

"cssSelectorsEnabled": true, "nativeWebTap": true, "nativeEvents": true

which were required for the simulator to recognize and actualy take tap actions.


However, when I run on a real device (iPad 9.3.5), the home page is loaded as expected, but then the following pages are not -- they require tapping on the Global Navigation options to appear, so the test eventually fails (this is exactly what happened on the Simulator before I added the capabilities mentioned above).


When I review the server log, I see the following messages:


2017-02-13 09:38:07:950 - info: [debug] [MJSONWP] Calling AppiumDriver.findElement() with args: ["css selector","#m-j-access-reg","20d61c55-4c69-4e24-8bc3-daf5c323e2c1"]

2017-02-13 09:38:07:951 - info: [debug] [XCUITest] Executing command 'findElement'

2017-02-13 09:38:07:951 - info: [debug] [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, accessibility id


Hard to believe, but it looks like XCUITest is saying it doesn't recognize CSS Selectors... Is that really true?

Replies

Hi JESiim,


Unfortunately I'm stuck because of the same issue. Find by css doesn't seem to be working. Were you able to fix the issue ?


Versions I'm using:

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 fix the issue)

running test on iOS iPad 9.3.4 using XCUITest (had no choice but to use XCUITest)

xcode:8.2.1


Thanks,