Checkbox in List (UnorderedList)

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

1 Like

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

How to handle Web Tables in Katalon Studio | Katalon Docs

1 Like

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.

Thanks for your interest

This is the HTML reference:

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

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

Thanks in advance

@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 :

@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.

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):

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

or

//*[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:

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

or

//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()].

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:

//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.

1 Like

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

1 Like