Search code examples
user-interfaceselenium-webdriverautomationradio-buttonkarate

Karate Framework handling radio button


I am trying to assert a radio button clicked by default when page is loaded. Is there any idea how can I do it?

I automate a web application with Karate framework and not sure how to handle a radio buttons.


Solution

  • A lot depends on the HTML.

    But this may work:

    * def val = value('.my-locator')
    * match val == 'on'
    

    Note that value(), attribute() and even html() can be used to get ALL data about the HTML element. Refer the docs: https://github.com/karatelabs/karate/tree/master/karate-core#value