Hi,
Ranorex identifies radio buttons on a webpage individually not as a radio group. If we have a radio group with three options, do we need to add three different objects into OR? I would prefer having one object in OR and selecting the options based on the value provided in the code.
Thanks,
Suraj
Working with Radio buttons
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Working with Radio buttons
Hi,
You can of course just add one of the radio buttons to the repository, but then you have to use a repository variable otherwise Ranorex will not be able to identify the other ones during runtime, I would suggest taking a look at the following link: Using Variables within the Repository.
Regards,
Markus
Ranorex Support Team
You can of course just add one of the radio buttons to the repository, but then you have to use a repository variable otherwise Ranorex will not be able to identify the other ones during runtime, I would suggest taking a look at the following link: Using Variables within the Repository.
Regards,
Markus
Ranorex Support Team
-
- Posts: 29
- Joined: Sat Feb 25, 2012 12:10 am
Re: Working with Radio buttons
Thanks Markus for the reply. I could select the radio buttons by parametrizing the properties. But, I am still uncomfortable with verification because you can't directly get Value of selected radio button. Rather I need to check if each radio button in the group is selected or not to find the selected one.
Any thoughts?
Any thoughts?
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Working with Radio buttons
Hi,
You're welcome!
Can you send/post us a Ranorex Snapshot file of the radio buttons? This will help us analyzing the issue.
Following link will show you how to generate a snapshot file:
Creating Ranorex Snapshot Files
Regards,
Markus
Ranorex Support Team
You're welcome!
Can you send/post us a Ranorex Snapshot file of the radio buttons? This will help us analyzing the issue.
Following link will show you how to generate a snapshot file:
Creating Ranorex Snapshot Files
Regards,
Markus
Ranorex Support Team
-
- Posts: 29
- Joined: Sat Feb 25, 2012 12:10 am
Re: Working with Radio buttons
Hi Markus,
I've attached the snapshot file for radio button's parent so that you can see information of both the radio buttons (in this case Name & Account) in the group.
I've observed that this is the general behaviour of Ranorex with web radio buttons and it is not specific to just this application/web page.
Please let me know in case I need to provide more information.
Thanks,
Suraj
I've attached the snapshot file for radio button's parent so that you can see information of both the radio buttons (in this case Name & Account) in the group.
I've observed that this is the general behaviour of Ranorex with web radio buttons and it is not specific to just this application/web page.
Please let me know in case I need to provide more information.
Thanks,
Suraj
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Working with Radio buttons
Hi,
Please provide us the scenario you want to perform to help us providing a fitting solution.
Regards,
Tobias
Ranorex Team
What exactly do you want to perform/which scenario do need help with?SurajJaldu wrote:Please let me know in case I need to provide more information.
Please provide us the scenario you want to perform to help us providing a fitting solution.
Regards,
Tobias
Ranorex Team
-
- Posts: 29
- Joined: Sat Feb 25, 2012 12:10 am
Re: Working with Radio buttons
I would like to know which radio button is selected in the radio group.
Thanks,
Suraj
Thanks,
Suraj
Re: Working with Radio buttons
one way is to
1) Store the parent object(like table/container) in the repository.
2) Take the count of radio buttons present.
3) Go to each radio button using FOR.
4) Check for the property "CHECKED".
For i as integer = 1 to count-1
If object.checked then
'Radio button was selected.
Exit For
else
'Radio button was NOT selected.
end if
Next
1) Store the parent object(like table/container) in the repository.
2) Take the count of radio buttons present.
3) Go to each radio button using FOR.
4) Check for the property "CHECKED".
For i as integer = 1 to count-1
If object.checked then
'Radio button was selected.
Exit For
else
'Radio button was NOT selected.
end if
Next
-
- Posts: 29
- Joined: Sat Feb 25, 2012 12:10 am
Re: Working with Radio buttons
Hi Sham,
That's how I am doing it now. But, I don't like that approach and checking if there is a better solution. Thanks for your help.
Thanks,
Suraj
That's how I am doing it now. But, I don't like that approach and checking if there is a better solution. Thanks for your help.
Thanks,
Suraj
- artur_gadomski
- Posts: 207
- Joined: Mon Jul 19, 2010 6:55 am
- Location: Copenhagen, Denmark
- Contact:
Re: Working with Radio buttons
You can form a RxPath to find the checked radio button. Instead of name or text as attribute just use checked = true (or whatever it is for radio buttons). This way no matter which radio button is checked you will get it.
Re: Working with Radio buttons
can try below as artur_gadomski said,
Dim bool as boolean=host.local.tryfindsingle("./form/....../table[@id='ctl......']/tbody/tr/td/input[@checked='True']")
If bool then
'Found the selected Radio button.
else
'Not Found.
end if
Dim bool as boolean=host.local.tryfindsingle("./form/....../table[@id='ctl......']/tbody/tr/td/input[@checked='True']")
If bool then
'Found the selected Radio button.
else
'Not Found.
end if