Access st.form_submit_button during testing

I am trying to write tests for my streamlit app using pytest and the AppTest class.
My app contains a form, but I cannot find a way to click the submit button, because st.form_submit_button doesn’t accept a key parameter.

This forces me to do something like:
at.button[3].click().run()
which is unmaintainable in the long run, since I need to remember which the order in which my keys appear, and of course it’s really hard if there are multiple forms.

Is there a workaround for this?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.