On Thursday, June 7, 2012 6:44:52 AM UTC-7, Sergey Erokhin wrote:
>
> varBrowser = :ie  # Here i would like to pass whether my scripts to run in 
> IE or Firefox
> browserIE = Watir::Browser.new(varBrowser)
>

That should work.  notice that he defines varBrowser as a symbol, not a 
string.

You could define it as a string (without the leading colon) and the call 
.to_sym method to convert your string to a symbol

     browser_flavor = 'chrome'
     browser = Watir::Browser.new browser_flavor.to_sym

If you want to pass this into your scripts somehow, you might want it to 
read the browser_flavor from an environment variable
 

>
> On Thursday, June 7, 2012 9:59:31 AM UTC+3, gajendra wrote:
>>
>> Hi,
>>
>> I am trying to run my scripts either on IE or Firefox based on the 
>> setting. when i run the script i am getting the following error. Kindly let 
>> me know how to fix this.
>>
>>

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

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to