Testing AG Grid


I’m having trouble carrying out integration tests on an AG Grid with Python.
Indeed, I would like to perform some actions such as :

  • See the number of rows in the table
  • View the contents of specific cells
  • etc.

I’m currently using Selenium, but the html source code of the web page doesn’t seem to contain the table, so I can’t navigate through it.

Thank you for your help.
Jocelyn LOPEZ

Hi @Jocelyn and welcome to the Dash community :slight_smile:

You can find lots of examples of tests with Dash AG Grid here:

And here is some general information about testing with Dash


Thank you very much, that was very helpful.
Now, I’m still having trouble using the dash_duo fixture because I don’t use pytest but behave (BDD) to run my tests.

These tests look like this:

from behave import *

@given(u "User on homepage.")
def step_impl(context, dash_duo):
    context.dash_duo = dash_duo.start_server(context.app)

Unfortunately, behave provides only one positional argument to the function.

If you are using selenium, you should be able create different functions underneath the class like we did for our tests.

You need to wait until the grid has been rendered to the html.


I’m sorry, but I can’t figure out how to use your response to solve my problem : add the dash_duo fixture to the scope of my Behave steps ?

If you’re talking about adding a new method to the Grid class in tests.utils, that’s what I’ve started to do to perform certain actions that weren’t present initially.

For the information, I am still a beginner in the use of Selenium and Dash.

Thanks for your help.

Finally, I was able to find an alternative:
Replacing the ‘behave’ library with ‘pytest-bdd-ng’ allows to use the pytest runner and therefore the ‘dash_duo’ fixture.

1 Like