appium / appium-flutter-driver

Appium Flutter Driver is a test automation tool for Flutter apps on multiple platforms/OSes. Appium Flutter Driver is part of the Appium mobile test automation tool maintained by community
MIT License
454 stars 183 forks source link

Getting timeout on a flutter driver command #673

Open veydecapia opened 6 months ago

veydecapia commented 6 months ago

Getting timeout error on a click command. I have added a setFrameSync before and after the click command.

    await driver.execute('flutter:setFrameSync', true, 5000);
    await driver.elementClick(this.otpTextbox);
    await driver.execute('flutter:setFrameSync', false, 5000);

Terminal output:

  [0-0] 2024-03-20T10:30:47.886Z INFO webdriver: COMMAND elementClick("eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoidGV4dGZpZWxkT25lIiwia2V5VmFsdWVUeXBlIjoiU3RyaW5nIn0")
  [0-0] 2024-03-20T10:30:47.886Z INFO webdriver: [POST] http://127.0.0.1:4723/session/db0179dd-3334-42a8-b93d-3bf5cf5e92d2/element/eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoidGV4dGZpZWxkT25lIiwia2V5VmFsdWVUeXBlIjoiU3RyaW5nIn0/click
  [0-0] Error in "Login Scenario.should be able to login successfully"
  Error: Timeout
      at listOnTimeout (node:internal/timers:573:17)
      at processTimers (node:internal/timers:514:7)
  [0-0] 2024-03-20T10:33:45.204Z DEBUG @wdio/utils:shim: Finished to run "after" hook in 0ms
  [0-0] 2024-03-20T10:33:45.204Z INFO webdriver: COMMAND deleteSession()
  [0-0] 2024-03-20T10:33:45.206Z INFO webdriver: [DELETE] http://127.0.0.1:4723/session/db0179dd-3334-42a8-b93d-3bf5cf5e92d2
  [0-0] 2024-03-20T10:33:45.499Z INFO webdriver: RESULT null
  2024-03-20T10:33:45.614Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 1
  [0-0] FAILED in Android - file:///tests/specs/sanity/app.login.spec.ts

I have followed and applied the fix in this issue.

Added await driver.execute('flutter:setFrameSync', true, 5000); before and after the click command.

See full appium logs here

SyedAshiqSorife commented 6 months ago

facing same issue. can any one help ?

2024-03-27T11:46:27.565Z INFO webdriver: COMMAND executeScript("flutter:setFrameSync", ) [0-0] 2024-03-27T11:46:27.571Z INFO webdriver: [POST] http://127.0.0.1:4723/session/1ac3c16d-28d8-4975-8c54-c443ace51204/execute/sync [0-0] 2024-03-27T11:46:27.572Z INFO webdriver: DATA { script: 'flutter:setFrameSync', args: [ true, 5000 ] } [0-0] 2024-03-27T11:46:27.624Z INFO webdriver: RESULT { [0-0] isError: false, [0-0] response: {}, [0-0] type: '_extensionType', [0-0] method: 'ext.flutter.driver' [0-0] } [0-0] 2024-03-27T11:46:27.625Z INFO webdriver: COMMAND elementClick("<Screenshot[base64]>") [0-0] 2024-03-27T11:46:27.627Z INFO webdriver: [POST] http://127.0.0.1:4723/session/1ac3c16d-28d8-4975-8c54-c443ace51204/element/eyJmaW5kZXJUeXBlIjoiQnlWYWx1ZUtleSIsImtleVZhbHVlU3RyaW5nIjoiSE9NRV9TQ1JFRU5fVEFCX0JBUl9NT05USCIsImtleVZhbHVlVHlwZSI6IlN0cmluZyJ9/click

after this it hangs

SyedAshiqSorife commented 6 months ago

@veydecapia did you get any solution?

veydecapia commented 6 months ago

@SyedAshiqSorife No, I'm stucked. Checking on other alternatives.

SyedAshiqSorife commented 6 months ago

@veydecapia try this if your locator is correct then it will work. await driver.execute('flutter:setFrameSync', false, 5000); await driver.elementClick(this.otpTextbox); await driver.execute('flutter:setFrameSync', true, 5000);

veydecapia commented 5 months ago

@SyedAshiqSorife did this approach work on your end?

zerock54 commented 3 months ago

I have the same issue and the setFrameSync tip did not work