# Dropdown handling via Selenium WebDriver

**URL:** <https://forum.inductiveautomation.com/t/dropdown-handling-via-selenium-webdriver/80899>\
**Category:** Automated Testing\
**Tags:** perspective\
**Created:** [October 24, 2023, 12:07pm UTC](https://forum.inductiveautomation.com/t/dropdown-handling-via-selenium-webdriver/80899 "2023-10-24T12:07:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Klara\_Motlova](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@Klara\_Motlova](https://forum.inductiveautomation.com/u/Klara_Motlova)\
**Post date:** [October 24, 2023, 12:07pm UTC](https://forum.inductiveautomation.com/t/dropdown-handling-via-selenium-webdriver/80899/1 "2023-10-24T12:07:49Z")

</div>

Is there a way how to open a dropdown and select an item using Selenium WebDriver and Python? Could you write an example? DomID used.

 ![selenium_dropdown](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/0/40bb5d0e6ea33fdf30de64cde23f5c751926931a.png)

---

<div class="post-metadata">

**Author:** ![ggross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ggross/32/12668_2.png) [@ggross](https://forum.inductiveautomation.com/u/ggross)\
**Post date:** [October 25, 2023, 12:08am UTC](https://forum.inductiveautomation.com/t/dropdown-handling-via-selenium-webdriver/80899/2 "2023-10-25T00:08:27Z")

</div>

If you are leveraging the [ignition-automation-tools](https://github.com/inductiveautomation/ignition-automation-tools) repo that we have made available, then you would do something like the following:

```auto
from Components.PerspectiveComponents.Inputs.Dropdown import Dropdown

_DROPDOWN_LOCATOR = (By.ID, 'a464....')
_option = '{option you want selected}'

_dropdown = Dropdown(locator=_DROPDOWN_LOCATOR, driver=driver)
_dropdown.select_option_by_text_if_not_selected(option_text=_option)

```

To allow your repo to work with ours, you would leverage the `PYTHONPATH` environment variable when running the test. The syntax would look like (assuming a Linux based OS):

```auto
export PYTHONPATH={Path to your Python Test}:{Path to the ignition-automation-tools workspace}

```

e.g.

```auto
export PYTHONPATH=/PycharmProjects/ExampleFramework/TestSuite:/git/ignition-automation-tools

```

Garth

---

<div class="post-metadata">

**Author:** ![Klara\_Motlova](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@Klara\_Motlova](https://forum.inductiveautomation.com/u/Klara_Motlova)\
**Post date:** [October 30, 2023, 2:44pm UTC](https://forum.inductiveautomation.com/t/dropdown-handling-via-selenium-webdriver/80899/3 "2023-10-30T14:44:41Z")

</div>

Thank you a lot. It really looks pretty time-saving!

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [November 1, 2023, 2:46pm UTC](https://forum.inductiveautomation.com/t/dropdown-handling-via-selenium-webdriver/80899/4 "2023-11-01T14:46:10Z")

</div>

A post was split to a new topic: [Providing domId for use in EmbeddedView](https://forum.inductiveautomation.com/t/providing-domid-for-use-in-embeddedview/81307)

---

<div class="post-metadata">

**Author:** ![jakned](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jakned](https://forum.inductiveautomation.com/u/jakned)\
**Post date:** [November 6, 2023, 9:09am UTC](https://forum.inductiveautomation.com/t/dropdown-handling-via-selenium-webdriver/80899/5 "2023-11-06T09:09:20Z")

</div>

Hi, is there a plan to publish this library in PiPY so one can install it with pip into a project?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [November 6, 2023, 3:18pm UTC](https://forum.inductiveautomation.com/t/dropdown-handling-via-selenium-webdriver/80899/6 "2023-11-06T15:18:57Z")

</div>

Not at this time, no - although the only real obstacle is probably our regular workload. We'll look into what might need to be done for this to determine feasibility.
