[wtr-general] Re: Unable to Maximize the IE 8, Received error while executing the script

2011-07-05 Thread Aditya
Please let me know this how to overcome this.

On Tue, Jul 5, 2011 at 5:44 PM, V  wrote:

> Hi,
>
> My script Opened the browser. Navigated to Google.Tried to Maximize
> the browser(IE 8).
> Below error Came while i executed the script.
>
> Watir Version:1.9.1
>
> Please let me know.
>
> UiaDll: CoCreateInstance failed. hr = 0x80040154D:/Ruby187/lib/ruby/
> gems/1.8/gems/ffi-1.0.9-x86-mingw32/lib/ffi/library.rb:75:in
> `ffi_lib': Could not open library 'D:/Ruby187/lib/ruby/gems/1.8/gems/
> rautomation-0.6.0/lib/rautomation/adapter/win_ffi/
> ms_uia/../../../../../ext/UiaDll/Release/UiaDll.dll': A dynamic link
> library (DLL) initialization routine failed.
>  (LoadError)
>from
> D:/Ruby187/lib/ruby/gems/1.8/gems/ffi-1.0.9-x86-mingw32/lib/ffi/
> library.rb:54:in `map'
>from
> D:/Ruby187/lib/ruby/gems/1.8/gems/ffi-1.0.9-x86-mingw32/lib/ffi/
> library.rb:54:in `ffi_lib'
>from D:/Ruby187/lib/ruby/gems/1.8/gems/rautomation-0.6.0/lib/
> rautomation/adapter/win_ffi/ms_uia/uia_dll.rb:8
>from D:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
> 36:in `gem_original_require'
>from D:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
> 36:in `require'
>from D:/Ruby187/lib/ruby/gems/1.8/gems/rautomation-0.6.0/lib/
> rautomation/adapter/win_ffi.rb:22
>from D:/Ruby187/lib/ruby/gems/1.8/gems/rautomation-0.6.0/lib/
> rautomation/window.rb:66:in `const_get'
>from D:/Ruby187/lib/ruby/gems/1.8/gems/rautomation-0.6.0/lib/
> rautomation/window.rb:66:in `initialize'
>from D:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.9.1/lib/watir/ie-
> class.rb:459:in `new'
>from D:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.9.1/lib/watir/ie-
> class.rb:459:in `rautomation'
>from D:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.9.1/lib/watir/ie-
> class.rb:430:in `maximize'

-- 
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: click_no_wait doesn't work on radio buttons (Ruby1.8.7/Watir1.9.0)

2011-07-05 Thread Hugh McGowan
You're right it's part of the standard lib which doesn't make much
sense to me either. Seems like it should always know that
location...I'll try to reproduce if I can - that may shed some light
on things.

Hugh

-- 
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: click_no_wait doesn't work on radio buttons (Ruby1.8.7/Watir1.9.0)

2011-07-05 Thread Jarmo Pertman
Seems like a reasonable solution. But how is Logger related with
Rubygems? It's part of the stdlib if i'm not mistaken...

Didn't know that thing about Rubygems though. Good to know :)

Jarmo

On Jul 3, 5:49 pm, Hugh McGowan  wrote:
> We currently set the LOAD_PATH to be exactly what it is at the time
> _no_wait is called. If you look here (http://docs.rubygems.org/read/
> chapter/3) it seems that rubygems libs are not available till you
> require rubygems or you have the environment variable RUBYOPT=-
> rubygems. (Also note that it says that in Ruby 1.9, rubygems is
> required by default...)
>
> I suspect what's happening is that when you have rubygems loaded, it
> modifies the 'require' statement to add the lib you're requiring to
> the load path. When we run _no_wait, the load_path has all of the
> libraries loaded at that point in time, but not any libs that have not
> been required. In the second process, rubygems isn't active so the
> require statement doesn't behave the same way it did with rubygems
> loaded and so it can't find any new declarations. I'm not sure what
> else rubygems could affect but there could be some other subtleties
> I've missed.
>
> I think the right thing to do for now is check to see if rubygems is
> loaded at the time the _no_wait is declared and if so, require
> rubygems in the new process. I think if we do that and make sure the
> _no_wait doesn't siliently fail, then we should be ok.
>
> Hugh

-- 
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: How to locate the table which doesn't have id or name

2011-07-05 Thread Charley Baker
What do you mean by index doesn't work? I've dealt with controls in insanely
nested tables and always gotten away with index, 3rd party apps by the way,
so not able to ask the developers to fix it. I'm not a fan of xpath, but
that is a possibility. In my experience, I've almost never had to use it.

Cheers,

Charley

On Tue, Jul 5, 2011 at 2:09 PM, Super Kevy wrote:

> Boy don't you just hate the vagueness your developers gave you.
> I would write an issue asking for a unique ID to be added to the table
> tag to assist test automation even though you can write test code to
> work around the deficiencies your developers decided to throw at you.
>
>
> On Jul 1, 1:17 am, Jasmine  wrote:
> > Hello
> > I need to locate the table,then locate the tr and td,but the table
> > doesn't have the id and the name,so how to locate the table?I know
> > should use index,unfortunately it doesn't work.
> > there is the part of the code,there are 10 tables in the page,I want
> > to locate "refesh" in the row of the table,may be  so easy,but I
> > cannot resolve it...
> > 
> > 
> >
> >  
> >  > style="margin-top:14px; width:112px; padding-left:15px;">
> >   
> > 
> >  > colspan="2"> > style="margin-bottom:15px;"> > style="color:#414141;">refresh
> >   
>
> --
> 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: How to locate the table which doesn't have id or name

2011-07-05 Thread Super Kevy
Boy don't you just hate the vagueness your developers gave you.
I would write an issue asking for a unique ID to be added to the table
tag to assist test automation even though you can write test code to
work around the deficiencies your developers decided to throw at you.


On Jul 1, 1:17 am, Jasmine  wrote:
> Hello
> I need to locate the table,then locate the tr and td,but the table
> doesn't have the id and the name,so how to locate the table?I know
> should use index,unfortunately it doesn't work.
> there is the part of the code,there are 10 tables in the page,I want
> to locate "refesh" in the row of the table,may be  so easy,but I
> cannot resolve it...
> 
>                 
>
>                          
>                          style="margin-top:14px; width:112px; padding-left:15px;">
>                           
>                             
>                              colspan="2"> style="margin-bottom:15px;"> style="color:#414141;">refresh
>                           

-- 
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] comparing string containing Japanese characters

2011-07-05 Thread Anne
I have a web page that contains some Japanese characters.
In my test, I'm trying to compare the string from the web page with a
pre-defined string in my test script (the expected result).  I'm just
not sure how to represent the Japanese characters (I've been
struggling with regular expressions and am still fairly new to ruby/
watir).  I get the text from the screen and store it in a variable
using:
 salesJapan = @browser.p(:after?, @browser.h3(:index, 12)).text

the expected results are stored in another variable,
expectedSalesJapan
but
How do I represent the Japanese characters in expectedJapanData?  I've
tried copying the text from the web page source and escaping the
special characters but I haven't been able to get it right.  (HTML is
below)

I'm using Ruby 1.8.7 and watir 1.9.0


HTML: (only encoding defined in the HTML is charset=UTF-8)
Japan

カスタマーサービス—日本国内

営業時間 平日午前9時から午後6時

Phone: +81 5-- 
Email: ja...@abc.com 
Fax: +81 5-- 

目次 Table of
contents


-- 
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] Watir and the Automated Build Process

2011-07-05 Thread Jason Shelton

Hello All,
 
I have two related questions about Watir and the automated build process. My 
team uses TFS for our builds. I looking for a way to use TFS to launch my Watir 
test suite from the 'automation' box. This test suite is not on the same box as 
the build processes, so I cannot launch the test suite from the build process 
itself. Has anyone had experiences with this situation?
 
My second question is if/how to run Watir headlessly. In the scenario described 
above, can Watir be run if no one is actually logged onto the machine, 
launching the test suite manually? If so, how? 
 
Thanks in advance for any assistance.
 
- Jason   

-- 
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] string to boolean?

2011-07-05 Thread Rahul Sharma
Hi Guys,

Any way to pass in a string argument to a method and interpret it a
boolean without specifying the logic in the method?
Example:
user.set_value(option)

The option argument could be "true" or "false" coming in as a string
from a cucumber table?

Thanks in advance.

-- 
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] Will JRuby 1.6 support Watir now?

2011-07-05 Thread Željko Filipin
On Tue, Jul 5, 2011 at 2:57 PM, Darryl Brown 
wrote:
> Does this imply that JRuby can support some version of Watir now?
> JRuby 1.6 has just been released and, among the many new features, the
> JRuby installer for Windows now includes the win32ole library.

Try it and let us know. :)

Željko
--
watir.com - community manager
watir.com/book - author
watirpodcast.com - host

-- 
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] Will JRuby 1.6 support Watir now?

2011-07-05 Thread Darryl Brown

Does this imply that JRuby can support some version of Watir now?

JRuby 1.6 has just been released and, among the many new features, the
JRuby installer for Windows now includes the win32ole library.

Thanks,
Darryl

-- 
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] Object no longer attached to the DOM error on doing a exists call

2011-07-05 Thread Jari Bakken
On Tue, Jul 5, 2011 at 1:21 PM, Alastair Montgomery  wrote:
> Hi,
>
> I am experiencing an intermittent issue when doing the following call in
> watir-webdriver;
> browser.div(:class => "blockUI").exists?
> Sometimes it throws this exception;
> Selenium::WebDriver::Error::ObsoleteElementError: Element is no longer
> attached to the DOM
> Surely instead of throwing this the call should be returning false?
>

Yes, it shouldn't be throwing. Looking into it.

-- 
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] Unable to Maximize the IE 8, Received error while executing the script

2011-07-05 Thread V
Hi,

My script Opened the browser. Navigated to Google.Tried to Maximize
the browser(IE 8).
Below error Came while i executed the script.

Watir Version:1.9.1

Please let me know.

UiaDll: CoCreateInstance failed. hr = 0x80040154D:/Ruby187/lib/ruby/
gems/1.8/gems/ffi-1.0.9-x86-mingw32/lib/ffi/library.rb:75:in
`ffi_lib': Could not open library 'D:/Ruby187/lib/ruby/gems/1.8/gems/
rautomation-0.6.0/lib/rautomation/adapter/win_ffi/
ms_uia/../../../../../ext/UiaDll/Release/UiaDll.dll': A dynamic link
library (DLL) initialization routine failed.
 (LoadError)
from D:/Ruby187/lib/ruby/gems/1.8/gems/ffi-1.0.9-x86-mingw32/lib/ffi/
library.rb:54:in `map'
from D:/Ruby187/lib/ruby/gems/1.8/gems/ffi-1.0.9-x86-mingw32/lib/ffi/
library.rb:54:in `ffi_lib'
from D:/Ruby187/lib/ruby/gems/1.8/gems/rautomation-0.6.0/lib/
rautomation/adapter/win_ffi/ms_uia/uia_dll.rb:8
from D:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
36:in `gem_original_require'
from D:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
36:in `require'
from D:/Ruby187/lib/ruby/gems/1.8/gems/rautomation-0.6.0/lib/
rautomation/adapter/win_ffi.rb:22
from D:/Ruby187/lib/ruby/gems/1.8/gems/rautomation-0.6.0/lib/
rautomation/window.rb:66:in `const_get'
from D:/Ruby187/lib/ruby/gems/1.8/gems/rautomation-0.6.0/lib/
rautomation/window.rb:66:in `initialize'
from D:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.9.1/lib/watir/ie-
class.rb:459:in `new'
from D:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.9.1/lib/watir/ie-
class.rb:459:in `rautomation'
from D:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.9.1/lib/watir/ie-
class.rb:430:in `maximize'

-- 
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] Object no longer attached to the DOM error on doing a exists call

2011-07-05 Thread Alastair Montgomery
Hi,

I am experiencing an intermittent issue when doing the following call in 
watir-webdriver;

browser.div(:class => "blockUI").exists?

Sometimes it throws this exception;

Selenium::WebDriver::Error::ObsoleteElementError: Element is no longer 
attached to the DOM

Surely instead of throwing this the call should be returning false?


-- 
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] object repository usage in watir

2011-07-05 Thread Željko Filipin
On Tue, Jul 5, 2011 at 12:04 PM, somi  wrote:
> object repository usage in watir

Most of the people use page object pattern (if I understood your question):

http://wiki.openqa.org/display/WTR/Page+Objects

Željko
--
watir.com - community manager
watir.com/book - author
watirpodcast.com - host

-- 
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] object repository usage in watir

2011-07-05 Thread somi
object repository usage in watir

Please give the solutions if any one have tried this?

-- 
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: using Trim

2011-07-05 Thread JohnH
Thanks for clearing this out, Željko!


On Jul 5, 11:18 am, Željko Filipin 
wrote:
> On Tue, Jul 5, 2011 at 10:10 AM, JohnH  wrote:
> > I'm reading a numeric value from an excel file and I need to trim that
> > (in order to obtain '4' instead of '4.0').
>
> Fromhttp://en.wikipedia.org/wiki/Trim_(programming)
>
> "In programming, trim or strip is a common string manipulation
> function which removes leading and trailing whitespace from a string."
>
> If 4.0 is a string:
>
> "4.0".split(".")[0]
>  => "4"
>
> If 4.0 is a float:
>
> 4.0.to_i
>  => 4
>
> Željko
> --
> watir.com - community manager
> watir.com/book - author
> watirpodcast.com - host

-- 
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: Watir 1.9.1 upgrade (from 1.9.1rc or 1.9.0) breaks two things

2011-07-05 Thread Jarmo Pertman
Added today fix for RAutomation. Please try gem install rautomation -v
0.6.1 to see if it's working for you too.

Jarmo

On Jul 4, 8:58 pm, Michael  wrote:
> Downgrading to rautomation 0.5.1 does fix it.

-- 
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] using Trim

2011-07-05 Thread Željko Filipin
On Tue, Jul 5, 2011 at 10:10 AM, JohnH  wrote:
> I'm reading a numeric value from an excel file and I need to trim that
> (in order to obtain '4' instead of '4.0').

>From http://en.wikipedia.org/wiki/Trim_(programming)

"In programming, trim or strip is a common string manipulation
function which removes leading and trailing whitespace from a string."

If 4.0 is a string:

"4.0".split(".")[0]
 => "4"

If 4.0 is a float:

4.0.to_i
 => 4

Željko
--
watir.com - community manager
watir.com/book - author
watirpodcast.com - host

-- 
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] using Trim

2011-07-05 Thread JohnH
Hello,

Can you tell me how to use correctly Trim?

I'm reading a numeric value from an excel file and I need to trim that
(in order to obtain '4' instead of '4.0').

var = worksheet2.Range(cell number)['Value']

how do I use trim correctly?

it's something likevar = trim(var) ?



thanks,

John

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