Is it possible to automate testing for a large Dash app?

My Dash app is 1.8 GB with a fairly complex directory structure.

I worked on it for ten months. The 1.0 version is now published as a Docker Image on Amazon AWS:

It is functional, but it needs a lot of testing.

For my first step, I need to be able to feed test data to a dbc.Textarea and click a dbc.Button.

However, I have been struggling to figure out how to automate testing it. I read the pytest-dash documentation and the only complete Selenium guide on Amazon. But I found out Selenium webdriver alone does not seem to work on Dash html elements. I have also reviewed the online advice, which suggests I place a copy the entire app into an file (not possible). It is starting to look like I need to rewrite this app as a Flask app, so I can test it.

Can someone please tell me am I right or wrong about being able to test a large Dash app?

Am I wrong about Selenium webdriver and Dash?

If I am wrong, how should I approach the task?

What are my first steps?

Thank you for reviewing my question.

Your straightforward advice is much appreciated.


I finally figured this out and it had nothing to with Selenium webdriver not detecting Dash html elements. It had to do with using a ‘driver.quit() command after the ‘finally’’ command in the try/exception block.

When I substitute pass for driver.quit(), it works fine. Just wanted everyone to know Python Selenium should interact with Dash html without any major problems. Chances are good the problem lies somewhere else.

Took a while to figure it out, though.

1 Like