# Checkbox in List (UnorderedList)

**URL:** <https://forum.katalon.com/t/checkbox-in-list-unorderedlist/103032>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [November 2, 2023, 12:43pm UTC](https://forum.katalon.com/t/checkbox-in-list-unorderedlist/103032 "2023-11-02T12:43:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nithizunnikumaran21](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/nithizunnikumaran21/32/24700_2.png) [@nithizunnikumaran21](https://forum.katalon.com/u/nithizunnikumaran21)\
**Post date:** [November 2, 2023, 12:43pm UTC](https://forum.katalon.com/t/checkbox-in-list-unorderedlist/103032/1 "2023-11-02T12:43:39Z")

</div>

Hi all!

How to check the checkboxes that comes under the unordered list?

\*\*Depends on the text that contains in the same row/line

 ![UnordereListCheckBox](https://europe1.discourse-cdn.com/katalon/original/3X/e/f/ef6bfa66d3ffe53e9e95a3bcf4394f1968a9cd03.png)

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [November 2, 2023, 2:44pm UTC](https://forum.katalon.com/t/checkbox-in-list-unorderedlist/103032/2 "2023-11-02T14:44:39Z")

</div>

Can we see the HTML that you are working with? Otherwise,

[How to handle Web Tables in Katalon Studio | Katalon Docs](https://docs.katalon.com/docs/create-tests/keywords/using-keywords-in-katalon-studio/web-testing/how-to-handle-web-tables-in-katalon-studio)

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [November 2, 2023, 3:24pm UTC](https://forum.katalon.com/t/checkbox-in-list-unorderedlist/103032/3 "2023-11-02T15:24:04Z")

</div>

You just need an xpath that finds the input element based upon the associated text. As grylion asked, we need to see an example of the HTML for one of those.

---

<div class="post-metadata">

**Author:** ![nithizunnikumaran21](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/nithizunnikumaran21/32/24700_2.png) [@nithizunnikumaran21](https://forum.katalon.com/u/nithizunnikumaran21)\
**Post date:** [November 3, 2023, 4:45am UTC](https://forum.katalon.com/t/checkbox-in-list-unorderedlist/103032/4 "2023-11-03T04:45:19Z")

</div>

Thanks for your interest

This is the HTML reference:

 ![HTML1](https://europe1.discourse-cdn.com/katalon/original/3X/5/9/590e082958210daf3bf5a8b3bf266cf9da45e142.png)

\*\*And it’s not a web table we are using here

---

<div class="post-metadata">

**Author:** ![nithizunnikumaran21](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/nithizunnikumaran21/32/24700_2.png) [@nithizunnikumaran21](https://forum.katalon.com/u/nithizunnikumaran21)\
**Post date:** [November 3, 2023, 4:50am UTC](https://forum.katalon.com/t/checkbox-in-list-unorderedlist/103032/5 "2023-11-03T04:50:29Z")

</div>

Hi Brandon,

I could do it when the case is a grid table (using row & column)  
But here I interrupted by an unordered list

And moreover here, the text I want to check is dynamic with (dynamic id)

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/f/c/fcdee279bfcce224212fefa2364a6b7b489c72fb.png)

Thanks in advance

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [November 3, 2023, 5:34am UTC](https://forum.katalon.com/t/checkbox-in-list-unorderedlist/103032/6 "2023-11-03T05:34:39Z")

</div>

@nithizunnikumaran21

In order to study your case, I need to have the HTML file opened in browser on my my machine.

Could you save the problem web page into a MIME HTML file and share it here.

The following post tells you how to save the MIME HTML file :

> [@Unable to locate the element when element has same name](http://forum.katalon.com/t/unable-to-locate-the-element-when-element-has-same-name/95467/14):
>
> @shrutis, You can see the whole HTML of your target web page, but others in this forum can’t. You should be aware of this handicap. You may expect that somebody can tell you a correct answer without looking at the whole HTML. No, it is too difficult. You need to share the whole HTML publicly to be answered. How to share the whole HTML? — You can save the whole HTML as one file using Google Chrome. Once saved, you can attache the file to your forum post. open your target HTML in Chrome browse…

---

<div class="post-metadata">

**Author:** ![bharathi.a](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/bharathi.a/32/24695_2.png) [@bharathi.a](https://forum.katalon.com/u/bharathi.a)\
**Post date:** [November 3, 2023, 10:52am UTC](https://forum.katalon.com/t/checkbox-in-list-unorderedlist/103032/7 "2023-11-03T10:52:50Z")

</div>

@nithizunnikumaran21

create xpath with the Text that is there in the DOM for the input Tag

mostly the application that you are working on is created using an older version of DotNet and they migrated to the newest dotNet version.

this migration will cause this kind of problem in DOM but it will not create any issues in your application functionality.

you will soon experience the same in dropdowns/Combo boxes too.

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [November 3, 2023, 2:51pm UTC](https://forum.katalon.com/t/checkbox-in-list-unorderedlist/103032/8 "2023-11-03T14:51:21Z")

</div>

Perhaps you might try the following pathway to select the checkbox you have highlighted (obviously, you will have to use **your** keyboard to redo the actual text because of the **accents** et al within the text or you can double click on the text within the HTML and use copy from the browser and paste into KS):

```auto
//label[text()="Importacao de pedidos de Inspecao"]/preceding-sibling::input

```

or

```auto
//*[text()="Importacao de pedidos de Inspecao"]/preceding-sibling::input

```

To go **from** the text on the left to the other checkboxes on the right, you will have to start from the text again and then to the parent and then down (I would use following-sibling) to the other `<divs>`, and then down to the checkbox, like:

```auto
//label[text()="Importacao de pedidos de Inspecao"]/parent::div/following-sibling::div[1]/input

```

or

```auto
//label[text()="Importacao de pedidos de Inspecao"]/../following-sibling::div[1]/input

```

Just increase the **position** number within the `<div>` to move to the lower checkboxes, like div[2] or div[3] or div[last()].

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [November 3, 2023, 3:50pm UTC](https://forum.katalon.com/t/checkbox-in-list-unorderedlist/103032/9 "2023-11-03T15:50:46Z")

</div>

This xpath is similar to @grylion54’s, but I prefer to find the target element tag, then find qualifying items (other elements, attributes, etc.) relative to this. Give this one a try:

```auto
//input[@type='checkbox' and ./following-sibling::label[normalize-space()='enter your text here']]

```

Obviously, you’d replace the ‘enter your text here’ with the particular text you’re looking for at the time.

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [November 3, 2023, 3:55pm UTC](https://forum.katalon.com/t/checkbox-in-list-unorderedlist/103032/10 "2023-11-03T15:55:32Z")

</div>

And lastly, rather than having a dozen elements in the OR, you can just have **one** , by using the below:

[Parameterize Web Test Objects in Katalon Studio | Katalon Docs](https://docs.katalon.com/docs/create-tests/test-objects/web-test-objects/parameterize-web-test-objects-in-katalon-studio)
