code: def test_selectbox():
      script = AppTest.from_string(
          """
          import pandas as pd
          import streamlit as st
  
          options = ("male", "female")
          st.selectbox("selectbox 1", options, 1)
          st.selectbox("selectbox 2", options, 0)
          st.selectbox("selectbox 3", [])
  
          lst = ['Python', 'C', 'C++', 'Java', 'Scala', 'Lisp', 'JavaScript', 'Go']
          df = pd.DataFrame(lst)
          st.selectbox("selectbox 4", df)
          """,
      )
      sr = script.run()
      assert sr.selectbox[0].value == "female"
      assert sr.selectbox[1].value == "male"
      assert sr.selectbox[2].value is None
      assert sr.selectbox[3].value == "Python"
  
      sr2 = sr.selectbox[0].select("female").run()
      sr3 = sr2.selectbox[1].select("female").run()
      sr4 = sr3.selectbox[3].select("JavaScript").run()
  
      assert sr4.selectbox[0].value == "female"
      assert sr4.selectbox[1].value == "female"
      assert sr4.selectbox[2].value is None
      assert sr4.selectbox[3].value == "JavaScript"
  
      sr5 = sr4.selectbox[0].select_index(0).run()
      sr6 = sr5.selectbox[3].select_index(5).run()
      assert sr6.selectbox[0].value == "male"
      assert sr6.selectbox[3].value == "Lisp"
  
      with pytest.raises(ValueError):
          sr6.selectbox[0].select("invalid").run()
  
      with pytest.raises(IndexError):
          sr6.selectbox[0].select_index(42).run()
  
      repr(sr.selectbox[0])
  
imports: from datetime import date, datetime, time
  import numpy
  import pandas
  import pytest
  from streamlit.elements.markdown import MARKDOWN_HORIZONTAL_RULE_EXPRESSION
  from streamlit.testing.v1.app_test import AppTest
label_desc: Use image node_id 26 for calling a global function with example usage: test_selectbox() without return types