question

rshankar avatar image
rshankar asked rshankar posted

clicking on HTML links using Labels as variables

Hi

I want to select an option from a drop-box on the web session using the label name as a variable.

 

For example: I tried using the following piece of code as a part of my procedure

 

Action: Select

Session: RGW

Description:  name=WAVE0_ENABLE label=$wireless_enable

where $wireless_enable="Enabled"

 

I get an error "Invalid web step, one or more specified options could not be found", but when I directly use the command

 

name=WAVE0_ENABLE label=Enabled, I see no failure. Is there a way I can make use of variable substitution instead of

hard coding it?

 

Regards

Ramachandran Shankar

 

iTestresponse map
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
sandeepreddynv avatar image
sandeepreddynv answered sandeepreddynv posted

Hi Shankar,

 

Could you please check the step properties of the select steps whether the field substitution is enabled or not.

 

Here I am attaching a screen shot for your reference.

 

Hope it helps!!

 

Thanks,

Venkat


Web.jpg (71.0 KiB)
6 comments
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sandeepreddynv avatar image sandeepreddynv ♦ commented ·

Also I would like to ask few more information:

 

1. Did you specify the variable before you are using it. like before the select step have you specified like

 

eval Web set wireless_enable enable

 

                                    OR

 

2. You are trying to create a variable at select step?

 

Thanks,

Venkat

0 Likes 0 ·
rshankar avatar image rshankar sandeepreddynv ♦ commented ·

I m passing the variable as an arguement of the procedure

0 Likes 0 ·
rshankar avatar image rshankar sandeepreddynv ♦ commented ·

That worked. Thanks

0 Likes 0 ·
rshankar avatar image rshankar sandeepreddynv ♦ commented ·

Hi

I m now trying to see if I can use the value of the input field instead of the label to edit the web page.

For Example,

I have a field called channel and here is the HTML code for that field

 

<select name="CHANNEL" class="textmono"> 

   <option selected="selected" value="0">Auto</option> 

   <option value="1">1 (2412 MHz)</option> 

   <option value="2">2 (2417 MHz)</option> 

   <option value="3">3 (2422 MHz)</option> 

</select> 

 

Right now I have automated the test case like this

 

Action: Select

Session: RGW:

Description :name=CHANNEL; label=$channel

 

 

where channel the label name that is passed into the procedure as an argument.

Eg: channel=1 (2412 MHz) to select option1.

 

Is there a way by which I can use the value of the option instead of the label for this step?

 

Regards

Ramachandran Shankar

0 Likes 0 ·
sandeepreddynv avatar image sandeepreddynv ♦ rshankar commented ·

Hi Shankar,

 

I hope it is not possible to use the value of the option directly here. Here is an example why this could not be done.

 

If we are having the labels like 

 

<Option 1> (test)

<Option 2> (run)

<Option 3> (test)

<Option 4> (exec)

 

In the above case if we are using value of the option instead of labels.. We have the value "test"for two times.. then the script might get confuse which label it should take whether label 1 or label 3.

 

For that reason we always will use label names instead of the value of the label or option from a dropdown list.

 

One more information like we could only select one option from a drop down list at a time.

 

Hope it help!!

 

Regards,

Venkat 

0 Likes 0 ·
rshankar avatar image rshankar sandeepreddynv ♦ commented ·

Thanks you for the quick response.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.