# Acceptance test parameters

**URL:** <https://www.ruby-forum.com/t/acceptance-test-parameters/163436>\
**Category:** Rails\
**Created:** [March 20, 2009, 11:43am UTC](https://www.ruby-forum.com/t/acceptance-test-parameters/163436 "2009-03-20T11:43:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lune9](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e79b87/32.png) [@lune9](https://www.ruby-forum.com/u/lune9)\
**Post date:** [March 20, 2009, 11:43am UTC](https://www.ruby-forum.com/t/acceptance-test-parameters/163436/1 "2009-03-20T11:43:43Z")

</div>

Hi,

I wrote an acceptance test (using selenium) to test a specific product.  
But I would like to specify to my test the id of the product to test.

I run my test with the command rake test:acceptance my\_test.rsel

I tried the following syntax : rake test:acceptance my\_test.rsel 1 for  
the id #1 but it doesn’t work.

How can I do??

Thanks

---

<div class="post-metadata">

**Author:** ![lune9](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e79b87/32.png) [@lune9](https://www.ruby-forum.com/u/lune9)\
**Post date:** [March 20, 2009, 1:09pm UTC](https://www.ruby-forum.com/t/acceptance-test-parameters/163436/2 "2009-03-20T13:09:58Z")

</div>

Lune L. wrote:

> I wrote an acceptance test (using selenium) to test a specific product.  
> But I would like to specify to my test the id of the product to test.

Firstly, a test that requires input is not a “test”, it is a “script” or  
“utility”. A true test would work from a list of products and test all  
of them,  
unattended.

That said, understand that rake is a program that runs programs, so it  
does not  
pass arguments to them by default. I think there’s a system for that,  
but this  
always works on make-style programs:

rake PRODUCT=1 test:acceptance …

Then access the PRODUCT inside the test with ENV[‘PRODUCT’].

---

<div class="post-metadata">

**Author:** ![lune9](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/e79b87/32.png) [@lune9](https://www.ruby-forum.com/u/lune9)\
**Post date:** [March 20, 2009, 1:38pm UTC](https://www.ruby-forum.com/t/acceptance-test-parameters/163436/3 "2009-03-20T13:38:30Z")

</div>

Phlip wrote:

> Lune L. wrote:
> 
> > I wrote an acceptance test (using selenium) to test a specific product.  
> > But I would like to specify to my test the id of the product to test.
> 
> Firstly, a test that requires input is not a “test”, it is a “script” or  
> “utility”. A true test would work from a list of products and test all  
> of them,  
> unattended.
> 
> That said, understand that rake is a program that runs programs, so it  
> does not  
> pass arguments to them by default. I think there’s a system for that,  
> but this  
> always works on make-style programs:
> 
> rake PRODUCT=1 test:acceptance …
> 
> Then access the PRODUCT inside the test with ENV[‘PRODUCT’].

You perfectly understand what I want to do. but it says that  
ENV[‘PRODUCT’] is nil
