appium-flutter-driver icon indicating copy to clipboard operation
appium-flutter-driver copied to clipboard

click(), "flutter:enterText" methods not throwing exception when element not present or supplied invalid locators.

Open ahashmi24 opened this issue 6 years ago • 8 comments

@shibupanda Maybe it is same as waitFor/waitForAbsent

ahashmi24 avatar Feb 12 '20 06:02 ahashmi24

@ahashmi24 can you have a specific code example, the way I read it, not throwing exception is expected from https://api.flutter.dev/flutter/flutter_driver/FlutterDriver/enterText.html ; this method is used to enter text into focused text field, i.e you have to find and focus that text field first, and if there is no text field focused, the "text input events" are still sent (to nothingness). Is this behavior somehow different from appium?

truongsinh avatar Feb 13 '20 11:02 truongsinh

On the other hand, https://api.flutter.dev/flutter/flutter_driver/FlutterDriver/tap.html has the duration (which we have not implemented in appium-flutter-driver), which can be solved for your use case, e.g. driver.elementClick(buttonFinder, {durationMilliseconds: 100})

truongsinh avatar Feb 13 '20 11:02 truongsinh

On the other hand, https://api.flutter.dev/flutter/flutter_driver/FlutterDriver/tap.html has the duration (which we have not implemented in appium-flutter-driver), which can be solved for your use case, e.g. driver.elementClick(buttonFinder, {durationMilliseconds: 100})

I think driver.elementClick(buttonFinder, {durationMilliseconds: 100}) will solve my problem.

Currently, I have used below code snippet to declaring MobileEelment:

MobileElement buttonFinder = find.byValueKey("button"); buttonFinder.click();

If an element is not present on the screen or supplied the invalid locator, driver gets struck and deleting the session after 12 minutes.

ahashmi24 avatar Feb 13 '20 11:02 ahashmi24

MobileElement buttonFinder = find.byValueKey("button");

@truongsinh Ideally, driver should throw an exception if it doesn't get the element by the given locator in the above line.

ahashmi24 avatar Feb 13 '20 12:02 ahashmi24

Make sense, I put it as next enhancement

truongsinh avatar Feb 19 '20 03:02 truongsinh

Any news ? 😁

Rodaxfck avatar Dec 09 '21 13:12 Rodaxfck

hi is there any update on this

sahil-innostax avatar Jul 11 '22 18:07 sahil-innostax

Any update of this?

Hassanajmalcowlar avatar Apr 03 '24 06:04 Hassanajmalcowlar