CSS Selection

Hi guys

I’m setting up a test with Katalon Recorder and I need to select a value of a drop & down

The value I’m looking for is passed through a csv file so I have to select it by the id of the element

The values/id of the drop & down are:

CORTE id = listitem0innerListBoxwfm-edit-window-type-list-orders

RECONEXIÓN id = listitem1innerListBoxwfm-edit-window-type-list-orders

REINSTALACIÓN id = listitem2innerListBoxwfm-edit-window-type-list-orders

RETIRO id = listitem3innerListBoxwfm-edit-window-type-list-orders

The difference between the ids is in the number that is after “listitem”. I’ve tried to create a “css = input” but it has not worked

css = input [id ^ = “listitem”] [id $ = “innerListBoxwfm-edit-window-type-list-orders”]

Could you help me to select the value that passed through the csv file?

If you need any more data, tell me what you want me to send you

test case

CSV file (ordenes.csv)

Thank you very much

PaCaBo

csv.PNG

test.PNG

Please, I urgently need help

Hi PaCabo

It is very hard to tell what seems to be the problem. When you say that you tried to create “css = input” and it didn’t work, what does it mean? Did you get an error report? Any messages?
Are you sure it is an input field you should be clicking? Try sharing some relevant HTML code if you can.

Mate Mrse said:

Hi PaCabo

It is very hard to tell what seems to be the problem. When you say that you tried to create “css = input” and it didn’t work, what does it mean? Did you get an error report? Any messages?
Are you sure it is an input field you should be clicking? Try sharing some relevant HTML code if you can.

Hi Mate Mrse

I’m sorry, but my English is not good enough to explain as well as I’d like, but I’ll try to explain my problem better.

I have a drop&dawn menu with 4 options and I need that Katalon Recorder select one of these options
.

The selection I want to do it through a CSV file that will be loaded at the start of the test with the data I want to test, but I do not know how to do the SUITE choose the one written in the CSV

The problem is that the identification of each of the 4 options changes by a numeric character that is in the middle of the ID string (see image)

This is part of the csv file that I load at the beginning and that here contains the title of the field “title” and the value “CUT” which is the one I want to load with a variable “$ {type}”


In order to obtain the ID of the drop & down, in the Test case details view, I try to use in the TARGET css = input [id $ = “innerListBoxwfm-edit-window-type-list-orders”], to be able to skip the numerical value of the ID

To give you more information to try to help me I leave the html code of the 4 options

OPTION CORTE

Corte

OPTION RECONEXION

Reconexión

OPTION REINSTALACION

Reinstalación

OPTION RETIRO

Retiro

If you need more things, do not hesitate to ask me because it is driving me crazy

Many many thnaks

csv file.JPG

orders.JPG

Hi PaCabo,

Thank you for using our product.

Sorry for the late response. If I understand the question correctly, you can use “storeEval” to set a variable for keeping the CSV file’s current line index. Then you can locate the element with that variable - say it’s “i”:

id = listitem${i}innerListBoxwfm-edit-window-type-list-orders

I made an example for you https://gist.github.com/devalex88/b25c3307dfd5340f59ff490a688fbc93

Alex said:

Hi PaCabo,

Thank you for using our product.

Sorry for the late response. If I understand the question correctly, you can use “storeEval” to set a variable for keeping the CSV file’s current line index. Then you can locate the element with that variable - say it’s “i”:

id = listitem${i}innerListBoxwfm-edit-window-type-list-orders

I made an example for you https://gist.github.com/devalex88/b25c3307dfd5340f59ff490a688fbc93

Hi Alex

Thank you very much for the response and the example, but I do not know how it can be adapted to my case

I have seen your example page and the mailbox ID is fixed, id = “first-name”, but in my case, the ID is different for each option, so I do not know how I can do it and I have more menus of this type by what will I have the same problem

I have uploaded a video to Vimeo to make it clearer which is my problem

https://vimeo.com/268358838

Thank you very much for your help

I noticed that in your video, the elements were spans, but the XPath locators were input[id=…].

Would something like this solve your problem?

storeEval | 0 | i
loadVars | data.csv
click | id = listitem**${i}**innerListBoxwfm-edit-window-type-list-orders
storeEval | i + 1 | i
endLoadVars

Alex said:

I noticed that in your video, the elements were spans, but the XPath locators were input[id=…].

Would something like this solve your problem?

storeEval | 0 | i
loadVars | data.csv
click | id = listitem**${i}**innerListBoxwfm-edit-window-type-list-orders
storeEval | i + 1 | i
endLoadVars

Hello again

I’m sorry but it does not work. If I see the log file, the variable always has the same value “0” although the csv file is read perfectly (Log file attached)

But, I think we’re talking about different things, because I do not want to try all the values in the drop-down menu. I want to load a csv file with all the test, which is longer than this part, but I need to be able to select the value that the csv sends to continue the test, as if I had to do a TYPE

I also send you the katalon command line (Testing.rar)

I also upload to Vimeo a video with a complete manual test that would be loaded through the CSV file

https://vimeo.com/268551757

log.rar

Testing.rar

Alex said:

I noticed that in your video, the elements were spans, but the XPath locators were input[id=…].

Would something like this solve your problem?

storeEval | 0 | i
loadVars | data.csv
click | id = listitem**${i}**innerListBoxwfm-edit-window-type-list-orders
storeEval | i + 1 | i
endLoadVars

Hi Alex

Everything is working with your solution. I have been silly because I did not realize to load every time I made a change in the csv file and when I saw the value of the variables I saw the error

Thank you very much for your help and your patience

1 Like

It’s great to hear that. If you have any issue don’t hesitate to let us know. We always appreciate your feedback.

1 Like