Hi Thanks for Helping me on this,

Sorry I couldn't give you full picture, I have made my test case in one script 
.rb file & i will Call using require command
Some thing like this

require ' TestCase_001'
require 'TestCase_002'

These will be ran through one .rb file

This will run perfectly but I got only one problem I am not able to run these 
test cases multiple times. I tried your idea of (10.times do) still unlucky :(

Thanks again,
Chethan


--- On Fri, 12/11/10, Chuck van der Linden <sqa...@gmail.com> wrote:

From: Chuck van der Linden <sqa...@gmail.com>
Subject: [wtr-general] Re: Unable to call ruby script multiple times!!
To: "Watir General" <watir-general@googlegroups.com>
Date: Friday, 12 November, 2010, 1:49 PM

In Ft_001 wrap all your code in a method definition

 def  Ft_001
   <rest of the script code here>
 end

The for the other script do this

 require 'Ft_001'
10.times do
   Ft_001()
 end

If you need to sleep after the execution you can put that in.   If you
need to use the value of 'i' inside your script then it changes only a
little

First, Your definition needs to contain i

def Ft_001(i)

Then the calling script then looks like this

 require 'Ft_001'
10.times do |i|
   Ft_001(i)
 end



On Nov 11, 11:35 pm, chethan sarathy <chethan2...@yahoo.co.in> wrote:
> here is my code
>
> @i = 1
>
> begin
>
>   require 'Ft_001' # This is my script
>   sleep(10)
>           
>   @i = @i+1
>           
>  end while @i < 10
>
> Thanks,
> Chethan
>
> --- On Wed, 10/11/10, Željko Filipin <zeljko.fili...@wa-research.ch> wrote:
>
> From: Željko Filipin <zeljko.fili...@wa-research.ch>
> Subject: Re: [wtr-general] Unable to call ruby script multiple times!!
> To: watir-general@googlegroups.com
> Date: Wednesday, 10 November, 2010, 2:28 PM
>
> On Wed, Nov 10, 2010 at 6:16 AM, Chethan <chethan2...@gmail.com> wrote:
> > But I am unable to execute multiple times.
>
> Show us the code.
>
> Željko
> --
> watir.com - community manager
>
> watirpodcast.com - host
> testingpodcast.com - audio podcasts on software testing. all of them
>
> --
>
> Before posting, please readhttp://watir.com/support. In short: search before 
> you ask, be nice.
>
>  
>
> watir-general@googlegroups.com
>
> http://groups.google.com/group/watir-general
>
> watir-general+unsubscr...@googlegroups.com

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

Reply via email to