# \#testing

**URL:** https://discuss.streamlit.io/tag/testing/181.md

[Latest](https://discuss.streamlit.io/latest.md) · [Categories](https://discuss.streamlit.io/categories.md) · [Tags](https://discuss.streamlit.io/tags.md)

---

## [Data Contract Playground](https://discuss.streamlit.io/t/data-contract-playground/122287)

<div class="topic-metadata">

**Author:** [@royroyroys](https://discuss.streamlit.io/u/royroyroys)\
**Replies:** 0\
**Last updated:** [August 24, 2026, 10:19pm UTC](https://discuss.streamlit.io/t/data-contract-playground/122287 "2026-08-24T22:19:53Z")

</div>

Playing around with datacontract-cli and streamlit. Data Contracts are handy for big data projects and this was trying out streamlit as a front end to play around and check out data contracts. Hope it helps someone in …

---

## [Octocopter motor failure testbench to test Nominal Instrumentation Package](https://discuss.streamlit.io/t/octocopter-motor-failure-testbench-to-test-nominal-instrumentation-package/121892)

<div class="topic-metadata">

**Author:** [@Aaron\_Diamond-Reivic](https://discuss.streamlit.io/u/Aaron_Diamond-Reivic)\
**Replies:** 5\
**Last updated:** [July 9, 2026, 12:11am UTC](https://discuss.streamlit.io/t/octocopter-motor-failure-testbench-to-test-nominal-instrumentation-package/121892 "2026-07-09T00:11:06Z")

</div>

I built a small octocopter motor failure testbench in Streamlit to try out the new open source Nominal Instro package. Streamlit = mission console (motor controls, hardware visualizations). Instro = instrument layer (I…

---

## [Is there a way to test st.pills and st.segmented\_control using the streamlit testing framework?](https://discuss.streamlit.io/t/is-there-a-way-to-test-st-pills-and-st-segmented-control-using-the-streamlit-testing-framework/120892)

<div class="topic-metadata">

**Author:** [@tobygaskell](https://discuss.streamlit.io/u/tobygaskell)\
**Replies:** 1\
**Last updated:** [February 26, 2026, 11:20am UTC](https://discuss.streamlit.io/t/is-there-a-way-to-test-st-pills-and-st-segmented-control-using-the-streamlit-testing-framework/120892 "2026-02-26T11:20:55Z")

</div>

Hi - i am currently building out some tests for an app i have built, i ahve included st.pills and st.segmented controls in my app, but i cant seem to find a apptest element to allow me to control these elements in my tes…

---

## [Can a row be selected in st.dataframe with AppTest?](https://discuss.streamlit.io/t/can-a-row-be-selected-in-st-dataframe-with-apptest/120213)

<div class="topic-metadata">

**Author:** [@OpenPoliceData](https://discuss.streamlit.io/u/OpenPoliceData)\
**Replies:** 2\
**Last updated:** [November 30, 2025, 3:31pm UTC](https://discuss.streamlit.io/t/can-a-row-be-selected-in-st-dataframe-with-apptest/120213 "2025-11-30T15:31:30Z")

</div>

I have an app with the following element: event = st.dataframe(data=selection, on\_select=“rerun”, selection\_mode=‘single-row’, hide\_index=True, height=‘stretch’) I also have code that only runs if a selection is made…

---

## [Testing in a multipage app](https://discuss.streamlit.io/t/testing-in-a-multipage-app/104287)

<div class="topic-metadata">

**Author:** [@lburnhamking](https://discuss.streamlit.io/u/lburnhamking)\
**Replies:** 3\
**Last updated:** [April 8, 2025, 2:11pm UTC](https://discuss.streamlit.io/t/testing-in-a-multipage-app/104287 "2025-04-08T14:11:24Z")

</div>

Hi all I have a multipage app with the following layout. I have a sidebar and navigation managed by st-pages (streamlit==1.42.2, python 3.12, st-pages==1.0.1) myproject/ ├── .streamlit │ ├── pages.toml ├── pages/ │ …

---

## [This is how I test components individually, opinions?](https://discuss.streamlit.io/t/this-is-how-i-test-components-individually-opinions/82572)

<div class="topic-metadata">

**Author:** [@pmareke](https://discuss.streamlit.io/u/pmareke)\
**Replies:** 0\
**Last updated:** [October 1, 2024, 1:55pm UTC](https://discuss.streamlit.io/t/this-is-how-i-test-components-individually-opinions/82572 "2024-10-01T13:55:12Z")

</div>

Hi all!!! I did a search about how to test a component, but the solutions were too much. I was looking for something easy and fast. After some thinking I came up with this solution, small and fast tests for each compo…

---

## [Getting started with App Testing](https://discuss.streamlit.io/t/getting-started-with-app-testing/80992)

<div class="topic-metadata">

**Author:** [@gabrielc](https://discuss.streamlit.io/u/gabrielc)\
**Replies:** 0\
**Last updated:** [September 11, 2024, 2:20am UTC](https://discuss.streamlit.io/t/getting-started-with-app-testing/80992 "2024-09-11T02:20:42Z")

</div>

My colleague, Shing Yee, wrote a blog post on getting started with app testing for streamlit. Hope it’s helpful!

---

## [Testing st.data\_editor (workaround?)](https://discuss.streamlit.io/t/testing-st-data-editor-workaround/76013)

<div class="topic-metadata">

**Author:** [@Logan1](https://discuss.streamlit.io/u/Logan1)\
**Replies:** 1\
**Last updated:** [September 3, 2024, 2:42pm UTC](https://discuss.streamlit.io/t/testing-st-data-editor-workaround/76013 "2024-09-03T14:42:57Z")

</div>

Hi just wondering if anyone has a workaround to the lack of testing infrastructure for st.data\_editor? I have a program where calculations are run based on the values a user inputs into an editable data frame. I’d like …

---

## [Testing st.popover - any updates?](https://discuss.streamlit.io/t/testing-st-popover-any-updates/75507)

<div class="topic-metadata">

**Author:** [@Aaron2](https://discuss.streamlit.io/u/Aaron2)\
**Replies:** 0\
**Last updated:** [July 23, 2024, 8:40am UTC](https://discuss.streamlit.io/t/testing-st-popover-any-updates/75507 "2024-07-23T08:40:56Z")

</div>

This is, in essence, a follow up to this community post: Testing st.popover Are there any updates on testing support for st.popover? Best regards!

---

## [How to test sending a message with at.chat\_input\[0\]](https://discuss.streamlit.io/t/how-to-test-sending-a-message-with-at-chat-input-0/74390)

<div class="topic-metadata">

**Author:** [@Jack2](https://discuss.streamlit.io/u/Jack2)\
**Replies:** 0\
**Last updated:** [July 8, 2024, 5:24pm UTC](https://discuss.streamlit.io/t/how-to-test-sending-a-message-with-at-chat-input-0/74390 "2024-07-08T17:24:57Z")

</div>

How do you create a test to actually send the chat message? If I run: at.chat\_input\[0\].set\_value(“generate prime numbers up to 7”).run() It’s just setting the value, how do I now actually send the message and test the…

---

## [Testing Streamlit: \`TypeError: object supporting the buffer API required\` when running \`AppTest\`](https://discuss.streamlit.io/t/testing-streamlit-typeerror-object-supporting-the-buffer-api-required-when-running-apptest/69548)

<div class="topic-metadata">

**Author:** [@Brakjen](https://discuss.streamlit.io/u/Brakjen)\
**Replies:** 1\
**Last updated:** [May 15, 2024, 11:06am UTC](https://discuss.streamlit.io/t/testing-streamlit-typeerror-object-supporting-the-buffer-api-required-when-running-apptest/69548 "2024-05-15T11:06:04Z")

</div>

I am trying to test my streamlit app with the AppTest class, but run into issues from the get-go. Here are the file contents that produce my error for a very simple app: mwe\_app.py import streamlit as st st.write("Hell…

---

## [How to ignore streamlit-component-lib for transform with jest tests? SyntaxError: Unexpected token 'export'](https://discuss.streamlit.io/t/how-to-ignore-streamlit-component-lib-for-transform-with-jest-tests-syntaxerror-unexpected-token-export/69437)

<div class="topic-metadata">

**Author:** [@schnumbl](https://discuss.streamlit.io/u/schnumbl)\
**Replies:** 0\
**Last updated:** [May 14, 2024, 11:37am UTC](https://discuss.streamlit.io/t/how-to-ignore-streamlit-component-lib-for-transform-with-jest-tests-syntaxerror-unexpected-token-export/69437 "2024-05-14T11:37:38Z")

</div>

I created a custom component and want to write tests for the front end part. I got SyntaxError: Unexpected token 'export' and tried to exclude streamlit-component-lib from transform. I tried both, with command line a…

---

## [How to test custom component using AppTest?](https://discuss.streamlit.io/t/how-to-test-custom-component-using-apptest/69358)

<div class="topic-metadata">

**Author:** [@schnumbl](https://discuss.streamlit.io/u/schnumbl)\
**Replies:** 0\
**Last updated:** [May 13, 2024, 11:55am UTC](https://discuss.streamlit.io/t/how-to-test-custom-component-using-apptest/69358 "2024-05-13T11:55:19Z")

</div>

I created a custom component and would like to test it. First I got E RuntimeError: Runtime hasn't been created! Then I found the AppTest feature of steamlit: import gdpr\_wrapper from streamlit.testing.v1…

---

## [Testing st.popover](https://discuss.streamlit.io/t/testing-st-popover/67623)

<div class="topic-metadata">

**Author:** [@digitalghost-dev](https://discuss.streamlit.io/u/digitalghost-dev)\
**Replies:** 1\
**Last updated:** [April 23, 2024, 4:24am UTC](https://discuss.streamlit.io/t/testing-st-popover/67623 "2024-04-23T04:24:14Z")

</div>

How can I test the st.popover feature? I’m looking at the cheatsheet but don’t see anything there: https://docs.streamlit.io/develop/concepts/app-testing/cheat-sheet

---

## [Can I render only a component without the default background?](https://discuss.streamlit.io/t/can-i-render-only-a-component-without-the-default-background/65499)

<div class="topic-metadata">

**Author:** [@Sisung\_Kim](https://discuss.streamlit.io/u/Sisung_Kim)\
**Replies:** 1\
**Last updated:** [March 25, 2024, 3:54pm UTC](https://discuss.streamlit.io/t/can-i-render-only-a-component-without-the-default-background/65499 "2024-03-25T15:54:31Z")

</div>

For testing or debugging reason, I want to only render the components written in the app script. Is it possible?

---

## [How to test a component](https://discuss.streamlit.io/t/how-to-test-a-component/62698)

<div class="topic-metadata">

**Author:** [@lfoppiano](https://discuss.streamlit.io/u/lfoppiano)\
**Replies:** 5\
**Last updated:** [March 12, 2024, 3:20pm UTC](https://discuss.streamlit.io/t/how-to-test-a-component/62698 "2024-03-12T15:20:26Z")

</div>

Hi all, I’m wondering whether there is a way to test components. For example, the first test would be to run it with different parameters to see whether it does not break. Secondly, I want to check that the component …

---

## [Unexpected "nested form" error appears when testing app with AppTest](https://discuss.streamlit.io/t/unexpected-nested-form-error-appears-when-testing-app-with-apptest/62277)

<div class="topic-metadata">

**Author:** [@maltet](https://discuss.streamlit.io/u/maltet)\
**Replies:** 3\
**Last updated:** [February 14, 2024, 7:24am UTC](https://discuss.streamlit.io/t/unexpected-nested-form-error-appears-when-testing-app-with-apptest/62277 "2024-02-14T07:24:18Z")

</div>

Hi everyone, it’s fantastic that one can test streamlit apps! Unfortunately, I’m currently facing a problem: I’m trying to setup tests of my streamlit app (at the moment locally), and I encounter an unexpected / false-p…

---

## [Using MagicMock and AppTest](https://discuss.streamlit.io/t/using-magicmock-and-apptest/61760)

<div class="topic-metadata">

**Author:** [@arielcv96](https://discuss.streamlit.io/u/arielcv96)\
**Replies:** 2\
**Last updated:** [February 12, 2024, 7:55am UTC](https://discuss.streamlit.io/t/using-magicmock-and-apptest/61760 "2024-02-12T07:55:38Z")

</div>

Hi everyone, I’m running an streamlit App locally and writing some tests to check if a function is called when I click a button. The app is the following one: import streamlit as st def click\_function(): return 1 …

---

## [Setup and tear down test resource in streamlit with pytest](https://discuss.streamlit.io/t/setup-and-tear-down-test-resource-in-streamlit-with-pytest/61998)

<div class="topic-metadata">

**Author:** [@ss\_mohanty](https://discuss.streamlit.io/u/ss_mohanty)\
**Replies:** 1\
**Last updated:** [February 9, 2024, 11:21pm UTC](https://discuss.streamlit.io/t/setup-and-tear-down-test-resource-in-streamlit-with-pytest/61998 "2024-02-09T23:21:34Z")

</div>

i have a codebase to test and I use pytest and streamlit AppTest class for testing my codebase. The concern is in the project root dir i have a file named conftest.py and in this file i am setup and tear down test res…

---

## [Structure of test files and folders when using AppTest](https://discuss.streamlit.io/t/structure-of-test-files-and-folders-when-using-apptest/61407)

<div class="topic-metadata">

**Author:** [@ilzirauraz](https://discuss.streamlit.io/u/ilzirauraz)\
**Replies:** 2\
**Last updated:** [February 3, 2024, 10:37pm UTC](https://discuss.streamlit.io/t/structure-of-test-files-and-folders-when-using-apptest/61407 "2024-02-03T22:37:10Z")

</div>

Python version: 3.11 Streamlit Version: 1.30.0 Running it locally Hi, We have started covering our application with tests and we have a problem. We would like our tests to be structured as follows. ├── tests │ ├──…

---

## [Testing of parameterized function in streamlit](https://discuss.streamlit.io/t/testing-of-parameterized-function-in-streamlit/61267)

<div class="topic-metadata">

**Author:** [@ss\_mohanty](https://discuss.streamlit.io/u/ss_mohanty)\
**Replies:** 2\
**Last updated:** [February 3, 2024, 5:38pm UTC](https://discuss.streamlit.io/t/testing-of-parameterized-function-in-streamlit/61267 "2024-02-03T17:38:15Z")

</div>

In a streamlit project, i have two pages and these two pages depends upon other moudules and these module contains several functions. one of the function i have mentioned below i.e def delete\_items(connection,id,db,sche…

---

## [Usability testing on maze](https://discuss.streamlit.io/t/usability-testing-on-maze/59475)

<div class="topic-metadata">

**Author:** [@Ahmed\_elsebaei](https://discuss.streamlit.io/u/Ahmed_elsebaei)\
**Replies:** 0\
**Last updated:** [January 12, 2024, 3:58pm UTC](https://discuss.streamlit.io/t/usability-testing-on-maze/59475 "2024-01-12T15:58:21Z")

</div>

Hi all, I’m trying to integrate a streamlit app on “maze” which is a website that provides usability tests and challenges and tracks the user’s behaviour during the tests. In order to do this, I need to put the tracking…

---

## [Headless testing with AppTest and st.form](https://discuss.streamlit.io/t/headless-testing-with-apptest-and-st-form/56846)

<div class="topic-metadata">

**Author:** [@stat\_is\_quo](https://discuss.streamlit.io/u/stat_is_quo)\
**Replies:** 1\
**Last updated:** [December 5, 2023, 6:34pm UTC](https://discuss.streamlit.io/t/headless-testing-with-apptest-and-st-form/56846 "2023-12-05T18:34:20Z")

</div>

Greetings, is it possible in the current release of streamlit to use AppTest with st.form? If so, what is the syntax for accessing elements in the form? In the documentation, I see references to st.form\_submit\_button but…

---

## [Testing URL fragment with the new framework](https://discuss.streamlit.io/t/testing-url-fragment-with-the-new-framework/56019)

<div class="topic-metadata">

**Author:** [@Mortafix](https://discuss.streamlit.io/u/Mortafix)\
**Replies:** 3\
**Last updated:** [November 29, 2023, 8:32am UTC](https://discuss.streamlit.io/t/testing-url-fragment-with-the-new-framework/56019 "2023-11-29T08:32:57Z")

</div>

Hello Streamlit Community, I’m currently working on testing a Streamlit app and have encountered a challenge with a particular functionality that i’m using in my app. I’m reaching out for guidance or suggestions from th…
