1

I'm attempting to do a simple select, then next page scenario. enter image description here

I am able to successfully select the option with the follow ie:

* select('#detectorType', 'VECTOR_SPACE_EXPANDED')

or

* select('select[id=detectorType]', 1)

I can see the menu options change on the UI.

However, when I complete the form and go the next page, only the default selection is applied (the first one on the list).

I also tried doing a script as per the w3.org. No luck either. Manual intervention works.

Why isn't the selected option being applied?

Puti
  • 101
  • 8

1 Answers1

1

Most likely because of a lot of fancy JavaScript on the page. No one can tell unless there is a way to simulate. The best option is for you to submit an example using this process: https://github.com/intuit/karate/tree/develop/examples/ui-test

That said, see if firing a onChanged event manually will get you going. See this answer for details: https://stackoverflow.com/a/60800181/143475

For example as given in the docs: https://github.com/intuit/karate/tree/develop/karate-core#script

* waitFor('#someId').script("_.dispatchEvent(new Event('change'))")
Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • Thank you for the info. Whatever crazy javascript is happening, I'm unable to get it to trigger. To add, using a click() on the menu id or text gets a successful response from karate but nothing happens in the UI. Attempting to runs scripts hasn't worked either but I'm not an expert in this area. I'll keep digging. – Puti Aug 05 '20 at 04:15