facebookarchive / WebDriverAgent

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

Picker wheel value has not been changed after 2 seconds timeout when using picker method #1060

Open vjmaiky opened 5 years ago

vjmaiky commented 5 years ago

The problem

Picker wheel value has not been changed after 2 seconds timeout when using picker method

Environment

Details

I'm trying to use selectPickerWeelValue to move picker to a previous value from a certain element:

method:

    public static void selectPickerWheelValue(MobileElement element, String direction) {
        JavascriptExecutor js = Drivers.getMobileDriver();
        Map<String, Object> params = new HashMap<>();
        params.put("order", direction);
        params.put("offset", 0.15);
        params.put("element", element.getId());
        js.executeScript("mobile: selectPickerWheelValue", params);
    }
    public CreateAccount selectNovember() {
        try {
            MyLogger.log.info("Trying to select November month");
            waiters.waitForElementVIsibility(januaryMonth);
            MobileGestures.selectPickerWheelValue(januaryMonth, "previous");
        } catch (WebDriverException e) {
            throw new AssertionError("Cannot select November month");
        }
        return this;
    }

When it runs it changes from January to December but it still failing:

[debug] [W3C (2bf0398e)] Calling AppiumDriver.findElement() with args: ["-ios predicate string","type == 'XCUIElementTypePickerWheel' AND value MATCHES[c] 'January'","2bf0398e-1255-4ddd-bc25-b21c698e3eaf"] [debug] [XCUITest] Executing command 'findElement' [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 [debug] [JSONWP Proxy] Matched '/element' to command name 'findElement' [debug] [JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:7341/session/5C3D36D9-8826-4D30-B035-DB14FBA80310/element] with body: {"using":"predicate string","value":"type == 'XCUIElementTypePickerWheel' AND value MATCHES[c] 'January'"} [debug] [JSONWP Proxy] Got response with status 200: {"value":{"ELEMENT":"9F000000-0000-0000-1A0D-000000000000"},"sessionId":"5C3D36D9-8826-4D30-B035-DB14FBA80310","status":0} [debug] [XCUITest] Connection to WDA timed out [debug] [iProxy] recv failed: Operation not permitted [debug] [W3C (2bf0398e)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"9F000000-0000-0000-1A0D-000000000000","ELEMENT":"9F000000-0000-0000-1A0D-000000000000"} [HTTP] <-- POST /wd/hub/session/2bf0398e-1255-4ddd-bc25-b21c698e3eaf/element 200 197 ms - 137 [HTTP] [HTTP] --> POST /wd/hub/session/2bf0398e-1255-4ddd-bc25-b21c698e3eaf/execute/sync [HTTP] {"script":"mobile: selectPickerWheelValue","args":[{"offset":0.15,"order":"previous","element":"9F000000-0000-0000-1A0D-000000000000"}]} [debug] [W3C (2bf0398e)] Calling AppiumDriver.execute() with args: ["mobile: selectPickerWheelValue",[{"offset":0.15,"order":"previous","element":"9F000000-0000-0000-1A0D-000000000000"}],"2bf0398e-1255-4ddd-bc25-b21c698e3eaf"] [debug] [XCUITest] Executing command 'execute' [XCUITest] Proxying to WDA with an unknown route: POST /wda/pickerwheel/9F000000-0000-0000-1A0D-000000000000/select [debug] [JSONWP Proxy] Proxying [POST /wda/pickerwheel/9F000000-0000-0000-1A0D-000000000000/select] to [POST http://localhost:7341/session/5C3D36D9-8826-4D30-B035-DB14FBA80310/wda/pickerwheel/9F000000-0000-0000-1A0D-000000000000/select] with body: {"order":"previous","offset":0.15} [debug] [XCUITest] Connection to WDA timed out [debug] [iProxy] recv failed: Operation not permitted [debug] [JSONWP Proxy] Got response with status 200: {"value":"Error Domain=com.facebook.WebDriverAgent Code=1 \"Picker wheel value has not been changed after 2 seconds timeout\" UserInfo={NSLocalizedDescription=Picker wheel value has not been changed after 2 seconds timeout}","sessionId":"5C3D36D9-8826-4D30-B035-DB14FBA80310","status":13} [JSONWP Proxy] Got an unexpected response: {"value":"Error Domain=com.facebook.WebDriverAgent Code=1 \"Picker wheel value has not been changed after 2 seconds timeout\" UserInfo={NSLocalizedDescription=Picker wheel value has not been changed after 2 seconds timeout}","sessionId":"5C3D36D9-8826-4D30-B035-DB14FBA80310","status":13} [debug] [MJSONWP] Matched JSONWP error code 13 to UnknownError [debug] [W3C (2bf0398e)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Error Domain=com.facebook.WebDriverAgent Code=1 "Picker wheel value has not been changed after 2 seconds timeout" UserInfo={NSLocalizedDescription=Picker wheel value has not been changed after 2 seconds timeout} [debug] [W3C (2bf0398e)] at errorFromMJSONWPStatusCode (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:789:10) [debug] [W3C (2bf0398e)] at ProxyRequestError.getActualError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:683:14) [debug] [W3C (2bf0398e)] at JWProxy.command (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:234:19) [debug] [W3C (2bf0398e)] at _tickCallback (internal/process/next_tick.js:43:7) [debug] [W3C (2bf0398e)] at processImmediate (timers.js:605:7) [HTTP] <-- POST /wd/hub/session/2bf0398e-1255-4ddd-bc25-b21c698e3eaf/execute/sync 500 5102 ms - 1174

vjmaiky commented 5 years ago

as a workaround we commented 3 lines of code from following method and added ro 1st return YES:

vjmaiky commented 5 years ago

any updates on this topic?

simonDominos commented 5 years ago

We're having the exact same problem too. Did this ever get looked at?

vjmaiky commented 5 years ago

i don't think so.