TestProject Forum

How to read radio button data?

I have a test that will verify the value of Enquiry from the table above. How do I read the white dot inside the radio button? I’m trying GET COLOR earlier but the white dot is too small to be the dominant color.

Get color is not what you’re looking for because you want to verify the value of Enquiry. To do that, I don’t think there is an easy addon you can use. My approach would be to combine the ‘Is Present?’ step with and an xpath locator to solve my issue. If you’re not familiar with xpath, you might need to do some googling to learn about it.

To answer your question properly, what is the problem you are trying to solve after you get the value? Let’s say you can verify that Retail is selected, do you have another verification to check it’s correct for that scenario?

i was trying to verify if my choices entered in creating the entry is the same in its view form. I tested a website where you have to enter a customer data and verify if the entered entries are consistent with the saved one.

I tested it but unfortunately both return an Element is present result. one is the empty one is with white dot.

Can you post:
the locator you are using for element is present
the HTML for the ‘Enquiry’ section

Did you try to identify the element with the right xpath? I realized another option you can use is ‘Is Selected?’.

I think you mistook this button as selectable. This is the view page where all display are not editable. I’ve tried using Compare two images and it works fine, my only problem for that is there’s no value i can use if the images matched. sort of like a boolean True or False (1 or 0), so that we can store it in a parameter to be used as a condition.

Or maybe I’m not that oriented yet with with that addon.

I think you mistook this button as selectable. This is the view page where all display are not editable.

You may not be able to edit the radio button on the page, but I assume there is a ‘checked’ attribute (or similar) to indicate that it is the selected value. For example
<input type="radio" id="huey" name="drone" value="huey" checked>

See <input type="radio"> - HTML: HyperText Markup Language | MDN for more info.

It sounds like you have found something that works for you for now. If you still prefer to store the value, it would help if you could post the info I asked before:

The locator you are using (or tried to use) for the element ‘Is present?’
The HTML for the ‘Enquiry’ section