# Is there a method to capture this type of drop down

**URL:** <https://forum.katalon.com/t/is-there-a-method-to-capture-this-type-of-drop-down/25961>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [May 22, 2019, 5:51am UTC](https://forum.katalon.com/t/is-there-a-method-to-capture-this-type-of-drop-down/25961 "2019-05-22T05:51:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rushantha](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/rushantha/32/5777_2.png) [@rushantha](https://forum.katalon.com/u/rushantha)\
**Post date:** [May 22, 2019, 5:51am UTC](https://forum.katalon.com/t/is-there-a-method-to-capture-this-type-of-drop-down/25961/1 "2019-05-22T05:51:26Z")

</div>

I want to go my account option in here(as attached screen shot). I tried with different methods mentioned in the documentation. but still i couldn’t click on “my account” option in this drop down. Is there anyway to do that.

 ![1](https://europe1.discourse-cdn.com/katalon/original/2X/f/fc3926abfa7e3fe1151286124c796ff664a66514.png)

---

<div class="post-metadata">

**Author:** ![Arnel](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/arnel/32/6360_2.png) [@Arnel](https://forum.katalon.com/u/Arnel)\
**Post date:** [May 22, 2019, 6:16am UTC](https://forum.katalon.com/t/is-there-a-method-to-capture-this-type-of-drop-down/25961/2 "2019-05-22T06:16:40Z")

</div>

Hi Rushantha,

There are several ways to click that dropdown item. As you can see in the html source, it has a unique locator of \_ngcontent-c2 class=“dropdown-item my-account”. Use that as your test object locator…

```auto
//just do a simple click
WebUI.click(findTestObject("your_dropdown-image"))
WebUI.waitForElementVisible(findTestObject("your_dropdown-Item_MyAccount"), 30)
WebUI.click(findTestObject("your_dropdown-Item_MyAccount"))

```

Or

Do it in a coded way. . . since it is a drop down, click the drop down image first and then collect the items…  
How to do it? Get the common locator of those two items, which is “dropdown-item” then make that as your test object then follow the simple code below:

```auto
//this will collect the dropdown items once it becomes visible in the website
java.util.List<WebElement> dropDownItems = WebUiCommonHelper.findElements(findTestObject("your_testObject"), 30)

/**
it will be stored in your list of webelement like this
0 = My Account
1 = Logout
**/

//to click that "My Account", do a click event using the list's index
dropDownItems[0].click()

```

That is also a convenient way if you need to logout after the test  
just use the index of “Logout”, no need to create another test object…

Make sure to import WebElement.

Hope that helps. . . 🙂

---

<div class="post-metadata">

**Author:** ![rushantha](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/rushantha/32/5777_2.png) [@rushantha](https://forum.katalon.com/u/rushantha)\
**Post date:** [May 22, 2019, 6:20am UTC](https://forum.katalon.com/t/is-there-a-method-to-capture-this-type-of-drop-down/25961/3 "2019-05-22T06:20:03Z")

</div>

@Arnel… Thanks for the help…let me try… 😀

---

<div class="post-metadata">

**Author:** ![rushantha](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/rushantha/32/5777_2.png) [@rushantha](https://forum.katalon.com/u/rushantha)\
**Post date:** [May 22, 2019, 10:48am UTC](https://forum.katalon.com/t/is-there-a-method-to-capture-this-type-of-drop-down/25961/4 "2019-05-22T10:48:03Z")

</div>

Hi @Arnel… Yes it is working … Thanks a lot… 👍👍

---

<div class="post-metadata">

**Author:** ![Arnel](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/arnel/32/6360_2.png) [@Arnel](https://forum.katalon.com/u/Arnel)\
**Post date:** [May 22, 2019, 10:50am UTC](https://forum.katalon.com/t/is-there-a-method-to-capture-this-type-of-drop-down/25961/5 "2019-05-22T10:50:03Z")

</div>

Cool!

Cheers. . . 🍻
