Re: [wtr-general] Re: Read PDF with Ruby?????

2010-10-14 Thread Saurabh Gupta
Thanks for the reply Chuck.

And ya I verified each and every thing related to PDF file i.e. its
location, its name, its case, etc but what i feel there is some problem
with pdftk installation, and i will be very grateful if any idea you can
give me regarding this.


On Wed, Oct 13, 2010 at 11:32 PM, Chuck van der Linden wrote:

> That project is 4 years old and it does not appear to have had any
> updates since it originally went up on Rubyforge.  Not sure if that's
> a good thing (code is solid) or a bad thing (developer lost interested
> and moved on to other things).
>
> This group is specific to Watir, not general Ruby questions, since
> this has nothing to do with Watir, you'd be better off seeking help in
> a general Ruby forum, or from the developer of that gem
>
> In general, given the error you are getting, it appears that it can't
> find the pdf file to open.  Are you sure the PDF file is located in
> the root of your C: drive and that you've spelled the name right, etc.
>
> On Oct 12, 4:49 am, Saurabh Gupta  wrote:
> > Hello Friends,
> >
> > I am trying to read PDF file with the help of ruby.
> >
> > I started with download the latest pdftk i.e. pdftk-1.43-win.zip file
> > fromhttp://www.pdflabs.com/docs/install-pdftk/and extract it into
> > system 32 directory and install it from cmd.
> >
> > Then download the Xpdf version "xpdf-3.02pl2-win32"which is another
> > command line pdf manipulation program fromhttp://
> www.foolabs.com/xpdf/download.html
> > and put it also into system 32 directory.
> >
> > Then Install the required gem for the pdf toolkit i.e "pdf-
> > toolkit-0.5.0.gem" from "http://rubyforge.org/frs/?group_id=2345"; and
> > install it:
> > gem install c:\pdf-toolkit-0.5.0.gem.
> >
> > And then jump to the text edior of ruby and write the code to read the
> > pdf file:
> > require 'rubygems'
> > require 'pdf/toolkit'
> >
> > my_pdf = PDF::Toolkit.open("c:\\sample.pdf")
> > text = my_pdf.to_text.read
> > puts text
> >
> > But when I execute it, error comes:
> > "c:/ruby/lib/ruby/gems/1.8/gems/pdf-toolkit-0.5.0/lib/pdf/toolkit.rb:
> > 181:in `popen': No such file or directory - "pdftk" "c:\sample.pdf"
> > "dump_data" "output" "-" "dont_ask" (Errno::ENOENT)"
> >
> > Thanks in Advance.
> > Saurabh Gupta
> > saurabhgupta...@gmail.com
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> watir-general@googlegroups.com
> http://groups.google.com/group/watir-general
> watir-general+unsubscr...@googlegroups.com
>



-- 
Thanks
with regards
Saurabh Gupta
9711109426

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

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: Manipulate Keystrokes on a MAC

2010-10-14 Thread Ozzi
Hi CJ Romberger,

I am running my tests on a MAC and the browser im running them in is
Firefox v3.6.10
Not only that but It will also work on Windows as well.

what you should try is...
Im assuming in your test there is a step where you are clicking a
button and then after clicking on a particular button the Javascript
popup appears

If you put the line:
@browser.execute_script('window.alert = function () {};')
BEFORE the step where you are clicking the button then what you are
actually doing is disabling the javascript alert function just before
it will be called...
Therefore you can run the rest of you test without the interruption of
the Javascript popup.

The same or similar logic can also be used for Javascript Confirm and
Prompt boxes. In my test i have similar code for Confirm boxes where
when the javascript confirm box appears it is always making it true
therefore always confirming what it was prompting you to do.

Hope this helps... it took me an age to figure out a solution...

Kind regards,
Usman Hussain

On Oct 13, 6:55 pm, CJ Romberger  wrote:
> Ozzi, you're using this on your Mac?  What browser environment?
>
> I have Firefox and Chrome on my Mac, and I'm dead stuck on dismissing
> Javascript alert boxes.
>
> CJ
>
>
>
>
>
> On Wed, Oct 13, 2010 at 10:11 AM, Ozzi  wrote:
> > thanks for your help guys but i kinda cheated in the end... I kinda
> > wrote some javascript to disable the popup that appears when clicking
> > on one of the button...
> > i wrote:
> > @browser.execute_script('window.alert = function () {};')
>
> > this then turns off the alert boxes for the window...
> > it works for me and now i can run my scripts on all environments that
> > are available to me...
>
> > Thanks for all the help guys,
>
> > Usman Hussain
>
> > On Oct 12, 1:06 pm, ayan  wrote:
> > > You can try using Apple Script.
>
> > > On Mon, Oct 11, 2010 at 2:01 PM, Željko Filipin <
>
> > > zeljko.fili...@wa-research.ch> wrote:
> > > > On Thu, Oct 7, 2010 at 6:35 PM, Eric Mathiesen 
> > > > wrote:
> > > > > DONT BUY A MAC.
>
> > > > As far as I know, a lot of Watir developers use a Mac. (But it looks
> > like
> > > > nobody has to send keystrokes.)
>
> > > > Željko
>
> > > > --
> > > >  Before posting, please readhttp://watir.com/support. In short: search
> > > > before you ask, be nice.
>
> > > > watir-general@googlegroups.com
> > > >http://groups.google.com/group/watir-general
> > > > watir-general+unsubscr...@googlegroups.com > > >  legroups.com>
> > 
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > watir-general@googlegroups.com
> >http://groups.google.com/group/watir-general
> > watir-general+unsubscr...@googlegroups.com
>
> --
> CJ Romberger
> Wildwood Interactivehttp://www.wildwoodinteractive.com/
> 512.732.9916
>
> PLEASE NOTE: I only check this email address about once a day!  If you're a
> client, the fastest way to reach me is to login to Basecamp, OR email
> supp...@wildwoodinteractive.com.
>
> If you're NOT a client?  Why not become one!?  :)

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

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] running a test in a different language e.g. spanish

2010-10-14 Thread Ozzi
Hi Guys,

Bit of a random question...

But has anyone written a script and then used it to run in English,
Spanish, Italian etc...

What i mean is, has anyone run a script where all the button names can
be changed from English to another language like Spanish?

Is this even possible in Watir?

Do i have to write a wrapper type file to replace all the words with
ones that match up in Spanish?

This will save me time and avoid repeating code if i can just get the
test to change the keywords to spanish...

if you need more info then please let me know and i will try and
describe in more detail what i mean...

Kind regards,
Usman Hussain

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

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] running a test in a different language e.g. spanish

2010-10-14 Thread Charley Baker
Sure, there are ways to do this. I've tested sites in multiple
languages. There are a few libraries for localization in Ruby, take a
look for them. The basic premise is that you use tokens when referring
to visible text that get replaced by strings from various localized
files. Something along this vein:
http://guides.rubyonrails.org/i18n.html

hth,
Charley Baker
Lead Developer, Watir, http://watir.com



On Thu, Oct 14, 2010 at 5:22 AM, Ozzi  wrote:
> Hi Guys,
>
> Bit of a random question...
>
> But has anyone written a script and then used it to run in English,
> Spanish, Italian etc...
>
> What i mean is, has anyone run a script where all the button names can
> be changed from English to another language like Spanish?
>
> Is this even possible in Watir?
>
> Do i have to write a wrapper type file to replace all the words with
> ones that match up in Spanish?
>
> This will save me time and avoid repeating code if i can just get the
> test to change the keywords to spanish...
>
> if you need more info then please let me know and i will try and
> describe in more detail what i mean...
>
> Kind regards,
> Usman Hussain
>
> --
> Before posting, please read http://watir.com/support. In short: search before 
> you ask, be nice.
>
> watir-general@googlegroups.com
> http://groups.google.com/group/watir-general
> watir-general+unsubscr...@googlegroups.com
>

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

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: running a test in a different language e.g. spanish

2010-10-14 Thread Ozzi
Cool... ill take a look at the URL you sent over.
Thanks for that. will let you know how i get on...

Kind regards,
Usman Hussain

On Oct 14, 3:08 pm, Charley Baker  wrote:
> Sure, there are ways to do this. I've tested sites in multiple
> languages. There are a few libraries for localization in Ruby, take a
> look for them. The basic premise is that you use tokens when referring
> to visible text that get replaced by strings from various localized
> files. Something along this vein:http://guides.rubyonrails.org/i18n.html
>
> hth,
> Charley Baker
> Lead Developer, Watir,http://watir.com
>
>
>
> On Thu, Oct 14, 2010 at 5:22 AM, Ozzi  wrote:
> > Hi Guys,
>
> > Bit of a random question...
>
> > But has anyone written a script and then used it to run in English,
> > Spanish, Italian etc...
>
> > What i mean is, has anyone run a script where all the button names can
> > be changed from English to another language like Spanish?
>
> > Is this even possible in Watir?
>
> > Do i have to write a wrapper type file to replace all the words with
> > ones that match up in Spanish?
>
> > This will save me time and avoid repeating code if i can just get the
> > test to change the keywords to spanish...
>
> > if you need more info then please let me know and i will try and
> > describe in more detail what i mean...
>
> > Kind regards,
> > Usman Hussain
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search 
> > before you ask, be nice.
>
> > watir-general@googlegroups.com
> >http://groups.google.com/group/watir-general
> > watir-general+unsubscr...@googlegroups.com

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

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Re: Read PDF with Ruby?????

2010-10-14 Thread Charley Baker
I have no experience working with pdf readers, but this looks like a
more interesting one: http://github.com/yob/pdf-reader Here's a site
that has some examples:
http://pullmonkey.com/2010/01/18/ruby-pdf-reader-gem-tutorial/

 That being said, as Chuck mentioned you might have better luck on the
ruby-core list if you run across problems or need help. While it's
come up a few times over the years on this list, it's not a common use
case for most Watir users. Ruby-core is bound to have more info.

Charley Baker
Lead Developer, Watir, http://watir.com



On Thu, Oct 14, 2010 at 1:11 AM, Saurabh Gupta
 wrote:
>
> Thanks for the reply Chuck.
> And ya I verified each and every thing related to PDF file i.e. its
> location, its name, its case, etc but what i feel there is some problem
> with pdftk installation, and i will be very grateful if any idea you can
> give me regarding this.
>
> On Wed, Oct 13, 2010 at 11:32 PM, Chuck van der Linden 
> wrote:
>>
>> That project is 4 years old and it does not appear to have had any
>> updates since it originally went up on Rubyforge.  Not sure if that's
>> a good thing (code is solid) or a bad thing (developer lost interested
>> and moved on to other things).
>>
>> This group is specific to Watir, not general Ruby questions, since
>> this has nothing to do with Watir, you'd be better off seeking help in
>> a general Ruby forum, or from the developer of that gem
>>
>> In general, given the error you are getting, it appears that it can't
>> find the pdf file to open.  Are you sure the PDF file is located in
>> the root of your C: drive and that you've spelled the name right, etc.
>>
>> On Oct 12, 4:49 am, Saurabh Gupta  wrote:
>> > Hello Friends,
>> >
>> > I am trying to read PDF file with the help of ruby.
>> >
>> > I started with download the latest pdftk i.e. pdftk-1.43-win.zip file
>> > fromhttp://www.pdflabs.com/docs/install-pdftk/and extract it into
>> > system 32 directory and install it from cmd.
>> >
>> > Then download the Xpdf version "xpdf-3.02pl2-win32"which is another
>> > command line pdf manipulation program
>> > fromhttp://www.foolabs.com/xpdf/download.html
>> > and put it also into system 32 directory.
>> >
>> > Then Install the required gem for the pdf toolkit i.e "pdf-
>> > toolkit-0.5.0.gem" from "http://rubyforge.org/frs/?group_id=2345"; and
>> > install it:
>> > gem install c:\pdf-toolkit-0.5.0.gem.
>> >
>> > And then jump to the text edior of ruby and write the code to read the
>> > pdf file:
>> >         require 'rubygems'
>> >         require 'pdf/toolkit'
>> >
>> >         my_pdf = PDF::Toolkit.open("c:\\sample.pdf")
>> >         text = my_pdf.to_text.read
>> >         puts text
>> >
>> > But when I execute it, error comes:
>> > "c:/ruby/lib/ruby/gems/1.8/gems/pdf-toolkit-0.5.0/lib/pdf/toolkit.rb:
>> > 181:in `popen': No such file or directory - "pdftk" "c:\sample.pdf"
>> > "dump_data" "output" "-" "dont_ask" (Errno::ENOENT)"
>> >
>> > Thanks in Advance.
>> > Saurabh Gupta
>> > saurabhgupta...@gmail.com
>>
>> --
>> Before posting, please read http://watir.com/support. In short: search
>> before you ask, be nice.
>>
>> watir-general@googlegroups.com
>> http://groups.google.com/group/watir-general
>> watir-general+unsubscr...@googlegroups.com
>
>
>
> --
> Thanks
> with regards
> Saurabh Gupta
> 9711109426
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> watir-general@googlegroups.com
> http://groups.google.com/group/watir-general
> watir-general+unsubscr...@googlegroups.com
>

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

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] AutoITx3 works on one machine but not another for opening Excel files

2010-10-14 Thread Schase
I have a watir test that downloads some information from a web app to
an Excel file, and I then open the file to confirm the contents. On my
dev box everything works fine, but the scheduled automation runs (via
Hudson) always fail attempting to open the Excel file. I have checked
that the correct version of AutoITX3.dll is registered on both
machines (Ruby 1.8, Watir 1.6.5). No other versions of AutoITx3 are
registered on either machine. The error on the Hudson box is the one
expected if the dll is NOT registered, but it is present in regedit in
the same location as on my dev box. Both machines are WinXP. Running
the test manually on the Hudson box results in the same error --
unknown OLE server: 'Excel.Application' HRESULT error code:0x800401f3
Invalid class string.

I searched for similar errors and saw one instance here where running
on a virtual machine had caused similar problems, but only if the VM
window was closed. I don't think this is a code error since it runs on
the dev box. Any suggestions for debugging this?

TIA, Sabrina

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

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] AutoITx3 works on one machine but not another for opening Excel files

2010-10-14 Thread Ethan
I don't think this has anything to do with AutoIt, or indeed Watir - the
error is about excel, and looks like a WIN32OLE error.

Is Excel actually installed on your automation box? I've seen this error on
machines where Excel has not been installed.

If that's not the issue, you'll need to include more than the error message
- at a bare minimum include the full error class, stacktrace, and message,
and the code that raised the error. But if it's not actually anything to do
with Watir (and it doesn't look like it is), I don't know that anybody will
necessarily be able to help you here.

On Thu, Oct 14, 2010 at 14:58, Schase  wrote:

> I have a watir test that downloads some information from a web app to
> an Excel file, and I then open the file to confirm the contents. On my
> dev box everything works fine, but the scheduled automation runs (via
> Hudson) always fail attempting to open the Excel file. I have checked
> that the correct version of AutoITX3.dll is registered on both
> machines (Ruby 1.8, Watir 1.6.5). No other versions of AutoITx3 are
> registered on either machine. The error on the Hudson box is the one
> expected if the dll is NOT registered, but it is present in regedit in
> the same location as on my dev box. Both machines are WinXP. Running
> the test manually on the Hudson box results in the same error --
> unknown OLE server: 'Excel.Application' HRESULT error code:0x800401f3
> Invalid class string.
>
> I searched for similar errors and saw one instance here where running
> on a virtual machine had caused similar problems, but only if the VM
> window was closed. I don't think this is a code error since it runs on
> the dev box. Any suggestions for debugging this?
>
> TIA, Sabrina
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> watir-general@googlegroups.com
> http://groups.google.com/group/watir-general
> watir-general+unsubscr...@googlegroups.com
>

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

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Re: AutoITx3 works on one machine but not another for opening Excel files

2010-10-14 Thread Schase
Yes, Excel is on the machine and I am able to open up the file (which
downloaded correctly).  That's the only error I have, unfortunately.
I was hoping someone using Excel and Watir together might know of an
environment issue that could be causing the problem, since I agree it
doesn't seem to be the code ;-)  It never triggers on my development
box with all the nice debugging tools.


On Oct 14, 12:07 pm, Ethan  wrote:
> I don't think this has anything to do with AutoIt, or indeed Watir - the
> error is about excel, and looks like a WIN32OLE error.
>
> Is Excel actually installed on your automation box? I've seen this error on
> machines where Excel has not been installed.
>
> If that's not the issue, you'll need to include more than the error message
> - at a bare minimum include the full error class, stacktrace, and message,
> and the code that raised the error. But if it's not actually anything to do
> with Watir (and it doesn't look like it is), I don't know that anybody will
> necessarily be able to help you here.
>
> On Thu, Oct 14, 2010 at 14:58, Schase  wrote:
> > I have a watir test that downloads some information from a web app to
> > an Excel file, and I then open the file to confirm the contents. On my
> > dev box everything works fine, but the scheduled automation runs (via
> > Hudson) always fail attempting to open the Excel file. I have checked
> > that the correct version of AutoITX3.dll is registered on both
> > machines (Ruby 1.8, Watir 1.6.5). No other versions of AutoITx3 are
> > registered on either machine. The error on the Hudson box is the one
> > expected if the dll is NOT registered, but it is present in regedit in
> > the same location as on my dev box. Both machines are WinXP. Running
> > the test manually on the Hudson box results in the same error --
> > unknown OLE server: 'Excel.Application' HRESULT error code:0x800401f3
> > Invalid class string.
>
> > I searched for similar errors and saw one instance here where running
> > on a virtual machine had caused similar problems, but only if the VM
> > window was closed. I don't think this is a code error since it runs on
> > the dev box. Any suggestions for debugging this?
>
> > TIA, Sabrina
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > watir-general@googlegroups.com
> >http://groups.google.com/group/watir-general
> > watir-general+unsubscr...@googlegroups.com

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

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


Re: [wtr-general] Re: Manipulate Keystrokes on a MAC

2010-10-14 Thread Rajiv Nanduani
hi umar,

can you share us that script.
It will help us

thanks

On Wed, Oct 13, 2010 at 8:41 PM, Ozzi  wrote:

> thanks for your help guys but i kinda cheated in the end... I kinda
> wrote some javascript to disable the popup that appears when clicking
> on one of the button...
> i wrote:
> @browser.execute_script('window.alert = function () {};')
>
> this then turns off the alert boxes for the window...
> it works for me and now i can run my scripts on all environments that
> are available to me...
>
> Thanks for all the help guys,
>
> Usman Hussain
>
> On Oct 12, 1:06 pm, ayan  wrote:
> > You can try using Apple Script.
> >
> > On Mon, Oct 11, 2010 at 2:01 PM, Željko Filipin <
> >
> >
> >
> > zeljko.fili...@wa-research.ch> wrote:
> > > On Thu, Oct 7, 2010 at 6:35 PM, Eric Mathiesen 
> > > wrote:
> > > > DONT BUY A MAC.
> >
> > > As far as I know, a lot of Watir developers use a Mac. (But it looks
> like
> > > nobody has to send keystrokes.)
> >
> > > Željko
> >
> > > --
> > >  Before posting, please readhttp://watir.com/support. In short: search
> > > before you ask, be nice.
> >
> > > watir-general@googlegroups.com
> > >http://groups.google.com/group/watir-general
> > > watir-general+unsubscr...@googlegroups.com
> 
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> watir-general@googlegroups.com
> http://groups.google.com/group/watir-general
> watir-general+unsubscr...@googlegroups.com
>



-- 
RAJIV KUMAR




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

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com