[wtr-general] unknown property or method: `navigate' (NoMethodError)

2011-09-26 Thread 刚 徐
I am newer for the ruby and watir learner. I meet a problem when use
the thread.

code is :

# encoding: utf-8
require watir
require 'watir/ie'


ie = Watir::IE.new
  a = Thread.new {
  sleep 5
  ie.goto(file:///D:/gaxu/Desktop/188/zhifu/1882.htm)
  }
  puts start

  a.join

The running result is :

ruby new.rb
d:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.2/lib/watir/ie-class.rb:
390:in `method_missing': unknown property or method:
`navigate' (NoMethodError)
HRESULT error code:0x8001010e
  The application called an interface that was marshalled for a
different thread.
from d:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-2.0.2/lib/watir/ie-
class.rb:390:in `goto'
from new.rb:9:in `block in main'
from d:/Ruby192/lib/ruby/1.9.1/win32ole.rb:13:in `call'
from d:/Ruby192/lib/ruby/1.9.1/win32ole.rb:13:in `block in
initialize'
start
Exit code: 1

my ruby version is : ruby 1.9.2p290 (2011-07-09) [i386-mingw32]

Can someone help me ?  what am I wrong ?

-- 
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: Getting Error for Chrome when I run script from PHP code. Works fine for Firefox !!!!!

2011-09-26 Thread Amit Bobade
Hello.could someone help me on this?

On Fri, Sep 23, 2011 at 6:15 PM, Amit Bobade amit.sr...@gmail.com wrote:

 *Dear All:*

 I am getting below error while executing the script form PHP on Chrome
 Browser:

 Error while awaiting automation ping from browser process.
 estautomationproxy_launcher.cc(259): error: Value of:
 automation()-GetBrowserWindowCount(window_count) Which is: 0
 Actual: false
 Expected: true

 Let me explain the all the corner cases:

 1. I am calling Ruby-Watir script from PHP code.
 2. It works properly for FIREFOX.
 3. When I run the script on CHROME manually (i.e. without calling from PHP)
 then it works properly.
 4.  And if I run script calling from PHP on CHROME then it gives mentioned
 error.
 5. I am using Ruby187 and Watir Webdriver.

 Could someone tell the reason behind this, why am I getting this error on
 Chrome?
 Please help on this, I hope the details are enough to understand the
 problem. If you need more information, please feel free to ask for the same.
 I will really appreciate your help !!

 Thanks in Advance *
 *
 Regards,
 Amit




-- 
Thanks and Regards,
Amit

-- 
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-Webdriver IE issue (UnexpectedJavascriptError: Unable to find element with xpath)

2011-09-26 Thread Mike
I have an update to this problem.
To sum up, watir-webdriver not working in 2 of our environments under
IE. Works everywhere else (chrome, firefox).

If I try a browser.text in IE, I get the error:
Selenium::WebDriver::Error::NoSuchElementError: Unable to find element
with tag name == body
from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
webdriver-2.5.0/lib/selenium/webdriver/remote/response.rb:45:in
`assert_ok'
from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
webdriver-2.5.0/lib/selenium/webdriver/remote/response.rb:15:in
`initialize'
from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
webdriver-2.5.0/lib/selenium/webdriver/remote/http/common.rb:53:in
`new'
from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
webdriver-2.5.0/lib/selenium/webdriver/remote/http/common.rb:53:in
`create_response'
from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
webdriver-2.5.0/lib/selenium/webdriver/remote/http/default.rb:56:in
`request'
from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
webdriver-2.5.0/lib/selenium/webdriver/remote/http/common.rb:34:in
`call'
from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
webdriver-2.5.0/lib/selenium/webdriver/remote/bridge.rb:410:in
`raw_execute'
from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
webdriver-2.5.0/lib/selenium/webdriver/remote/bridge.rb:388:in
`execute'
from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
webdriver-2.5.0/lib/selenium/webdriver/remote/bridge.rb:356:in
`find_element_by'
from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
webdriver-2.5.0/lib/selenium/webdriver/common/search_context.rb:41:in
`find_element'
from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.3/
lib/watir-webdriver/browser.rb:95:in `text'
from (irb):4

So, it's not finding anything from the body on this page. It is,
however sending back the title.

Still scratching head,
thanks.


On Sep 19, 3:59 pm, Mike michaelszor...@gmail.com wrote:
 jw, still not working :/

 I found that it is working fine in our production and production test
 environments. It is only throwing exceptions in our other testing
 environments.  I'm going to inquiry and see if there are some sort of
 server settings impacting this.  Hopefully onto something.

 On Sep 16, 8:08 pm, jw joshuawal...@gmail.com wrote:







  true.  I just read the bottom of your post that said it was working
  for FF.  that sounds like a weird one.  only thing i could suggest
  would be to try to access it a different way (using id, text, anything
  else) or do something like
  lists=b.select_lists
  and iterate through the lists and see what's there.

  On Sep 16, 1:19 pm, Mike michaelszor...@gmail.com wrote:

   hey jw,
   I am running this in irb... sleep/wait shouldn't be an issue there, right?

-- 
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 Podcast #46: Jarmo Pertman on Watir 2.0

2011-09-26 Thread Željko Filipin
http://watirpodcast.com/46-jarmo-pertman-on-watir-2-0/

Ž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


Re: [wtr-general] using the taza framework and watir-webdriver?

2011-09-26 Thread bis
You could put check in there to wait until the element
existshttp://watirwebdriver.com/waiting/.
Generally if you run the exact same test twice regardless of the framework
and the second time you get different results there is either something
wrong with the setup or the environment. It could be a timing issue like you
mentioned. I would probably take the code for the flow and put it in an
example in the same spec where the example that uses the flow is and start
my debugging there( I dont always use the debugger or irb, I tend to more
often put in some p element_I_want.exists? and p element_I_want.html to
figure out what is going on) they would both hit the exact same code(one the
flow and the other the code that the flow uses) if one passes and one fails
adding some checks (like exists?) and all that may give you an idea as to
why it doesnt always find that element.


On Mon, Sep 26, 2011 at 4:23 AM, hillary weimar1...@gmail.com wrote:

 I'm trying to be as specific as possible. I've also attached the index.html
 for one of my test runs. But let me know what part of my code you need to
 see. If it makes a difference, I'm really only using the browser.rb file
 from this branch. I didn't want to complicate things, by trying to upgrade
 both.

 My most common problem seems to be with clicking on links after navigating
 to a new page. My issues seem to be:

 1) This element:
   element(:app_link) {browser.link(:href,
 /ApplicationID=ResonanceRecords01/)}. I had also defined this element by
 name, and id. It produces an Element no longer valid error.

 I use it in a flow, this flow is the first thing i call after logging into
 the web app.
 def go_to_rec_box_flow(params={})
   catalog_blacklist_page.rest
   manage_recommendation_page.app_link.click
   catalog_blacklist_page.rest
   manage_recommendation_page.loc_link.when_present.click
 end

 This might be a problem with one of my enviornments, but it also can't find
 this element at times. So i get a timeout, even though it's logged in
 successfully. This is my biggest block because I can't execute half of my
 tests unless I can click on this link. Because of this two specs will fail
 on this step, so I'm not sure what will be wrong with these specs after this
 link issue gets fixed.

 2) The Element is no longer Valid error

 This will happen for elements other than the one above. Most commonly it's
 with links.

 3) Inconsistency
 I use a lot of flows, and for one test it'll pass but another time it will
 fail.

  --
 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: Watir-Webdriver IE issue (UnexpectedJavascriptError: Unable to find element with xpath)

2011-09-26 Thread Mike
FIXED!
Ok, the domain for our test environments had to be listed to the list
of trusted sites in IE since we are behind a firewall here.

For some reason, Watir works without that exception... webdriver does
not.
Any reason why?


On Sep 26, 10:15 am, Mike michaelszor...@gmail.com wrote:
 I have an update to this problem.
 To sum up, watir-webdriver not working in 2 of our environments under
 IE. Works everywhere else (chrome, firefox).

 If I try a browser.text in IE, I get the error:
 Selenium::WebDriver::Error::NoSuchElementError: Unable to find element
 with tag name == body
         from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
 webdriver-2.5.0/lib/selenium/webdriver/remote/response.rb:45:in
 `assert_ok'
         from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
 webdriver-2.5.0/lib/selenium/webdriver/remote/response.rb:15:in
 `initialize'
         from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
 webdriver-2.5.0/lib/selenium/webdriver/remote/http/common.rb:53:in
 `new'
         from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
 webdriver-2.5.0/lib/selenium/webdriver/remote/http/common.rb:53:in
 `create_response'
         from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
 webdriver-2.5.0/lib/selenium/webdriver/remote/http/default.rb:56:in
 `request'
         from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
 webdriver-2.5.0/lib/selenium/webdriver/remote/http/common.rb:34:in
 `call'
         from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
 webdriver-2.5.0/lib/selenium/webdriver/remote/bridge.rb:410:in
 `raw_execute'
         from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
 webdriver-2.5.0/lib/selenium/webdriver/remote/bridge.rb:388:in
 `execute'
         from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
 webdriver-2.5.0/lib/selenium/webdriver/remote/bridge.rb:356:in
 `find_element_by'
         from C:/Ruby187/lib/ruby/gems/1.8/gems/selenium-
 webdriver-2.5.0/lib/selenium/webdriver/common/search_context.rb:41:in
 `find_element'
         from C:/Ruby187/lib/ruby/gems/1.8/gems/watir-webdriver-0.3.3/
 lib/watir-webdriver/browser.rb:95:in `text'
         from (irb):4

 So, it's not finding anything from the body on this page. It is,
 however sending back the title.

 Still scratching head,
 thanks.

 On Sep 19, 3:59 pm, Mike michaelszor...@gmail.com wrote:







  jw, still not working :/

  I found that it is working fine in our production and production test
  environments. It is only throwing exceptions in our other testing
  environments.  I'm going to inquiry and see if there are some sort of
  server settings impacting this.  Hopefully onto something.

  On Sep 16, 8:08 pm, jw joshuawal...@gmail.com wrote:

   true.  I just read the bottom of your post that said it was working
   for FF.  that sounds like a weird one.  only thing i could suggest
   would be to try to access it a different way (using id, text, anything
   else) or do something like
   lists=b.select_lists
   and iterate through the lists and see what's there.

   On Sep 16, 1:19 pm, Mike michaelszor...@gmail.com wrote:

hey jw,
I am running this in irb... sleep/wait shouldn't be an issue there, 
right?

-- 
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-webdriver timing out, ending run of Suite (Test::Unit) instead of simply causing test failure

2011-09-26 Thread jw
ruby 1.8.7 (352)
test-unit (2.3.0)
watir (2.0.1)
watir-webdriver (0.3.3)
IE9/probably others

I don't know if other people have seen this, but I'm occasionally
getting stacks that look like:

C:/Users/jw/.pik/rubies/Ruby-187-p352/lib/ruby/1.8/timeout.rb:64:in
`rbuf_fill': execution expired (Timeout::Error)
from C:/Users/jw/.pik/rubies/Ruby-187-p352/lib/ruby/1.8/net/
protocol.rb:134:in `rbuf_fill'
from C:/Users/jw/.pik/rubies/Ruby-187-p352/lib/ruby/1.8/net/
protocol.rb:116:in `readuntil'
...
from C:/Users/jw/.pik/rubies/Ruby-187-p352/lib/ruby/gems/1.8/
gems/selenium-webdriver-2.6.0/lib/selenium/webdriver/common/element.rb:
34:in `click'
from C:/Users/jw/.pik/rubies/Ruby-187-p352/lib/ruby/gems/1.8/
gems/watir-webdriver-0.3.3/lib/watir-webdriver/elements/element.rb:
67:in `click'
from ./watirutilbuttonclicks.rb:120:in `click'
...

while running my tests, and instead of just making the current test
fail, the whole test suite is stopping execution.  It seems
Timeout::Error is a SignalException and is a pass-through error that
Test::Unit will re-raise which will cause the whole test Suite to stop
execution.  I have added Timeout::Error to the pass-through list by
adding this line to my ClassExtensions.rb (required lastly in order to
add or override some Watir methods).

Test::Unit::ErrorHandler::NOT_PASS_THROUGH_EXCEPTIONS.push(Timeout::Error)

This seems to have fixed my issue in the most elegant way possible
(test still fails, but suite continues execution) but I couldn't find
documentation on NOT_PASS_THROUGH_EXCEPTIONS anywhere, so if this
isn't a good idea, please let me know.

-- 
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] watir-webdriver timing out, ending run of Suite (Test::Unit) instead of simply causing test failure

2011-09-26 Thread Rahul Sharma
I posted about the same problem few days back. I still  keep getting these 
ruff_fill errors occasionally however, it doesn't happen to kill my tests. This 
error causes random failures in my test suite which we run every night. I was 
advised to check and see if it was an environment problem. Upon troubleshooting 
I found that there are a few tests that start up with a browser but the page is 
loading terribly slow. To my surprise, after that test throws a rbuff error, 
the next tests in the suite pass normally. So I am kind of still confused as 
why only some of the tests occasionally fail…

Just to try and eliminate the problem of having environmental problems I will 
soon be getting a new test environment set up for myself to observe the results 
to see if I still get such errors!!
On 26 Sep 2011, at 19:37, jw wrote:

 ruby 1.8.7 (352)
 test-unit (2.3.0)
 watir (2.0.1)
 watir-webdriver (0.3.3)
 IE9/probably others
 
 I don't know if other people have seen this, but I'm occasionally
 getting stacks that look like:
 
 C:/Users/jw/.pik/rubies/Ruby-187-p352/lib/ruby/1.8/timeout.rb:64:in
 `rbuf_fill': execution expired (Timeout::Error)
from C:/Users/jw/.pik/rubies/Ruby-187-p352/lib/ruby/1.8/net/
 protocol.rb:134:in `rbuf_fill'
from C:/Users/jw/.pik/rubies/Ruby-187-p352/lib/ruby/1.8/net/
 protocol.rb:116:in `readuntil'
 ...
from C:/Users/jw/.pik/rubies/Ruby-187-p352/lib/ruby/gems/1.8/
 gems/selenium-webdriver-2.6.0/lib/selenium/webdriver/common/element.rb:
 34:in `click'
from C:/Users/jw/.pik/rubies/Ruby-187-p352/lib/ruby/gems/1.8/
 gems/watir-webdriver-0.3.3/lib/watir-webdriver/elements/element.rb:
 67:in `click'
from ./watirutilbuttonclicks.rb:120:in `click'
 ...
 
 while running my tests, and instead of just making the current test
 fail, the whole test suite is stopping execution.  It seems
 Timeout::Error is a SignalException and is a pass-through error that
 Test::Unit will re-raise which will cause the whole test Suite to stop
 execution.  I have added Timeout::Error to the pass-through list by
 adding this line to my ClassExtensions.rb (required lastly in order to
 add or override some Watir methods).
 
 Test::Unit::ErrorHandler::NOT_PASS_THROUGH_EXCEPTIONS.push(Timeout::Error)
 
 This seems to have fixed my issue in the most elegant way possible
 (test still fails, but suite continues execution) but I couldn't find
 documentation on NOT_PASS_THROUGH_EXCEPTIONS anywhere, so if this
 isn't a good idea, please let me know.
 
 -- 
 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

Regards,
Rahul Sharma

-- 
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 the taza framework and watir-webdriver?

2011-09-26 Thread hillary
I'll try that out and get back to you. 

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