[Wtr-general] method which contains array as the parameter

Paul Carvalho tester.paul at gmail.com
Mon Aug 21 10:26:41 EDT 2006


You can also use the "each" method... as in:

def run_check_links(ieHelper, arrayText)
   arrayText.each do |link_text|
      assert(ieHelper.link(:text, link_text.exists?)
      assert(ieHelper.link(:text, link_text.enabled?)
      assert_equal("link", ieHelper.link(:text, link_text).type )
   end
end


On 21/08/06, sikander <sikander at marlabs.com> wrote:
>
>  this method is restricted to check for only 3 specific links. But I want
> to define array[] as the parameter, and I want to pass any number of links
> and verify it.
>
> Here is what I want to do
>
> def run_check_links(ieHelper, arrayText[])
>
>                         i=0
>
>                         while i <= arrayText.length-1
>
>                         assert(ieHelper.link(:text, arrayText[i]).exists?)
>
>                         assert(ieHelper.link(:text,
> arrayText[i]).enabled?)
>
>                         assert_equal("link",ieHelper.link(:text,
> arrayText[i]).type )
>
>                         i+=1
>
>                         end
>
>             end
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060821/d2600b65/attachment.html 


More information about the Wtr-general mailing list