Ohk...Well then do try this...Even I have stumbled upon similar kind of
issue before..

$excel_path = Dir.getwd + '/Stores&Spares'
$excel_path = $excel_path.gsub('/','\\')


Let me know if this works. Just curious to know.



Regards,
Rahul S. Shetty


-----Original Message-----
From: Prince3105 [mailto:prince3...@gmail.com] 
Sent: Tuesday, December 01, 2009 3:59 PM
To: Watir General
Subject: [wtr-general] Re: Relative path

Thanks  Rahul

I already tried it returns the folder path but Watir expects the path
like below. Otherwise it throws error due to some regular expression
validation.

$excel_path = "e:\\Data\\Prince\\WatIR\\iComet\\TestCases\
\Stores&Spares"

Thanks,

Prince3105



On Dec 1, 2:09 pm, "Rahul S. Shetty" <rahulshe...@bsil.com> wrote:
> Hey Prince,
>
>   Can you try this:
>
> $excel_path = Dir.getwd + '/Stores&Spares' (Use single quotes and front
> slash)
>
> Regards,
> Rahul S. Shetty
>
> -----Original Message-----
> From: Prince3105 [mailto:prince3...@gmail.com]
> Sent: Tuesday, December 01, 2009 10:51 AM
> To: Watir General
> Subject: [wtr-general] Relative path
>
> Hi Experts,
>
> I put my Test scripts, test data excel files and test cases file in
>
> one folder and doing testing. When i change the whole bunch to another
>
> system i am facing folder path issues. I was working QTP , where i can
>
> solve this problem by relative path. Please take a look on my below
>
> code.
>
> $excel_path = "e:\\Data\\Prince\\WatIR\\iComet\\TestCases\
>
> \Stores&Spares"
>
> $excel = WIN32OLE.new("excel.application")
>
> $excel['Visible'] = true;
>
> $workbook = $excel.Workbooks.Open $excel_path
>
> $worksheet = $workbook.WorkSheets(4)
>
> $worksheet.Select
>
> So after searching rdoc i found one code and it returns the current
>
> path. But am unable to open the excel file.
>
> $excel_path = Dir.getwid + "\\Stores&Spares"
>
> it gives the current file path as below
>
> "E:/Data/Prince/WatIR/iComet/TestCases\\Stores&Spares"
>
> So my tests are failed. I  need something like below
>
> $excel_path = RelativePath+(\\Stores&Spares)
>
> It may not be a watir question but i dont have more experience in
>
> ruby. So please help me to solve this issue.
>
> Thanks,
>
> Prince3105
>
> --
>
> 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
athttp://groups.google.com/group/watir-general
>
> --
> 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
athttp://groups.google.com/group/watir-general

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

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