Sumith
Sumith

Reputation: 123

Click not working on combo-box down arrow button karate UI testing

I tried clicking on down arrow button for a Combo Box (Select is not available. Its a React JS application and once I click on arrow button only list shows selection items) using below karate command but click not happened in application and no error displayed. [The same xpath worked in selenium click command,and showing unique item on Inspect search]

And waitFor("//div[@id='root']/div/div[3]/main/div/div[3]/div[2]/div") And click("//div[@id='root']/div/div[3]/main/div/div[3]/div[2]/div")

Note: Then I tried below command
And assert('//div[@id='root']/div/div[3]/main/div/div[3]/div[2]/div').exists

and got error javascript evaluation failed: assert('//div[@id='root']/div/div[3]/main/div/div[3]/div[2]/div').exists, :1:19 Expected , but found root assert('//div[@id='root']/div/div[3]/main/div/div[3]/div[2]/div').exists

Upvotes: 0

Views: 1612

Answers (1)

Peter Thomas
Peter Thomas

Reputation: 58088

It would really help us if you follow this process, it is simple and should not take much time for you to give us a small snippet of static HTML (or you can mix react if really needed).

https://github.com/intuit/karate/tree/master/examples/ui-test

EDIT: you also seem to have mis-matched single and double-quotes in your code.

Also note that you should be able to fire a JS event or click by using the script() API. See this example: https://github.com/intuit/karate/tree/master/karate-core#script

So this is an alternate approach to be able to overcome any tricky situation that comes up.

Upvotes: 1

Related Questions