Karate UI: Selected option not applied on next page [duplicate]

▼魔方 西西 提交于 2021-01-05 11:30:40

问题


I'm attempting to do a simple select, then next page scenario.

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?


回答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'))")


来源:https://stackoverflow.com/questions/63222852/karate-ui-selected-option-not-applied-on-next-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!