Radio button inside a table is not working.
In my case mostly all the radio buttons are inside a
table.
Here's a test url:
http://www.cs.tut.fi/~jkorpela/forms/tables.html
There are a few radio buttons inside a table titled
GENDER (which is also true in my case above), I am
trying to click on one of them using ClickTableData
(id).
ClickRadioButton(name,value) fails with this error
"Found a FORM
Can't call method "click" on an
undefined value at C:/Perl/site/lib/Win32/SAM.pm
line 1272."
I tried both :
ClickRadioButton("gender",2); and
ClickTableData("ms__id14");
in my pl file.
ClickTableData()actually finds the id, however the
radiobutton does not get selected.:( It stays at the
default selection (Unspecified)
please help.
thx in advance
Logged In: YES
user_id=1646550
Originator: NO
I do not believe this problem is because you have the radio button in a table, but because it is in a form; AND you have multiple forms on your page.
Look at SAM.PM and you will see that FORMNAME is not a parameter for the function "ClickRadioButton"
sub ClickRadioButton { #$radioName, $radioValue
So if you have multiple forms on a page, you cannot specify which one.
Here is a similar response I posted to Yahoo groups "PERLsamie":
I ran into a similar sounding problem, which might help you. I cannot
answer directly, so you will have to do with an analogy:
Some functions allow you to specify the name of the form as an input
parameter.
If there are multiple forms on a page, this is a must because if no
"formname" input, SAMIE will assue that it lives in the first form on
the page.
Here is an example:
SetListBoxItem (find this in SAM.pm)
sub SetListBoxItem { #$SelectName, $ItemName, $formname
...snip...
Slingshot will find this object for you and show you sample input like
this: SetListBoxItem("listname","Your input here")
Notice that the name of the form is not include. If you have multiple
forms on the page you want it to look like this:
SetListBoxItem("listname","name of item","name of form")
There are some function that will not work if embedded in multiple
forms on a page.
and example is: ClickRadioButton
...
sub ClickRadioButton { #$radioName, $radioValue
...
I am assuming that because the is no "formname" as a parameter for
this function that is fails when embedded in multiple forms.
Hope that helps you some...
--Nick