Select option from drop-down box by *katalon recorder*google chrome extension

Could you try this in console:

;(function($){
$(‘select[name=“chargingPoint.chargingPointType”]’).val(‘106’).trigger(‘change’);
})(jQuery);

In katalon, please make sure your using runScript too, if the above works in console for you.

With the $ var it could be either jquery just isnt loading or,the $ var and its not being released so it won’t collide with other libraries, again i dont know your set up… so its at best guess, but the above would confirm somewhat this.

Thanks

1 Like

Remember the quotations, cant copy it from here as it throws them in wrong :wink:

hi,

paste first to notepad and copy from there

1 Like

It will still throw them in wrong unfortunately (would love to know why copying from the comments does that though), but he’d best just pasting and changing them himself,
or take it from the file below :joy::
scriptTest.txt (114 Bytes)

1 Like

That’s fine :slight_smile: that’s expected.
Did it change the value in the dropdown?
If yes, then bang that in the runScript command in katalon and it should then work :+1:
Thanks

Yeeessssss, Finally, OK can you please tell me how should I exactly but this in the katalon recorder ;
I mean in the command target value.

Thank You a looooooot :smiley:

1 Like

Just put that function into the target as before :slight_smile:
as seen below:
image
Command: runScript
Target: ;(function($){ $(‘select[name=“chargingPoint.chargingPointType”]’).val(‘111’).trigger(‘change’); })(jQuery);

1 Like

Thank you very much it was realy helpful <3

1 Like

Your Welcome! :blush:

If you want any advice, I’d look into the basics of JQuery, Javascript and XPaths/CssSelectors, these will help you massively with the more complex HTML pages and how they render and features of webpages, and more so due to using this browser plugin.

Also, if you wanted to go one step further, you could extract that function and pass the parameter(s) and locator, which you could use an extension script, so that way you could reuse that function across your whole site.

All the best!
Don’t be afraid to drop me a message directly if you need a hand :slight_smile:

– Was a good little page you had here, a first for me with how it renders due to the plugins and i picked up a few little things here! – So Thank you!!

2 Likes