Natasha,
Lower case you 'I' in 'If'
Also dont underscore your module names.
What editor you using?
Aidy
On 26/11/2008, Natasha <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> Please could you help me understand the fix for a syntax error in the
> following code:
>
>
> ----------------------------------------------------------------------------------------------------
> require 'watir' # the controller
> require 'test/unit'
>
> module UpsellPage_Sticker
>
> def SelectQuantity(qty)
> If qty > 0 and qty <=5
> # assert
> begin
>
> assert($ie.select_list(:id,"ddlQuantity").includes?(/#{qty}
> pack/),"No option for #{qty} " + $ie.url)
> puts 'UpsellPage_Sticker :: SelectQuantity -
> Assertion passed'
>
> rescue StandardError => ex
> print "\n\nUpsellPage_Sticker :: SelectQuantity => "
> + ex + "\n\n"
> raise
> $ie.close
> end
>
> # execute
>
> $ie.select_list(:id,"ddlQuantity").select_value(/#{qty} pack/)
> puts "UpsellPage_Sticker:: SelectQuantity - #{qty} qty
> selected on
> Upsell Page \n"
> end
>
> end
> end # end of module
>
>
> ----------------------------------------------------------------------------------------------------
>
> If I remove IF construct from the method, it works fine. Other wise it
> gives an error " syntax error, unexpected kEND, expecting $end
> (SyntaxError)". Am I missing something here?
>
> Please help me.
>
> Thanks,
>
> Natasha
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines:
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---