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

Actions Not Working on some elements with WebdriverIO and Appium-Flutter-Driver #691

Open KasunYapa96 opened 4 months ago

KasunYapa96 commented 4 months ago

Framework and Tools:

Problem Description:

I am using the WebdriverIO (wdio) framework combined with appium-flutter-driver to automate a Flutter application. The script successfully launches the app and performs the sign-in flow without any issues. However, after the sign-in process, when the automation script redirects to the homepage, none of the actions specified in the script are executed. For example, I have defined a key-value pair for the "recharge" button on the homepage screen. The click action for this button does not work. The assigned ID from the flutter driver is visible in the terminal, but the action does not execute until the default timeout is reached.

Questions:

  1. App Limitation: Could this issue be due to a limitation within the application itself?
  2. Driver Limitation: Is this a known limitation or issue with the appium-flutter-driver?
  3. Security Concerns: Could specific interactions with app screens affect any security mechanisms within the app?

Steps to Reproduce:

Set up a WebdriverIO project with appium-flutter-driver. Automate the sign-in flow of the Flutter application. Attempt to perform actions on the homepage (e.g., clicking the "recharge" button).

Example for clicking an Element :

Login ->

async changeLanguage() {

        const lanSelect = find.byText('FR');
        const msg=await driver.getElementText(lanSelect);
        console.log(msg);
        assert.strictEqual(msg,'FR')
        await driver.elementClick(lanSelect);

        const english = find.byText('EN');
        await driver.elementClick(english);
    }

    async enterMSISDN(phoneNumber) {
        const qaTxtbox = find.byValueKey('quickAccessTextBox');
        await driver.elementSendKeys(qaTxtbox, phoneNumber)
    }

Clicking on Recharge Button ->

Tried below 3 different ways for button clicking and none of these working.

async clickonRechargeBtn(){

await driver.elementClick(find.byText('Recharge'));

await driver.elementClick(find.byValueKey('recharge_btn'));

await driver.execute('flutter:clickElement', recharge_btn, {timeout:50000});

}

Terminal Logs :

MicrosoftTeams-image (18)


Error in "Scratch Card - Manually Number Enter.Verify the user can enters the valid scratch card code manually"
Error: Timeout of 600000ms exceeded. The execution in the test "Scratch Card - Manually Number Enter 
Verify the user can enters the valid scratch card code manually" took too long. Try to reduce the run time or increase your timeout for test specs (https://webdriver.io/docs/timeouts). (E:\QA Docs and Tutorials\Flutter\Flutter Repo\flutter-automation\test\specs\Recharge.test.js)
    at createTimeoutError (E:\QA Docs and Tutorials\Flutter\Flutter Repo\flutter-automation\node_modules\mocha\lib\errors.js:498:15)
    at Test.Runnable._timeoutError (E:\QA Docs and Tutorials\Flutter\Flutter Repo\flutter-automation\node_modules\mocha\lib\runnable.js:431:10)
    at Timeout.<anonymous> (E:\QA Docs and Tutorials\Flutter\Flutter Repo\flutter-automation\node_modules\mocha\lib\runnable.js:246:24)
    at listOnTimeout (node:internal/timers:573:17)
    at processTimers (node:internal/timers:514:7)

Expected Behavior:

The actions specified in the script (such as clicking the "recharge" button) should execute successfully on the homepage. Actual Behavior:The actions do not execute and timeout without performing the intended operations.

Additional Information:

The terminal shows that the assigned ID for the elements on the homepage is correctly identified by the flutter driver. No errors or exceptions are thrown; the actions simply do not execute.

Environment and Dependencies :

"devDependencies": {

"@wdio/allure-reporter": "^8.29.2",
"@wdio/appium-service": "^8.29.1",
"@wdio/cli": "^8.29.1",
"@wdio/local-runner": "^8.29.2",
"@wdio/mocha-framework": "^8.29.1",
"appium": "^2.4.0",
"appium-flutter-driver": "^2.4.0",
"appium-flutter-finder": "^0.2.0",
"assert": "^2.1.0",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"

},

I would appreciate any guidance on resolving this issue. Insights into whether this could be an application limitation, a driver issue, or if there are any security concerns with automating specific screens in the app would be very helpful.