History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: WET-47
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Minor Minor
Assignee: Unassigned
Reporter: Alister Scott
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
WET

Dynamically creating objects from datatable

Created: 16/May/06 10:28 PM   Updated: 05/Aug/06 05:54 AM
Component/s: WET DOM Interface
Affects Version/s: None
Fix Version/s: 0.9.8_beta1

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: WINXP SP2


 Description  « Hide
When using the following code:

ToCheck_Button = Repository("CreateDetails").Radio(Regexp.new("suffix:=#{datatable.item("PrimaryDetail")}.*"))
if (ToCheck_Button.check_exists() == nil)
      ToCheck_Button.set()
else
       reporter.ReportFailure("Radio Button for primary detail does not exist","","")
end

At the moment it executes OK, but a error is red appears in my results.html file:

private method `split' called for /suffix:=Physical.*/:Regexp => Error

 All   Comments   Work Log   Change History      Sort Order:
Raghu Venkataramana - 18/May/06 08:49 PM
Actually this works, if the line used is:

ToCheck_Button = Repository("CreateDetails").Radio(Regexp.new("suffix:=#{datatable.item("PrimaryDetail")}.*"))

--- pasted from users's list:
There is another way of dynamically creating objects. For example, for the radio button, you could define
          <Object Name="Dyn_RadioButton" Type="Radio">
            <Def Type="ChildObject">
              <Description>
                <suffix>/#{$qr_param1} .*/</suffix>
              </Description>
            </Def>

in your object repository. Then in your test scripts, you could directly call,

to_checkbutton=Repository("Dyn_RadioButton", datatable.item('PrimaryDetail'))