4

I am new to flutter. So, I want to know whether I can use selenium webdriver/java to automate a flutter web application.

I have used java / cucumber to automate web applications and used page object pattern. so, can I do the same technologies to automate a flutter web application ?.

4 Answers 4

5

Yes you can, because the automation code is going run on top of the application. So there is no restriction. There is a package available in flutter WebDriver maybe you can try this out . And here is the API documentation.

Sign up to request clarification or add additional context in comments.

6 Comments

Thanks for the answer. I would like to know how I can develop page objects. Can I develop as java classes?. Or they should be .dart files. I tried to find the maven dependency for flutter driver. But it seems there is no maven dependency for flutter web driver.
You can use selenium-webdriver/java or flutter-webdriver/dart to automate. If you want to use flutter(dart) here is a youtube playlist
Thanks a lot. Now it is clear for me. I will go with selenium/ java.
@Vinee-the-Pooh I'd be interested to learn if/how you actually managed to make this work. In my experience the Flutter web app is a black box to the browser and to selenium...
This is not possible so far with Flutter 3 Web. Have you been successful in anyway (example please) at this point of time ?
|
4

You can automate flutter web applications using selenium, robot framework or any automation tool, but first, you need to execute javascript command to show the tree of elements in the page then you can use them in your automation.

document.querySelector('flt-glass-pane').shadowRoot.querySelector('flt-semantics-placeholder').click({force: true});

Comments

0

You cannot.

Flutter does not render into html elements like a normal web framework. It renders the entire site as one image, so there's no way to use selenium. You'd have to use image based automation to automate it.

Here's a medium article that explains in detail why this is not possible.

Comments

0

There’s a way, but it depends on the Flutter type. You can run this JavaScript to enable accessibility.
Then the dom element will appear.

document.querySelector('[aria-label=\"Enable accessibility\"]').click();

Comments

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.