Arc behaves differently from script

I have a scrollable UIACollection view with a button that needs to be scrolled into view to tap.

When using arc, if I do find_element(LOCATOR).click, the simulator scrolls the element into view and clicks it.

When running my script that does the same thing, nothing happens. According to the appium log, the button is never even located.

Any idea if there’s a difference in how arcs click was implemented to handle the scrolling, or why the script does not scroll when run?

Log from test run:

    info: --> POST /wd/hub/session/c19560d2-dfdc-40c5-9ffd-1ee5dd859673/elements {"using":"name","value":"reserve"}

info: [debug] Waiting up to 30000ms for condition
info: [debug] Pushing command to appium work queue: "au.getElementsByName('reserve')"
info: [debug] Sending command to instruments: au.getElementsByName('reserve')

info: [debug] [INST] 2015-05-01 19:38:20 +0000 Debug: Got new command 28 from instruments: au.getElementsByName('reserve')

info: [debug] [INST] 2015-05-01 19:38:20 +0000 Debug: evaluating au.getElementsByName('reserve')

info: [debug] [INST] 2015-05-01 19:38:20 +0000 Debug: evaluation finished

info: [debug] [INST] 2015-05-01 19:38:20 +0000 Debug: responding with:

info: [debug] [INST] 2015-05-01 19:38:20 +0000 Debug: Running system command #29: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":[]}...

info: [debug] Socket data received (25 bytes)

info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":0,"value":[]}
info: [debug] Waited for 310ms so far

Log from arc:

info: --> POST /wd/hub/session/dd7a6fe0-e9ff-4a05-97cc-6b7660a6a2c8/elements {"using":"name","value":"reserve"}

info: [debug] Waiting up to 30000ms for condition
info: [debug] Pushing command to appium work queue: "au.getElementsByName('reserve')"
info: [debug] Sending command to instruments: au.getElementsByName('reserve')

info: [debug] [INST] 2015-05-01 19:34:10 +0000 Debug: Got new command 3 from instruments: au.getElementsByName('reserve')
info: [debug] [INST] 2015-05-01 19:34:10 +0000 Debug: evaluating au.getElementsByName('reserve')

info: [debug] Socket data received (72 bytes)

info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":0,"value":[{"ELEMENT":"0"},{"ELEMENT":"1"},{"ELEMENT":"2"}]}
info: [debug] Responding to client with success: {"status":0,"value":[{"ELEMENT":"0"},{"ELEMENT":"1"},{"ELEMENT":"2"}],"sessionId":"dd7a6fe0-e9ff-4a05-97cc-6b7660a6a2c8"}
info: <-- POST /wd/hub/session/dd7a6fe0-e9ff-4a05-97cc-6b7660a6a2c8/elements 200 560.146 ms - 121 {"status":0,"value":[{"ELEMENT":"0"},{"ELEMENT":"1"},{"ELEMENT":"2"}],"sessionId":"dd7a6fe0-e9ff-4a05-97cc-6b7660a6a2c8"}
info: [debug] [INST] 2015-05-01 19:34:10 +0000 Debug: evaluation finished

info: [debug] [INST] 2015-05-01 19:34:10 +0000 Debug: Lookup returned [object UIAButton] with the name "reserve" (id: 0).
info: [debug] [INST] 2015-05-01 19:34:10 +0000 Debug: Lookup returned [object UIAButton] with the name "reserve" (id: 1).
info: [debug] [INST] 2015-05-01 19:34:10 +0000 Debug: Lookup returned [object UIAButton] with the name "reserve" (id: 2).
info: [debug] [INST] 2015-05-01 19:34:10 +0000 Debug: responding with:
info: [debug] [INST] 2015-05-01 19:34:10 +0000 Debug: Running system command #4: /Applications/Appium.app/Contents/Resources/node/bin/node /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":[{"ELEMENT":"0"},{"ELEMENT":"1"},{"ELEMENT":"2"}]}...

Differences in arc vs a script almost always have to do with timing. Make sure your implicit wait is set to the same value.

This is still managed via?

driver.manage.timeouts.implicit_wait

I don’t ever set an implicit wait in my automation nor when using arc, so I don’t think those values should be different.

If you don’t set them then they’re guaranteed to be different. The default implicit wait in arc is not the same as without it.

Try:
set_wait 0

Or:
@driver.manage.timeouts.implicit_wait = 0

In an upcoming version the default will be 0 for both use cases (with or without arc).