There isn't a keyword in Selenium2Library to check if a particular radio button is selected or not. Can we have this implemented ?

1141 views
Skip to first unread message

Zabihullah Baig

unread,
Oct 3, 2017, 9:44:35 AM10/3/17
to robotframework-users
We have a keyword only to check if a group of radio buttons are selected or not.

Tatu Aalto

unread,
Oct 4, 2017, 8:03:22 AM10/4/17
to zab...@gmail.com, robotframework-users

On Oct 3, 2017 16:44, "Zabihullah Baig" <zab...@gmail.com> wrote:
We have a keyword only to check if a group of radio buttons are selected or not.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Zabihullah Baig

unread,
Oct 5, 2017, 4:58:12 AM10/5/17
to robotframework-users
Yes Aalto. I tried it. Its not doing what's required. In Selenium Python bindings we have a method for this named " is_selected() ". Kindly implement it. Let me know if i have to raise a bug in git.

rafi pathan

unread,
Oct 5, 2017, 5:21:11 AM10/5/17
to zab...@gmail.com, robotframework-users
I agree with Baig, There is a keyword to the selection of radio button but no direct keyword to check the selection of Radio button.

On Thu, Oct 5, 2017 at 2:28 PM, Zabihullah Baig <zab...@gmail.com> wrote:
Yes Aalto. I tried it. Its not doing what's required. In Selenium Python bindings we have a method for this named " is_selected() ". Kindly implement it. Let me know if i have to raise a bug in git.

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.



--


Regards,
Rafi Khan

Pekka Klärck

unread,
Oct 5, 2017, 5:33:00 AM10/5/17
to Zabihullah Baig, robotframework-users
2017-10-05 11:58 GMT+03:00 Zabihullah Baig <zab...@gmail.com>:
> Yes Aalto. I tried it. Its not doing what's required. In Selenium Python
> bindings we have a method for this named " is_selected() ".

I don't understand how using that would be different to what Radio
Button Should Be Set To already now supports. Could you clarify? Are
you proposing new functionality to that keyword or a new keyword? How
should it actually work?

> Kindly implement it. Let me know if i have to raise a bug in git.

Notice that this is an open source project and Tatu works with it on
his free time. Proposing enhancements is fine, but you cannot expect
that Tatu or someone else would immediately implement it. If we agree
the enhancement is valid, you can try implementing it yourself, pay
someone for implementing it, or just wait and hope that someone
implements it some day.

Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

Zabihullah Baig

unread,
Oct 8, 2017, 10:08:38 AM10/8/17
to robotframework-users
Pekka,

1. The keyword "Radio button set to" Verifies radio button group identified by group_name has its selection set to value. What i'm asking is for a keyword which checks the radio button is selected or not. Please go through the is_selected() method in Selenium Python binding if you still don't get it.

2.  I understand that. So only I have placed it as a request in google group rather than raising it as an issue in Git.

Thanks,
Zabi

Vara

unread,
Oct 9, 2017, 1:12:34 AM10/9/17
to robotframework-users
Checkbook should be selected can be used with xpath of the radio button, it should work

Zabihullah Baig

unread,
Oct 9, 2017, 7:14:28 AM10/9/17
to robotframework-users
Thanks Vara. That worked

Cristiana Vieira

unread,
Aug 28, 2018, 10:00:28 AM8/28/18
to robotframework-users
Hi,
I'm trying to check if a radio button is selected 
I tried to use Checkbox Should Be Selected with this xpath //input[@type="radio"][@data-test="address-shippingOption-0"] but it is not working. 
Do you have any suggestion?
Thanks

Bryan Oakley

unread,
Aug 28, 2018, 10:33:44 AM8/28/18
to avecpcrist...@gmail.com, robotframework-users
The normal way is to call Radio button should be set to on the entire group. However, if you want to check that a specific radiobutton is checked or not, you can use Get element attribute to fetch the value of the "checked" attribute. It will return "true" if it is checked. 

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.

Dmitriy

unread,
Aug 28, 2018, 11:04:24 AM8/28/18
to avecpcrist...@gmail.com, robotframework-users
How about another solutions? 
Find checked input and then verify its value.


Thanks,
Dmitriy

Varaprasad Bonam

unread,
Aug 28, 2018, 11:06:04 AM8/28/18
to dmitriy...@gmail.com, avecpcrist...@gmail.com, robotframe...@googlegroups.com
Checkboxshouldbe selected will work if you provide x-path

You received this message because you are subscribed to a topic in the Google Groups "robotframework-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/robotframework-users/T5BjpDYPSYI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to robotframework-u...@googlegroups.com.

Varaprasad Bonam

unread,
Aug 28, 2018, 11:08:37 AM8/28/18
to dmitriy...@gmail.com, avecpcrist...@gmail.com, robotframe...@googlegroups.com
xpath should be //input[@type="radio" and @data-test="address-shippingOption-0"]

On Tue, Aug 28, 2018 at 8:34 PM Dmitriy <dmitriy...@gmail.com> wrote:
You received this message because you are subscribed to a topic in the Google Groups "robotframework-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/robotframework-users/T5BjpDYPSYI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to robotframework-u...@googlegroups.com.

Chiru K

unread,
Aug 28, 2018, 12:08:58 PM8/28/18
to zab...@gmail.com, robotframework-users
On Tue 3 Oct, 2017, 7:14 PM Zabihullah Baig, <zab...@gmail.com> wrote:
We have a keyword only to check if a group of radio buttons are selected or not.

--

mannish...@gmail.com

unread,
Aug 11, 2022, 12:52:36 AMAug 11
to robotframework-users
I really appreciate  Tatu and other team members who are working on the robot framework to make Automation Engineers life easier by providing such an easy to understand framework. 

The reason why I am replying to an old thread is that I ended up with a similar issue.

Testcase code.

    Open Browser    file:///C:/Users/Mannish%20Kumar/Desktop/test.html    edge

    Select Radio Button    answer    yes

    Radio Button Should Be Set To    answer    yes

    Sleep    15

 Log Output

10:08:06.241    FAIL    Selection of radio button 'answer' should have been 'yes' but was 'on'.

Also, If I take it further and I want to check if the other radio button under same group with id "no" is not selected with "Radio Button Should Not Be Selected" Keyword then I can't check. The keyword will only check and return true if none of the Radio buttons under a group are selected. 


I even tried using the Keywords related to Checkbox as suggested here in the discussion but none of them helped me.




test.html
Logs.png
Reply all
Reply to author
Forward
0 new messages