Survey Form - Radio Button Test Failing

I completed my survey form tonight and can’t seem to get it to pass the test for the radio buttons.

User Story #13: Inside the form element, I can select a field from one or more groups of radio buttons. Each group should be grouped using the name attribute.

I have the radio buttons in its own row and use the name attribute to group them. Not sure what else I need to do to get the test to pass.

Browser info: Version 68.0.3440.84 (Official Build) (64-bit)

Project link: https://codepen.io/Qwicksilver/pen/KBXjbY

Wow! I totally missed that part! Added in the value attribute and all the tests pass!

Thank you so much! It usually takes a second set of eyes to find a simple mistake. :slight_smile:

Thanks for the post, this helped me as well in general. Didn’t realize that the detailed errors dig deeper into sections than the general test case.

I know, right? Need to stop scanning and start reading my errors more. :sweat_smile:

I know this doesn’t directly contribute to the answer but make sure you have value=‘radio’ and NOT value:‘radio’. Took me 30 mins to see the mistake I made.

Thank you:grinning:It worked:grinning:

i didnt understand the assertion error
If you can help me that would be appreciated

The AssertionError :

AssertionError: All your radio-buttons must have a value attribute : expected 5 to equal 0

means that all the radio-buttons in the projects should have value attribute to them. Expected 5 to equal 0 means that test suit was looking for (expected) 5 radio buttons with value attribute in them but it found 0 such elements.

i put 5 radio buttons and it says that expected 6 to equal 5

Can you show your code?

yeah but its a mess
https://codepen.io/raccoon99/pen/eYdmWdY

there os a radio button inside your #name-label element

1 Like

thanks man!!
i have to be more careful next time :slight_smile:

Well yes it is bit of a mess :sweat_smile: All of your radio buttons have same id, which shouldn’t be the case id is used to uniquely identify an element so all the ids should be unique for each element. And also all your radio buttons have same value they all should also be different and meaningful. Its only the name attribute which should have same value for all the radio buttons in order to group them. But I think you just copy pasted radio buttons to check the that Assertion error so you didn’t really cleaned up these things. And @ILM already mentioned what was causing the problem. But i wrote all this so I’ll just post it anyways :joy:

1 Like

yeah i copied them to see whats going on
i did different buttons now .
Can i ask you a question?
I have to style them also right?

Hi @katerinaki.gr1!

Yes you do have to add css to this project.
If you have more questions on your project I would suggest opening a new topic and the community would be happy to discuss it there.

Thanks!

1 Like