1

For Flutter app, we are using

  • appium-flutter-finder and appium-flutter-driver
  • webdriverIO framework using Typescript

Scenario:

  • Login page: Username and password, click on login button
  • Redirected to home page and a dialog is displayed where the user need to click on option Got it!

Issue:

  • During the execution, I'm able to see the dialog with the Got it! option but the option is not clicked
  • To click on the option, using the below logic:
const gotITButtonLocator = byText('Got it!');
const element = driver.$(gotITButtonLocator);
await element.click();

Terminal logs:

ERROR webdriver: Request failed with status 405 due to unknown method: Not implemented yet for find.
[0-0] unknown method in "My Driver Dashboard.should login with valid credentials and Click on Got it"
unknown method: Not implemented yet for find.
    at Context.<anonymous> (/Users/prabhakary/Documents/Ziing/Mobile/VSCODE/mobile-e2e-test/tests
/shared/specs/driver/test_driver.e2e.ts:66:9)

Appium server logs:

[f3380dda][FlutterDriver@bade] Encountered internal error running command:NotImplementedError: Not implemented yet for find.

I kindly requesting for help on this scenario:

import { expect, driver, $ } from "@wdio/globals";
import { selectors } from "../../../../helpers/selectors.ts";
import { pause } from "../../../../helpers/utilities.ts";
import { byText, byValueKey } from "appium-flutter-finder";

const dotenv = require("dotenv");
const loginPage = require('../../../shared/pageObjects/login.page.ts');
const env = process.env.TEST_ENV || "demo";
dotenv.config({ path: `env/.env.${env}` });

describe("My Driver Dashboard", () => {
    beforeEach(async () => {});

    it("should find and click the OK button", async () => {
        await pause(3000);
        const buttonText = await driver.getElementText(selectors.continueButton);
        if (buttonText === "OK") {
            console.log("OK button is displayed. Clicking the OK button...");
            await driver.elementClick(selectors.continueButton);
        } else {
            console.log("OK button is not displayed.");
        }
    });

    it("should login with valid credentials and Click on Got it", async () => {
        const email = process.env.EMAIL;
        const password = process.env.PASSWORD;

        // Accept the permissions
        await loginPage.loginFlow(email, password);
        console.log('Login completed..Checking for the "Got it" button.');

        await pause(10000);

        // Click the "Got it" button
        const gotITButtonLocator = byText('Got it!');
        await pause(10000);
        console.log('********** "Got it" TEXT. **********', gotITButtonLocator);
        const element = driver.$(gotITButtonLocator);
        await element.click();
        await pause(10000);
    });
});

Below is the source code snippet for flutter

      if (!approvedShowOnce) {
        showDialog(
          context: context,
          builder: (BuildContext context) {
            return const OkCancelPopup(
              popupTitle: DASHBOARD_DIALOG_APPROVED_TITLE,
              popupContent: DASHBOARD_DIALOG_APPROVED_CONTENT,
              okButtonText: DASHBOARD_DIALOG_GOT_BUTTON,
              cancelButtonText: null,
              okHandler: null,
              cancelHandler: null,
            );
          },
        );

The DASHBOARD_DIALOG_GOT_BUTTON ,

const DASHBOARD_DIALOG_GOT_BUTTON = 'Got it!';

1
  • 1
    Solved. Working fine. My bad, I reliazed that imports for find were missing. After Adding const find = require("appium-flutter-finder") solved the above issue Commented Sep 17, 2024 at 15:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.