2

Public example: suppose we want to select multiple skills from multiple select attribute of html. How we can achieve it using karate framework. Below is the html structure:

<select name="allowed_skills_select" id="id_allowed_skills_select" multiple="">
  <option value="290" selected="">Skill1</option>

  <option value="289">Skill2</option>

  <option value="288">Skill3</option>

</select>

From above structure I wanted to select all values i.e Skill1, Skill2 and Skill3, this can be done with control + click keyboard combination manually.

I have tried with select, mouse() and key.CONTROL as below:

 And script(xpath, [{ press: 'CONTROL' }, { click: xpath }])
 And input(xpath,Key.CONTROL)
 * karate.key(['ctrl'])
 * karate.mouse('click', {selector: xpath})
Ash Desh
  • 61
  • 2
  • see if this answer helps: https://stackoverflow.com/a/76623198/143475 - else please provide a public example, else no one can help – Peter Thomas Jul 12 '23 at 17:33
  • @PeterThomas, I have updated the description or body as you suggested. I hope this clarifies what I am looking for. – Ash Desh Jul 12 '23 at 17:57
  • sorry I can't help (maybe others can) - a lot depends on the JS on the page. no one can help unless we get access to the live page (or try to find something similar) - or, follow this process: https://github.com/karatelabs/karate/tree/master/examples/ui-test – Peter Thomas Jul 12 '23 at 17:59
  • Thank you, @PeterThomas, for providing the details. However, could you please assist me in understanding how I can utilize the "CONTROL + CLICK" keyboard key combination, where I need to hold the "CONTROL" key and simultaneously click in the Karate framework? – Ash Desh Jul 12 '23 at 18:38
  • you know, this could be a gap in karate. can you provide an example and we can investigate – Peter Thomas Jul 13 '23 at 03:36
  • please see how another team was able to help us come up with a solution: https://stackoverflow.com/q/76680593/143475 – Peter Thomas Jul 16 '23 at 14:04
  • did you read the link ? the point is I should be able to RUN your example – Peter Thomas Jul 26 '23 at 05:26
  • the link you mentioned have the example of list as a dropdown where as I require to select multiple value present as option from multiple dropdown selection. when use mouse action it deselect the already selected value. – Ash Desh Jul 26 '23 at 05:39
  • no worries, sorry I can't help more than this. maybe someone else here can help you, all the best. I suggest you ask a friend or someone next to you to read the link above and better understand what I am trying to ask you to do extra. if it helps, when I say example, I mean "LIVE EXAMPLE" – Peter Thomas Jul 26 '23 at 06:09

0 Answers0