Hi~

Thank you alex!
I got it. thank you so much.

allen
On Sun, Apr 12, 2009 at 9:00 AM, Alex Collins <a.j.collins...@gmail.com>wrote:

> I believe that the issue is that you are passing in an Array into goto,
> when it expects a string:http://wtr.rubyforge.org/rdoc/ - look at the
> Watir::IE class' goto method.
>
> You create an array on the following line:
> thisLocation = folderLocation, i
>
> Explicitly stated, you can read this as:
> thisLocation = [folderLocation, i]
>
> thisLocation is therefore an Array. To convert this to a string, simply
> call the "to_s" method on the array. For example:
>
> [1, 2].to_s => "12"
>
> ["c:\\file\\", "foo.bar"].to_s => "c:\\file\\foo.bar"
>
> You therefore need to amend your script so that you call:
> ie.goto(thisLocation.to_s)
>
> However, if you are looking to join file names to directory paths, I
> suggest you look at Ruby's File and Dir classes. They have many useful
> helpers, for example, File.join does exactly what we are doing above, but in
> a platform-safe manner.
>
> Alex
>
> On 12 Apr 2009, at 02:57, Chai Taolun wrote:
>
> Hi~
> Sorry, this is not like that, I want to visit some webpage using the name I
> store in the text file.
> I need to find a way to do this.
> Thank you
>
> allen
>
> On Sat, Apr 11, 2009 at 1:22 PM, kiran <gki...@gmail.com> wrote:
>
>>
>> Hi,
>> I think problem with folder path.
>> suppose if we want open a file located in D:\watir
>> The statement for watir
>> ie.goto("D:\\watir")
>>
>> it would help you.
>>
>> On Apr 11, 12:15 pm, Chai Taolun <ctco...@gmail.com> wrote:
>> > Hi~
>> >
>> > Ruby is new to me and I got this problem in this code. Could you give me
>> > some help? Thank you
>> >
>> > infile.each{
>> >   |i|
>> >   thisLocation = folderLocation, i
>> >   print thisLocation
>> >   k =testCaseNumber
>> >   while k !=0
>> >     ie = Watir::IE.new
>> >     ie.goto(thisLocation)
>> >
>> > and here is the error
>> > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb:358:in
>> > `method_missing': navigate (WIN32OLERuntimeError)
>> >     OLE error code:0 in <Unknown>
>> >       <No Description>
>> >     HRESULT error code:0x80020005
>> >       Type mismatch.    from
>> > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie-class.rb:358:in
>> > `goto'
>> >     from awat.rb:61
>> >     from awat.rb:54:in `each'
>> >     from awat.rb:54http://localhost:81/Homework/HswitchS.php>Exit code:
>> 1
>> >
>> > Thank you so much and looking forward your help ^_^
>> >
>> > Allen
>> > --
>> > There are some things in this world will never change and some things do
>> > change.
>>
>>
>
>
> --
> There are some things in this world will never change and some things do
> change.
>
>
>
>
>
> >
>


-- 
There are some things in this world will never change and some things do
change.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to