[wtr-general] Div click not working with firewatir 1.6.7

2010-11-25 Thread watir watir
hi,

 i recently updated my firewatir from older version to 1.6.7. and from
then, below part of code is not working correctly.


div(:class,x).div(:class,x).click is not producing any
result. but it has to select a particular element in page. but the
same is working fine with older versions.




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

2010-11-25 Thread Jarmo Pertman
And what is the exact problem with that command? It should print an
deprecation message but should work nevertheless.

You can use Wait module instead starting from 1.6.7:
Watir::Wait.until {ie.frame(:index,3).text.include? Enter any
information you have and click Search. Leave fields blank for a list
of all values. }

Jarmo Pertman
-
IT does really matter - http://www.itreallymatters.net


On Nov 22, 9:07 am, sivam sivamma...@gmail.com wrote:
 Hi
 I am using following code for wait..
 Watir::Waiter::wait_until {ie.frame(:index,3).text.include? Enter
 any information you have and click Search. Leave fields blank for a
 list of all values. } 

 it was working fine with old version 1.6.5..

 But now i am facing problem with this command..
 Could you please anyone give replacement of this code for watir
 1.6.7...

-- 
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] Issues to sync with page correctly in watir1.6.7

2010-11-25 Thread alex.ikhelis
Hi guys,

We have recently updated our test environments to watir1.6.7 and our
scripts start to fail waiting for page to be fully loaded. Failures
happen when a script tries to access certain html elements on the page
while it is actually still loading.

Have you noticed something similar? Can it be caused by recent wait
improvements in watir 1.6.6 / 1.6.7?

This is an urgent issue for us, so very appreciate your help.

Thank you,
Alex

-- 
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: Issues to sync with page correctly in watir1.6.7

2010-11-25 Thread alex.ikhelis
Raised it as a ticket http://jira.openqa.org/browse/WTR-466

-- 
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: watir-webdriver fire_event('onmouseover') failing in IE

2010-11-25 Thread Michael


Looks like the backport to trunk is now complete
http://code.google.com/p/selenium/source/detail?r=10401 [10] 

Quoted
from http://code.google.com/p/selenium/issues/detail?id=849 [11] 

On
Mon, 22 Nov 2010 19:53:04 +0100, Jari Bakken wrote: 

 On Mon, Nov 22,
2010 at 7:05 PM, Michael wrote:
 This bug is making webdriver pretty
useless on IE for any type of JavaScript testing. It has now been fixed
in the selenium repository.
 The IE driver has been rewritten on a
branch, so the fix isn't yet in Selenium trunk. I'll release a new
selenium-webdriver gem as soon as it's merged (or the fix is backported
to the old driver). 
 
 Are there any known work-a-rounds until a new
version of selenium- webdriver is released?
 Not that I know of. Th


 der-left:#1010ff 2px solid; margin-left:5px; width:100%On Sat, Nov
6, 2010 at 1:41 AM, Michael wrote: 
 

Selenium::WebDriver::Error::UnexpectedJavascriptError: Cannot execute
script (17)
 You're probably running into this known bug in the IE
driver: http://code.google.com/p/selenium/issues/detail?id=849 [1]
(comment 5 has a failing test) -- Before posting, please read
http://watir.com/support. [2] In short: search before you ask, be nice.
watir-general@googlegroups.com [3]
http://groups.google.com/group/watir-general [4]
watir-general+unsubscr...@googlegroups.com [5] -- Before posting, please
read http://wa
 rt. In short: search before you ask, be nice.
watir-general@googlegroups.com [7]
http://groups.google.com/group/watir-general [8]
watir-general+unsubscr...@googlegroups.com [9]


Links:
--
[1]
http://code.google.com/p/selenium/issues/detail?id=849
[2]
http://watir.com/support.
[3] mailto:watir-general@googlegroups.com
[4]
http://groups.google.com/group/watir-general
[5]
mailto:watir-general+unsubscr...@googlegroups.com
[6]
mailto:mmcwill...@gmail.com
[7]
mailto:watir-general@googlegroups.com
[8]
http://groups.google.com/group/watir-general
[9]
mailto:watir-general+unsubscr...@googlegroups.com
[10]
http://code.google.com/p/selenium/source/detail?r=10401
[11]
http://code.google.com/p/selenium/issues/detail?id=849

-- 
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 fails for button to open modal dialog (Win XP, Ruby 1.8.6.26, Watir 1.6.7)

2010-11-25 Thread Jarmo Pertman
#click_no_wait returning nil is a correct behavior. Open up the page
in your browser where that button is and then open up an irb session
and try this:
require watir
b = Watir::Browser.attach :title, /title/
b.button(:unique_number, 1).click

Does that do anything or does it throw the same error message as with
#click_no_wait?

If it stays blocking then open up yet another irb session (because the
previous is unusable due to blocking) and try again to set $DEBUG=true
and perform #click_no_wait to see the handle to the IE.

Now attach again to the window and see if that hwnd matches to your
window's hwnd:
b = Watir::Browser.attach :title, /title/
# verify that you have the correct window
b.title
b.url

# now verify that the hwnd matches to the hwnd used by #click_no_wait
b.hwnd

# now try the attach command by #click_no_wait
b = Watir::IE.attach(:hwnd, THE_HWND)
# try to access the button
b.button(:unique_number, 1).html

Jarmo Pertman
-
IT does really matter - http://www.itreallymatters.net


On Nov 24, 11:50 am, Arto Vuori vuo...@iki.fi wrote:
 Hi Kushal,

 I'm having exactly the same problem and I have not found a working
 solution.
 I have a need to open and interact with a modal dialog. However,
 click_no_wait simply returns nil.

 -- A. Vuori

 On 21 marras, 20:29, Kushal kushal...@gmail.com wrote:







  Hi all,

  I am stuck in this problem for three days now. I need to open a modal
  dialog from a button on a webpage. When I use click or
  fire_event(onclick), execution just hangs. This is understandable as
  it waits for work to be completed on the modal dialog.

  Therefore, I am trying to useclick_no_wait, but it returns nil. I
  made some changes in theclick_no_waitfunction, to display the call
  by adding puts command on line 249 and replaced start rubyw
  #{command} with rubyw #{command}

  I get the following error on the console:

  c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/element.rb:58:in
  `assert_exists': Unable to locate element, using :unique_number, 1
  (Watir::Exception::UnknownObjectException)
          from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/
  element.rb:263 :in `click!' from -e:1

  The command that is executed in the above call is:

  ruby -e require 'rubygems';require 'c:/ruby/lib/ruby/gems/1.8/gems/
  watir-1.6.7/lib/watir/core';Watir::Button.new(Watir::IE.attach(:hwnd,
  656538), :unique_number, 1).click!

  Also, I read this article (http://jira.openqa.org/browse/WTR-144)
  which describes how fire_event_no_wait could be added to element.rb
  for fire_event(onmousedown) with no wait. However,
  eval_in_spawned_process method is not present in PageContainer module
  in Watir 1.6.7.

  Thanks.

  Kushal

-- 
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: Rdoc for Wait and ElementExtensions in Watir 1.6.7

2010-11-25 Thread Jarmo Pertman
The problem is that the provided link points to a non-specific-
version of Watir and is for some reason defaulting to 1.6.6 (you can
see it from the page itself). I'm not sure what's the exact reason
since i don't know all the quirks of rdoc.info, but you can see 1.6.7
docs by specifying the version:
http://rdoc.info/gems/watir/1.6.7/frames

But since Watir::Wait and Watir::ElementExtensions is common code used
in Watir and FireWatir then you ought to look into commonwatir
documentation instead:
http://rdoc.info/gems/commonwatir/1.6.7/frames

But long story short - you can use Wait module's methods directly on
the module itself, e.g.:
Watir::Wait.until {true}

And you can use ElementExtension methods on the Watir::Element
objects:
browser.button(:id = some_id).when_present.click

And you can use WaitHelper methods on the browser instance object:
browser.wait_until {true}

Anyone up for writing a proper wiki page for these features?

Jarmo Pertman
-
IT does really matter - http://www.itreallymatters.net


On Nov 25, 12:52 am, dt_nz david.tay...@sungard.com wrote:
 Hi, I cant find the rdoc for Watir::Wait and
 Watir::ElementExtensions.  Can someone tell me how to generate it or
 where it is located locally in the ruby directories.

 Željko Filipin has also mentioned in another thread that its not found
 inhttp://rdoc.info/gems/watir/frames

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

2010-11-25 Thread Jarmo Pertman
+1 to that.

Just start irb and then:
require rubygems
require watir
b = Watir::Browser.new
b.goto http://google.com;

Jarmo Pertman
-
IT does really matter - http://www.itreallymatters.net

On Nov 24, 10:10 pm, Ethan notet...@gmail.com wrote:
 I don't think watir console is maintained or really supported. I'd recommend
 just using normal irb and requiring watir.







 On Tue, Nov 23, 2010 at 12:04, enriquem enrique.j.ma...@gmail.com wrote:
  Hey Everyone,

  I try to fire up watir-console and I get the following error:

  C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/irb-history.rb:
  3:TypeError: History is not a module

  I am using ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32] and
  Gem version 1.3.7 on a Windows XP machine.

  Any help would be greatly appreciated :)

  --
  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.comhttp://groups.google.com/group/watir-generalwatir-general+unsubscribe...

-- 
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] Issues for login modle failed in watir 1.6.7

2010-11-25 Thread Kingson Zhou
Hi all,
There are a login module, i want use watir realize auto login, but it always
failed.
I need help for error as below, thanks.
*
*
1.HTML code:

div id=member
form action=/j_spring_security_check method=post 
id=form_header
input type=hidden id=redirectURL 
name=redirectURL/  
div class=login_barinput type=text class=txt lfloat
name=j_username value=email: onFocus=focusUsername(this);
onBlur=blurUsername(this); maxlength=100//div
div class=login_barinput type=text class=pword 
lfloat
name=j_password value=password: onFocus=focusPwd(this);
onBlur=blurPwd(this); maxlength=30//div
input name=_spring_security_remember_me id=ckb 
class=lfloat
cb type=checkbox /
label class=lfloat for=ckbremeber me/label

input type=submit  class=login lfloat png 
value=click
diva href=/account/register
view-source:http://172.16.214.23/account/register class=reg lfloat
pngsing up/a/div
/form
/div

2.watir code:

require 'watir'   # the watir controller

 ie = Watir::IE.start(http://172.16.214.23;)
ie.text_field(:name, j_username).set(xiaomayi0...@gmail.com)
ie.text_field(:name, j_password).set(123456)
ie.button(:value, click).click
if  ie.contains_text(Programming Ruby)
  puts Test Passed. Found the test string: 'Programming Ruby'.
Actual Results match Expected Results.
  else
  puts Test Failed! Could not find: 'Programming Ruby'
end

3.After executed, output results:
C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/input_elements.rb:375:in
`method_missing': fireEvent (WIN32OLERuntimeError)

OLE error code:80004005 in htmlfile

  Unspecified error。

HRESULT error code:0x80020009

  accidents。 from
C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/input_elements.rb:375:in
`set'

from E:/ruby/RubyApplication1/lib/main.rb:4

-- 
-
工作的层次(依靠谱程度从低到高)=有做->做完->做对->做好->帮助他人做好
My Blog:http://xiaomayi0323.byethost7.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] Methods written in Tear down not working consistently

2010-11-25 Thread Pavithra
I have written four test cases in a single script and while running
the same methods written in Tear Down is not working consistently
either for 2nd or 3rd test case and for 4th test case.

I have the following piece of code in Tear down function in my test
script:

def teardown
 Amcp.tophomelink()
end

Under Main.rb:

class Amcp
   @@link_Headhome=$browser.link(:text,Home)
  class_attr_reader(:link_Headhome)

   def self.tophomelink()
   puts Tearing down
   self.link_Headhome.click()
   sleep(10)
  end
end


After the execution of first tc (in the test script), Tear down works
exactly fine. But after the execution of 2nd test case, Teardown is
getting executing -- getting into tophomelink() and printing tearing
down in the result; however the headhome link is not getting clicked
(no error thrown also). Its gng to 3rd test case and its failing
(since its failing to locate the element in that page); its tearing
down properly in 3rdtest and 4th test case is getting executed
properly but again failing to click the head home link (under tear
down) for the 4th test case.

I am facing this stupid behavior everyday and I am getting mad because
of this. Kindly help me out to resolve the issue.

Thanks in Advance,
Pavithra

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