Hi you all again.
Now seems to stop working this approach.
Launching command wait(timeout: 35){buttons("OK").last.click}
returns nil and doesn’t click anywhere.
Server Log for the entire wait (suposed to be 35 seconds)
[HTTP] --> POST /wd/hub/session/d86dfd52-e602-49c6-95fa-1e6bf3c9103e/execute {"script":" (function() {\n var opts = {\"typeArray\":[\"UIAButton\"],\"onlyVisible\":true,\"name\":{\"target\":\"OK\",\"substring\":true,\"insensitive\":true},\"label\":{\"target\":\"OK\",\"substring\":true,\"insensitive\":true},\"value\":{\"target\":\"OK\",\"substring\":true,\"insensitive\":true},\"onlyFirst\":false};\n var result = false;\n\n try {\n result = $._elementOrElementsByType($.mainWindow(), opts);\n } catch (e) {\n }\n\n return result;\n })();\n","args":[]}
[MJSONWP] Calling AppiumDriver.execute() with args: [" (function() {\n ...
[debug] [iOS] Executing iOS command 'execute'
[debug] [UIAuto] Sending command to instruments: (function() {
var opts = {"typeArray":["UIAButton"],"onlyVisible":true,"name":{"target":"OK","substring":true,"insensitive":true},"label":{"target":"OK","substring":true,"insensitive":true},"value":{"target":"OK","substring":true,"insensitive":true},"onlyFirst":false};
var result = false;
try {
result = $._elementOrElementsByType($.mainWindow(), opts);
} catch (e) {
}
return result;
})();
[debug] [Instruments] [INST] 2016-11-11 08:13:12 +0000 Debug: evaluation finished
[debug] [Instruments] [INST] 2016-11-11 08:13:12 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-11-11 08:13:12 +0000 Debug: Running system command #87: /usr/local/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/q6/h757481s0331g8jz4t7tg1300000gp/T/instruments_sock 2,{"status":0,"value":""}...
[debug] [Instruments] [INST] 2016-11-11 08:14:16 +0000 Debug: Got new command 87 from instruments: (function() {
var opts = {"typeArray":["UIAButton"],"onlyVisible":true,"name":{"target":"OK","substring":true,"insensitive":true},"label":{"target":"OK","substring":true,"insensitive":true},"value":{"target":"OK","substring":true,"insensitive":true},"onlyFirst":false};
var result = false;
try {
result = $._elementOrElementsByType($.mainWindow(), opts);
} catch (e) {
}
return result;
})();
[debug] [Instruments] [INST] 2016-11-11 08:14:16 +0000 Debug: evaluating (function() {
var opts = {"typeArray":["UIAButton"],"onlyVisible":true,"name":{"target":"OK","substring":true,"insensitive":true},"label":{"target":"OK","substring":true,"insensitive":true},"value":{"target":"OK","substring":true,"insensitive":true},"onlyFirst":false};
var result = false;
try {
result = $._elementOrElementsByType($.mainWindow(), opts);
} catch (e) {
}
return result;
})();
[debug] [Instruments] [INST] 2016-11-11 08:14:16 +0000 Debug: evaluation finished
[debug] [Instruments] [INST] 2016-11-11 08:14:16 +0000 Debug: Lookup returned [object UIAButton] with the name "OK" (id: 9).
[debug] [Instruments] [INST] 2016-11-11 08:14:16 +0000 Debug: Lookup returned [object UIAButton] with the name "URL" (id: 10).
[debug] [Instruments] [INST] 2016-11-11 08:14:16 +0000 Debug: responding with:
[debug] [Instruments] [INST] 2016-11-11 08:14:16 +0000 Debug: Running system command #88: /usr/local/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-uiauto/build/lib/bin/command-proxy-client.js /var/folders/q6/h757481s0331g8jz4t7tg1300000gp/T/instruments_sock 2,{"status":0,"value":[{"ELEMENT":"9"},{"ELEMENT":"10"}]}...
[debug] [UIAuto] Socket data received (57 bytes)
[debug] [UIAuto] Got result from instruments: {"status":0,"value":[{"ELEMENT":"9"},{"ELEMENT":"10"}]}
[MJSONWP] Responding to client with driver.execute() result: [{"ELEMENT":"9"},{"ELEMENT"...
[HTTP] <-- POST /wd/hub/session/d86dfd52-e602-49c6-95fa-1e6bf3c9103e/execute 200 839 ms - 106
[HTTP] --> POST /wd/hub/session/d86dfd52-e602-49c6-95fa-1e6bf3c9103e/element/10/click {"{}":""}
[MJSONWP] Calling AppiumDriver.click() with args: ["10","d86dfd52-e602-49c6-9...
[debug] [iOS] Executing iOS command 'click'
[debug] [UIAuto] Sending command to instruments: au.tapById('10')
[debug] [Instruments] [INST] 2016-11-11 08:14:17 +0000 Debug: Got new command 88 from instruments: au.tapById('10')
[debug] [Instruments] [INST] 2016-11-11 08:14:17 +0000 Debug: evaluating au.tapById('10')
[debug] [Instruments] [INST] 2016-11-11 08:14:17 +0000 Debug: target.frontMostApp().mainWindow().elements()[1].tap()
[debug] [UIAuto] Socket data received (25 bytes)
[debug] [UIAuto] Got result from instruments: {"status":0,"value":""}
[MJSONWP] Responding to client with driver.click() result: null
[HTTP] <-- POST /wd/hub/session/d86dfd52-e602-49c6-95fa-1e6bf3c9103e/element/10/click 200 1179 ms - 76
For me this seems to be a bug with appium, is only trying one time…
I know most of you don’t use the ruby client, but the syntax is good