
|
If you were logged in you would be able to see more operations.
|
|
|
|
Original Estimate:
|
Unknown
|
Remaining Estimate:
|
Unknown
|
Time Spent:
|
Unknown
|
|
|
Use the following html, to run the ruby script given below:
<head>
<title>
WET Test
</title>
</head>
<body>
<span>Text Box Label:</span>
<input type="text"/>
</br></br></br>
<span>Text Area Label:</span>
<textarea></textarea>
</br></br></br>
<span>File Label:</span>
<input type="file"/>
</br></br></br>
Text Box Label:
<input type="text"/>
</br></br></br>
Text Area Label:
<textarea></textarea>
</br></br></br>
File Label:
<input type="file"/>
</body>
################## Ruby Script ##################
puts Browser("title:=WET Test").TextField("index:=1").label
puts Browser("title:=WET Test").Textarea("index:=1").label
puts Browser("title:=WET Test").File("index:=1").label
puts Browser("title:=WET Test").TextField("index:=2").label
puts Browser("title:=WET Test").Textarea("index:=2").label
puts Browser("title:=WET Test").File("index:=2").label
###############################################
#################### Results ##################
>ruby Test.rb
Text Box Label:
Text Area Label:
File Label:
>Exit code: 0
###############################################
When the labels are kept within the <span> & </span> then they are NOT associated with the Textarea, TextField & File Controls. {For the index:=1, the label returned is empty string, since the label is kept within the <span> & </span>}
|
|
Description
|
Use the following html, to run the ruby script given below:
<head>
<title>
WET Test
</title>
</head>
<body>
<span>Text Box Label:</span>
<input type="text"/>
</br></br></br>
<span>Text Area Label:</span>
<textarea></textarea>
</br></br></br>
<span>File Label:</span>
<input type="file"/>
</br></br></br>
Text Box Label:
<input type="text"/>
</br></br></br>
Text Area Label:
<textarea></textarea>
</br></br></br>
File Label:
<input type="file"/>
</body>
################## Ruby Script ##################
puts Browser("title:=WET Test").TextField("index:=1").label
puts Browser("title:=WET Test").Textarea("index:=1").label
puts Browser("title:=WET Test").File("index:=1").label
puts Browser("title:=WET Test").TextField("index:=2").label
puts Browser("title:=WET Test").Textarea("index:=2").label
puts Browser("title:=WET Test").File("index:=2").label
###############################################
#################### Results ##################
>ruby Test.rb
Text Box Label:
Text Area Label:
File Label:
>Exit code: 0
###############################################
When the labels are kept within the <span> & </span> then they are NOT associated with the Textarea, TextField & File Controls. {For the index:=1, the label returned is empty string, since the label is kept within the <span> & </span>} |
Show » |
|
1) If there is a html <label> element, with a labelfor associated with the textfield (or other input as the case may be), then this gets the first preference.
2) Otherwise, we try to determine the text immediately before this control .
3) If (3) is an empty string (or string with spaces), then WET tries to determine if the control is in a table. If yes, then the text in the column just before the control is treated as the label.
In the above case, it is going to be quite difficult for WET to determine whether the <span> element appears just before the textarea or not