1
Scenario: Sample scenario

 Given driver 'https://material-ui.com/components/selects/'
 * delay(5000)
 * scroll("//div[@id='demo-simple-select']")
 * click('#demo-simple-select')
 * click("//div[@id='demo-simple-select']")
 * Karate.stop(500)

Note: Here there is no native or traditional dropdown.Javascript/Material UI dropdown is used.

Ninja
  • 433
  • 3
  • 10
  • this question does not help anyone. follow this process if you can, or try to figure this out on your own: https://github.com/intuit/karate/tree/develop/examples/ui-test – Peter Thomas Sep 10 '20 at 03:53
  • Hi Peter, my query is specific to javascript/material ui dropdown and not related to native/traditional dropdown. In the earlier similar thread(https://stackoverflow.com/questions/61798732/karate-ui-drop-down-handling) your solutions works since it's traditional dropdown if you check the HTMLattached to that thread. if you check https://material-ui.com/components/selects/ there are non traditional dropdown which not getting clicked using karate commands like click/select/script(). In my project similar material ui is used. Happy to be advised for the solution. Thanks. – Pravin Suroshe Sep 10 '20 at 10:01
  • I don't know anything about material ui. karate can handle html / js if you know what to do. your question has zero detail that helps answer, it can be re-opened if you edit your q. but I repeat, in my opinion, the only way you can get an answer is to follow the process in my link above. all the best – Peter Thomas Sep 10 '20 at 10:03
  • Hi Peter, sorry for the trouble. For live example I can not share project html page/code because of company policy. But yes for live example please check url (https://material-ui.com/components/selects/) Under "Simple Select" heading section, there are many dropdowns(Material UI) as an example. Please pick the first one, for which – Pravin Suroshe Sep 10 '20 at 10:31

1 Answers1

0

Use mouse() and input() for e.g.

* mouse('#demo-simple-select').click()
* input('body', Key.ENTER)

If all this fails, try JS: https://stackoverflow.com/a/60800181/143475

Note that for "native" select boxes, use select(): https://stackoverflow.com/a/61803260/143475

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248