thanks,that's can work.
here is another problem in this code "data = [] ",I must assign which
element  i want to use,like "data = [0] ",or do a loop


I have use the  the Roo gem, that's  really a good !



On 9月14日, 下午8时46分, joedio <[email protected]> wrote:
> If I'm reading this correctly, your issue is that the line of code:
>
> ie.form(:id,'commonLoginform').text_field(:name,
> 'username').set'$user'
>
> is incorrectly setting the name of the variable ($user) and not
> the value held in that variable.  When you quoted "$user" it was
> being defined as a String, not a variable.
>
> Try this:
>
> ie.form(:id,'commonLoginform').text_field(:name,
> 'username').set($user)
>
> Joe
>
> P.S.
> Strongly recommend you look into using the Roo gem instead of dealing
> with Excel with win32ole.
> Roo has numerous benefits, such as not needing Excel installed to read
> the spreadsheet, thus its also platform independent!
> Just one if its benefits.
>
> http://roo.rubyforge.org/
>
> gem install roo
>
> On Sep 14, 2:01 am, lifeng jiang <[email protected]> wrote:
>
>
>
>
>
>
>
> > hi all:
> >      I want to get values from excel,here is my code:
>
> > ie.link(:text,"XXX").click
> > ie.form(:id,'commonLoginform').text_field(:name,
> > 'username').set'$user'
> > ie.form(:id,'commonLoginform').button(:class,'btn').click
>
> > it's my file Excel :
> > jiangsquall
>
> > I want to set a value(jiangsquall) to the text_field,but in fact,it
> > set "$user" to the text_field.
> > how to get the value(jiangsquall) which I want ?

-- 
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