[wtr-general] Re: getting started with Watir and Watir-RSpec

2016-10-09 Thread Jarmo Pertman
Hello,

watir-rspec isn't needed per se, which means that you can use just watir 
itself. As stated in watir-rspec readme 
, it will make 
it slightly easier to manage browser opening/closing, adds few helpful 
matchers and creates nice html reports with links to files/screenshots 
created during tests. If you do not need any of these then watir-rspec is 
not needed.

However, if you're using Rails, then I suggest using watir-rails 
 since it helps you to create running 
server etc. like you're probably used to with Capybara.

Best Regards,
Jarmo

On Friday, October 7, 2016 at 10:34:13 PM UTC+3, artie...@gmail.com wrote:
>
> Thanks again to Justin for the massive help!
> My stack is running and smoking' fast!
> This next inquiry is for everyone else!  :)
>
> I am seeking most up-to-date resources for using/programming with Watir. I 
> guess that any resource prior to some particular year (2011, 2013?) is out 
> of date and not usable? Such as this book: https://leanpub.com/watirbook
>
> Here is what I think may be up-to-date:
>
> http://www.rubydoc.info/gems/watir/frames
>  + http://www.rubydoc.info/gems/watir/Watir
>  + http://www.rubydoc.info/gems/watir/Watir/Browser
>
>
> I am running Watir by invoking rspec within a Rails environment. Capybara 
> and RSpec are old comrades. 
>
> Where is the most relevant documentation and best practices for using 
> Watir/Watir-RSpec to drive the user interface of Web site.
>
> Is the primary source for Watir documentation, here?
> https://watir.com/documentation/
>
> If so, then maybe there is a problem with the wiki. 
> All the links that point to the wiki load “stubs” as if the wiki was 
> re-initialized.   
>
>
> As this is my first experience with these tools, I am not sure if I 
> require the added abstraction of Watir-RSpec or not. 
> Is Watir-RSpec essential? Or is it primarily a wrapper for the browser 
> object to reduce the visual clutter of the Watir in an RSpec spec file? 
>
> I imagine that some use cases (test cases) may use some of watir-rspec and 
> watir, both? Such as using and manipulating the browser object directly? 
> Any examples of those?
>
> In fact, I would very much appreciate any recommendations/links to any 
> relevant code examples. Even if they are old. 
>
> Even if you know of a public gist (somewhere out there) with one single 
> test, that might be very helpful to someone just starting out, please 
> consider posting a link or sending it to me via e-mail. I would like to 
> read tests written by others — from the simple to the complex. 
>
> Many thanks!
> AZ
>
>

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

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: goto method not found

2016-10-09 Thread Jarmo Pertman
"type: :request" is used so that RSpec would include Watir-specific helpers 
only into specs where they are actually needed (so-called 
request/integration type specs) and not into every test (e.g. regular unit 
tests, controller tests, model tests etc.).

You can remove that additional filter, but I would recommend not to do 
that. Just make sure that somewhere in your spec/rails_helper.rb or 
spec/spec_helper.rb you have the following RSpec configuration option set:
config.infer_spec_type_from_file_location!


And then start creating your "request" type specs under spec/requests 
directory for example:
spec/requests/google_spec.rb

Also, I recommend you to use watir-rails for even easier integration.

Best Regards,
Jarmo

On Wednesday, October 5, 2016 at 12:46:10 AM UTC+3, Justin Ko wrote:
>
> The "type: :request" is added when Rails is detected, which happened 
> during your installation. As a result, each of the configurations only 
> applies to examples groups that have the same metadata of "type: :request". 
> I am not a Rails developer, so I cannot explain the rationale for adding 
> the filter. At any rate, instead of removing the filter, you could have 
> also gotten the tests to run by adding the metadata to the example group - 
> ie "RSpec.describe "Google", type: :request do"
>
> In terms of getting the second test to run, it looks there have been some 
> changes in the layout of the Google results. I had to update the test to be:
>
>   it "allows to search" do
> text_field(name: "q").set "watir"
>
> # Changed the locator, as well as added when_present to wait for the 
> layout changes
> button(name: "btnG").when_present.click
>
> results = div(id: "ires")
> expect(results).to be_present.within(2)
>
> # Changed to look at divs instead of lis
> expect(results.divs(class: "g").map(&:text)).to be_any { |text| text 
> =~ /watir/ }
>
> expect(results).to be_present.during(1)
>   end
>
> Justin
>
>
> On Tuesday, October 4, 2016 at 2:37:39 PM UTC-4, artie...@gmail.com 
>  wrote:
>>
>> Thanks very much for the dialog on this, Justin. 
>> I know your time must be valuable.  
>>
>> Well, perhaps the mystery deepens. :)
>> At least for me it does. Lot for me to learn here. 
>>
>> Indeed, this entire block (with comments) was inside my 
>> ./spec/spec_helper.rb file:
>>
>> require "watir/rspec"
>>
>> RSpec.configure do |config|
>>   config.add_formatter(:progress) if config.formatters.empty?
>>   config.add_formatter(Watir::RSpec::HtmlFormatter)
>>
>>
>>   config.before :all, type: :request do
>> @browser = Watir::Browser.new
>>   end
>>
>>
>>   config.after :all, type: :request do
>> @browser.close if @browser
>>   end
>>
>>   config.include Watir::RSpec::Helper, type: :request
>>   config.include Watir::RSpec::Matchers, type: :request
>> end
>>
>>
>>
>> My Terminal scroll-back indicates I ran the installer:
>> $ watir-rspec install
>> Rails application detected.
>> Installing watir-rspec configuration into 
>> /Users/dks/Projects/spiker/spec/spec_helper.rb.
>>
>> Can anyone elaborate on the reason why the removal of the four 
>> occurrences of "type: :request", creates conditions where the goto appears 
>> to work properly. Well, honestly I did not try with only two or three. I 
>> removed all four. 
>>
>> In fact, the sample "google url" script on the github page appears to 
>> work to completion on my system. 
>>
>> May I ask further... in the sample script, why does the second test fail? 
>> I tried to fix it by changing the search string that presumably referenced 
>> the CSS id of the "Google Search" and "Feeling Lucky" button. However, when 
>> I change it to any reasonable id I discover when using GoogleChrome 
>> Developer Inspect Tool. I get various errors, including selenium 
>> ElementNotVisibleError, and Watir UnknownMethodException. I would not think 
>> making the second test pass was this challenging. Ha! How to make it pass?
>>
>> Many thanks.
>> AZ
>>
>>
>> On Tuesday, October 4, 2016 at 8:50:02 AM UTC-7, Justin Ko wrote:
>>>
>>> When I ran the install, the following was added to the spec_helper (with 
>>> the comments removed for brevity):
>>>
>>> require "watir/rspec"
>>>
>>> RSpec.configure do |config|
>>>   config.add_formatter(:progress) if config.formatters.empty?
>>>   config.add_formatter(Watir::RSpec::HtmlFormatter)
>>>
>>>   config.before :all do
>>> @browser = Watir::Browser.new
>>>   end
>>>
>>>   config.after :all do
>>> @browser.close if @browser
>>>   end
>>>
>>>   config.include Watir::RSpec::Helper
>>>   config.include Watir::RSpec::Matchers
>>> end
>>>
>>>
>>> The "goto" method is added to examples by the "config.include 
>>> Watir::RSpec::Helper" line. Though you will likely want to include all of 
>>> these lines if you are just starting out.
>>>
>>> Justin
>>>
>>>
>>>

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

watir-general@googlegroups.com

[wtr-general] watir-rails 2.0.0 released

2016-09-24 Thread Jarmo Pertman
watir-rails 3.0.0 has been released, which adds Watir 6.0 support.

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

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] watir-rspec 3.0.0 released

2016-09-24 Thread Jarmo Pertman
watir-rspec 3.0.0 has been released, which adds Watir 6.0 support.

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

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Watir 6.0 Beta needs testers

2016-09-24 Thread Jarmo Pertman
Did "beta-testing" using Watir 6.0.0.beta4 on one of my real-life projects, 
which used Watir 5.x before that. Almost everything worked as expected, but 
had to create one issue in GitHub. I also noticed that watir-rspec 
(https://github.com/watir/watir-rspec) and watir-rails 
(https://github.com/watir/watir-rails) didn't support Watir 6.0 so I 
released both of them with added support.

Best Regards,
Jarmo



On Friday, September 23, 2016 at 6:55:57 AM UTC+3, Dave McNulla wrote:
>
> It will be easier to identify 'problems' if you have a baseline, something 
> to compare with.
>
> Dave
>
> On Thursday, September 22, 2016 at 11:05:01 AM UTC-7, Mike Frank wrote:
>>
>> Would qualify as a tester if I've never used it?
>>
>> On Thu, Sep 22, 2016 at 1:43 PM, Dave McNulla  wrote:
>>
>>> Info is on the new website. http://watir.github.io/watir-6-beta4 
>>> 
>>>
>>> It uses Selenium 3.0, works with Firefox 48/49 and Geckodriver. Give it 
>>> a try. Post issues athttps://github.com/watir/watir/issues 
>>> 
>>>
>>> -- 
>>> -- 
>>> Before posting, please read http://watir.com/support. In short: search 
>>> before you ask, be nice.
>>>  
>>> watir-...@googlegroups.com
>>> http://groups.google.com/group/watir-general
>>> watir-genera...@googlegroups.com
>>>
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Watir General" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to watir-genera...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

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

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: file_field().set crashing watir

2014-07-21 Thread Jarmo Pertman
Can you show us the whole backtrace?

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


On Friday, July 18, 2014 10:39:54 PM UTC+3, Mike Malandra wrote:

 browser.file_field(id: 'file_APP').when_present.set(@image)   

 where @image = File.dirname(__FILE__) + '/bb.jpg'



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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Screenshot on remote machine thorugh Remote Desktop with watir-classic

2014-04-23 Thread Jarmo Pertman
Hi!

Read this RAutomation issue - https://github.com/jarmo/RAutomation/issues/69

It is not related directly with Watir, but the problem described there is 
the same.

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


On Tuesday, April 22, 2014 12:12:21 PM UTC+3, Stefano wrote:

 Hi,
  
 taking screenshot running watir-classic on Remote Desktop (for example, 
 ie.screenshot.save 'screenshot.png') works only when window is not 
 minimized. This is an old limitation that I have experienced some years ago.

 Do you how if now there exists a way to overcame this limitation?

 We are using the last version of Ruby/Watir, Windows 2008 Server and IE9.

 Thanks, Stefano
  


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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Embed screenshot in Watir-rspec report (not just for failed tests)

2014-04-18 Thread Jarmo Pertman
Hi!

Unfortunately there's no built-in support for such a requirement in 
`watir-rspec` nor `rspec` itself.

However, you can achieve that quite easily by creating your own 
`HtmlFormatter`. Easiest would be to extend `Watir::RSpec::HtmlFormatter` 
(https://github.com/watir/watir-rspec/blob/master/lib/watir/rspec/html_formatter.rb)
 
and then override `example_passed` from 
`RSpec::Core::Formatters::HtmlFormatter` 
(https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/formatters/html_formatter.rb#L48-L52)
 
and insert the links created during your specs from 
`@files_saved_during_example`. It seems to me that you need to create a 
different method for printing out the html than it is done currently by 
RSpec at `HtmlPrinter` 
(https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/formatters/html_printer.rb#L29-L32).

Then, in your specs you just need to save the screenshot like this:
browser.screenshot.save Watir::RSpec.file_path(uploaded.txt) # = this 
creates a unique file name and adds it to the `@files_saved_during_example` 
array as well.

Also, refer to the code currently adding links to files created during 
failing specs to get some idea how it is done:
https://github.com/watir/watir-rspec/blob/master/lib/watir/rspec/html_formatter.rb#L47-L51

And don't forget to use your own HtmlFormatter in spec_helper instead of 
Watir::RSpec::HtmlFormatter.

The whole approach written above is not tested in practice, but seems to be 
doable in theory without monkey-patching, but using regular OO programming 
practices :)

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


On Friday, April 18, 2014 10:30:21 AM UTC+3, Arjen Ruiterkamp wrote:

 Hi Jarmo, thanks for replying

 I'll clarify a bit what I would like in my rspec report.

 I don't want to make a screenshot after *every *spec, just during some of 
 the specs which test Flot graphs (a Javascript library for displaying 
 graphs).
 These Flot graphs are pretty hard to interact with using Watir-Webdriver 
 thus I want to add a screenshot to the report (or a link to the screenshot) 
 so our testers can quickly check if nothing weird is going on.

 So my (simplified) spec looks like this: 
 describe do something once logged in do

   it should screenshot the flot graph do
 screenshot.save 'flot.png'
   end
 end

 Then the generated report should look like this:


 https://lh6.googleusercontent.com/-vsIEoAadNmE/U1DTkUF0yoI/ACU/VzUQ0FuRcSM/s1600/rspec.png












 Hopefully this clears up my question.

 Is this possible with just watir-rspec or is some form of monkey patching 
 required?

 Regards,
 Arjen

 On Tuesday, April 15, 2014 12:07:04 PM UTC+2, Arjen Ruiterkamp wrote:

 Hello,

 For some acceptance tests I want to include screenshots, which are made 
 during my specs, to the report (thus not just for failing specs).
 The watir-rspec readme states:

 You can use Watir::RSpec.file_path to have links automatically in the 
 html report to the files created during tests.

 uploaded_file_path = 
 Watir::RSpec.file_path(uploaded.txt)File.open(uploaded_file_path, w) 
 {|file| file.write Generated File Input}file_field(:name = 
 upload-file).set uploaded_file_path

 Where do I put this code? When I put it in my spec_helper.rb, I get this 
 error: undefined method `file_field' for main:Object (NoMethodError)
 Anyone has some ideas what I'm doing 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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Embed screenshot in Watir-rspec report (not just for failed tests)

2014-04-18 Thread Jarmo Pertman
Now, after giving some thoughts about it - the way you try to solve it is 
not best solution for your problem. I mean, automated tests should be 
automated - if test does not fail then there should be any reason to look 
at the reports. By making test pass and then looking at the screenshot 
attached to the report to make sure that it really passed seems wrong.

Correct solution would be to test it on some lower level. For example, test 
the data given to the Flot library. Best solution would be to use 
JavaScript unit testing in that case, but you can also do it by using 
Watir::Browser#execute_script by returning some JavaScript object back to 
Ruby and then asserting there.

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


On Friday, April 18, 2014 1:58:13 PM UTC+3, Jarmo Pertman wrote:

 Hi!

 Unfortunately there's no built-in support for such a requirement in 
 `watir-rspec` nor `rspec` itself.

 However, you can achieve that quite easily by creating your own 
 `HtmlFormatter`. Easiest would be to extend `Watir::RSpec::HtmlFormatter` (
 https://github.com/watir/watir-rspec/blob/master/lib/watir/rspec/html_formatter.rb)
  
 and then override `example_passed` from 
 `RSpec::Core::Formatters::HtmlFormatter` (
 https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/formatters/html_formatter.rb#L48-L52)
  
 and insert the links created during your specs from 
 `@files_saved_during_example`. It seems to me that you need to create a 
 different method for printing out the html than it is done currently by 
 RSpec at `HtmlPrinter` (
 https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/formatters/html_printer.rb#L29-L32
 ).

 Then, in your specs you just need to save the screenshot like this:
 browser.screenshot.save Watir::RSpec.file_path(uploaded.txt) # = this 
 creates a unique file name and adds it to the `@files_saved_during_example` 
 array as well.

 Also, refer to the code currently adding links to files created during 
 failing specs to get some idea how it is done:

 https://github.com/watir/watir-rspec/blob/master/lib/watir/rspec/html_formatter.rb#L47-L51

 And don't forget to use your own HtmlFormatter in spec_helper instead of 
 Watir::RSpec::HtmlFormatter.

 The whole approach written above is not tested in practice, but seems to 
 be doable in theory without monkey-patching, but using regular OO 
 programming practices :)

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


 On Friday, April 18, 2014 10:30:21 AM UTC+3, Arjen Ruiterkamp wrote:

 Hi Jarmo, thanks for replying

 I'll clarify a bit what I would like in my rspec report.

 I don't want to make a screenshot after *every *spec, just during some 
 of the specs which test Flot graphs (a Javascript library for displaying 
 graphs).
 These Flot graphs are pretty hard to interact with using Watir-Webdriver 
 thus I want to add a screenshot to the report (or a link to the screenshot) 
 so our testers can quickly check if nothing weird is going on.

 So my (simplified) spec looks like this: 
 describe do something once logged in do

   it should screenshot the flot graph do
 screenshot.save 'flot.png'
   end
 end

 Then the generated report should look like this:


 https://lh6.googleusercontent.com/-vsIEoAadNmE/U1DTkUF0yoI/ACU/VzUQ0FuRcSM/s1600/rspec.png












 Hopefully this clears up my question.

 Is this possible with just watir-rspec or is some form of monkey patching 
 required?

 Regards,
 Arjen

 On Tuesday, April 15, 2014 12:07:04 PM UTC+2, Arjen Ruiterkamp wrote:

 Hello,

 For some acceptance tests I want to include screenshots, which are made 
 during my specs, to the report (thus not just for failing specs).
 The watir-rspec readme states:

 You can use Watir::RSpec.file_path to have links automatically in the 
 html report to the files created during tests.

 uploaded_file_path = 
 Watir::RSpec.file_path(uploaded.txt)File.open(uploaded_file_path, w) 
 {|file| file.write Generated File Input}file_field(:name = 
 upload-file).set uploaded_file_path

 Where do I put this code? When I put it in my spec_helper.rb, I get this 
 error: undefined method `file_field' for main:Object (NoMethodError)
 Anyone has some ideas what I'm doing 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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Page Object framework

2014-04-17 Thread Jarmo Pertman
I'd recommend test-page (https://github.com/jarmo/test-page) because it is 
really lightweight and easy to learn.

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


On Wednesday, April 16, 2014 1:16:31 AM UTC+3, Oscar.Rieken wrote:

 yes, me and pedro did an update a few weeks ago and fixed the problems 
 with rubigen


 On Tue, Apr 15, 2014 at 6:07 PM, Rafael Lima rafal...@gmail.comjavascript:
  wrote:

 hey Oscar, is it now working on Ruby = 2 ?

 Rafael
  
 Você deve ser a mudança que quer ver no mundo.

   Mahatma Gandhi


 On Mon, Apr 14, 2014 at 10:44 AM, Oscar Rieken bis...@gmail.comjavascript:
  wrote:

 I use https://github.com/hammernight/taza





 On Mon, Apr 14, 2014 at 6:06 AM, Željko Filipin 
 zeljko@gmail.comjavascript:
  wrote:

 On Mon, Apr 14, 2014 at 3:33 AM, Rafael Lima 
 rafal...@gmail.comjavascript:
  wrote:

 Lately I have been using Cheezy's Page 
 Objecthttps://github.com/cheezy/page-object, 
 but I haven't use it in any real project yet, only on some personal stuff 
 and so far I'm enjoying it.


 We (Wikimedia Foundation) are using it and it works fine for us[1].

 Željko
 --
 1: https://github.com/wikimedia/mediawiki-selenium#links

 -- 
 -- 
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
  
 watir-...@googlegroups.com javascript:
 http://groups.google.com/group/watir-general
 watir-genera...@googlegroups.com javascript:

 --- 
 You received this message because you are subscribed to the Google 
 Groups Watir General group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to watir-genera...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.


  -- 
 -- 
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
  
 watir-...@googlegroups.com javascript:
 http://groups.google.com/group/watir-general
 watir-genera...@googlegroups.com javascript:

 --- 
 You received this message because you are subscribed to the Google 
 Groups Watir General group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to watir-genera...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.


  -- 
 -- 
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
  
 watir-...@googlegroups.com javascript:
 http://groups.google.com/group/watir-general
 watir-genera...@googlegroups.com javascript:

 --- 
 You received this message because you are subscribed to the Google Groups 
 Watir General group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to watir-genera...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.




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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Embed screenshot in Watir-rspec report (not just for failed tests)

2014-04-17 Thread Jarmo Pertman
Hi!

Are you saying that you want to take screenshots after every spec?

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


On Tuesday, April 15, 2014 1:07:04 PM UTC+3, Arjen Ruiterkamp wrote:

 Hello,

 For some acceptance tests I want to include screenshots, which are made 
 during my specs, to the report (thus not just for failing specs).
 The watir-rspec readme states:

 You can use Watir::RSpec.file_path to have links automatically in the html 
 report to the files created during tests.

 uploaded_file_path = 
 Watir::RSpec.file_path(uploaded.txt)File.open(uploaded_file_path, w) 
 {|file| file.write Generated File Input}file_field(:name = 
 upload-file).set uploaded_file_path

 Where do I put this code? When I put it in my spec_helper.rb, I get this 
 error: undefined method `file_field' for main:Object (NoMethodError)
 Anyone has some ideas what I'm doing 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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: Need info about how to get browser version in watir classic and about ie8 and ie9 support.

2014-04-10 Thread Jarmo Pertman
You can also use Watir::IE.version or Watir::Browser.version depending of 
the version of watir/watir-classic used.

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


On Thursday, April 10, 2014 4:51:00 PM UTC+3, Oscar.Rieken wrote:

 and on a second note I would probably update to more recent versions of 
 ruby/watir imo


 On Thu, Apr 10, 2014 at 9:50 AM, Oscar Rieken bis...@gmail.comjavascript:
  wrote:

 I personally would just drop down to webdriver and ask it what its caps 
 are

 [1] pry(main) require 'watir-webdriver'
 = true
 [2] pry(main) b = Watir::Browser.new :chrome
 = #Watir::Browser:0x..f9c0b79e466ac11da url=data:, title=data:,
 [3] pry(main) b.driver.capabilities
 = #Selenium::WebDriver::Remote::Capabilities:0x007fa1959cc780
  @capabilities=
   {:browser_name=chrome,
:version=33.0.1750.152,
:platform=:mac os x,
:javascript_enabled=true,
:css_selectors_enabled=true,
:takes_screenshot=true,
:native_events=true,
:rotatable=false,
:firefox_profile=nil,
:proxy=nil,
acceptSslCerts=true,
applicationCacheEnabled=false,
browserConnectionEnabled=false,
chrome=
 {userDataDir=
   
 /var/folders/_q/cgwwbx596v995n55n32kd1cmgn/T/.org.chromium.Chromium.rKUMb4},
databaseEnabled=false,
handlesAlerts=true,
locationContextEnabled=true,
takesHeapSnapshot=true,
webStorageEnabled=true}


 On Thu, Apr 10, 2014 at 9:35 AM, Super Kevy 
 kpe...@scholarshipamerica.org javascript: wrote:

 First your running some ancient Ruby and Watir.  Consider moving forward.

 see reference: https://raveendran.wordpress.com/tag/execute_script/


 Code for Watir WebDriver IE Browser :

 require 'rubygems'
 require 'watir-webdriver'
 br=Watir::Browser.new :ie
 ie=br.execute_script(return navigator.userAgent;)
 puts ie.split(MSIE )[1].split(;)[0]



 On Wednesday, April 9, 2014 11:39:40 PM UTC-5, Bhavesh wrote:

 Hi,

  

 I have Ruby 1.8.7 with watir 1.6.5.

  

 I need following info:

  

 1.   How do I get browser version I mean IE version script is 
 running i.e ie7 or ie8 or ie9 etc.

  

 2.   I have Ruby 1.8.7 with watir 1.6.5, where I have lot of TC 
 automated.  I need to run these testcases in Ie8 and IE9, I know I have 
 tweak my script to run in these browser but does watir 1.6.5 supports ie8 
 and ie9?  I mean it is not like I get errors when I try to run script?

 Can someone please help me out with this.

  

 Thanks

 Bhavesh

  -- 
 -- 
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
  
 watir-...@googlegroups.com javascript:
 http://groups.google.com/group/watir-general
 watir-genera...@googlegroups.com javascript:

 --- 
 You received this message because you are subscribed to the Google 
 Groups Watir General group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to watir-genera...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.





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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: Watir-rspec still requires browser variables when executing browser methods?

2014-03-22 Thread Jarmo Pertman
I'd recommend you to move your browser-based specs to requests/integration 
directory instead, because this is what rspec-rails expects and gives you 
some additional helpers. Here's the relevant code:
https://github.com/rspec/rspec-rails/blob/master/lib/rspec/rails/example.rb#L46-L51

Also, in that way you don't have to change the watir-rspec config as well.

Jarmo

On Thursday, March 20, 2014 3:27:19 PM UTC+2, Arjen Ruiterkamp wrote:

 Ok, the problem apparently was with the tests being in 
 the/spec/acceptancefolder. The Rspec configuration isn't loaded for custom 
 folders by default..

 Basically I had to change all the config.include lines in spec_helper.rbfrom:
 config.include Watir::RSpec::Helper, :type = :request
 to
 config.include Watir::RSpec::Helper, :type = :acceptance 

 and in google_spec.rb change:
 describe Google do
 to
 describe Google, :type = :acceptance do

 On Wednesday, March 19, 2014 2:18:35 PM UTC+1, Arjen Ruiterkamp wrote:

 Hello,

 I am fairly new to Ruby and trying to setup some acceptance tests using 
 the watir-rspec gem.

 Now https://github.com/watir/watir-rspec states:

- No need to use the @browser or $browser variables when executing 
browser methods.

 However, this doesn't seem to work for me.

 What I've done so far:
 rails new hello_world

 Then added to the gemfile:
 group :test do
   gem rspec-rails
   gem watir-rspec
   gem watir-rails
 end

 Execute:
 bundle install
 rails generate rspec:install
 watir-rspec install

 This all seems to work fine so far

 Now I created a file in the spec folder: /spec/acceptance/google_spec.rband 
 added the watir-rspec example:

 require spec_helper
 describe Google do
   before { goto http://google.com; }

   it has search box do
 text_field(:name = q).should be_present
   end

   it allows to search do
 text_field(:name = q).set watir
 button(:id = gbqfb).click
 results = div(:id = ires)
 results.should be_present.within(2)
 results.lis(:class = g).map(:text).should be_any { |text| text =~ 
 /watir/ }
 results.should be_present.during(1)
   endend

 Now when I run rspec I get the following output:

 Results will be saved to tmp/spec-results/index.html
 FF

 Failures:

   1) Google has search box
  Failure/Error: before { goto http://google.com; }
  NoMethodError:
undefined method `goto' for 
 #RSpec::Core::ExampleGroup::Nested_1:0x5715a50
  # ./spec/acceptance/google_spec.rb:6:in `block (2 levels) in top 
 (required)'

   2) Google allows to search
  Failure/Error: before { goto http://google.com; }
  NoMethodError:
undefined method `goto' for 
 #RSpec::Core::ExampleGroup::Nested_1:0x57c86d0
  # ./spec/acceptance/google_spec.rb:6:in `block (2 levels) in top 
 (required)'

 Finished in 0.051 seconds
 2 examples, 2 failures

 Failed examples:

 rspec ./spec/acceptance/google_spec.rb:8 # Google has search box
 rspec ./spec/acceptance/google_spec.rb:12 # Google allows to search

 Obviously this can be solved by adding the browser variables but it 
 should be possible without.. right?

 Relevant gem versions:
 Using rspec-core (2.14.8)
 Using rspec-expectations (2.14.5)
 Using rspec-mocks (2.14.6)
 Using rspec (2.14.1)
 Using rspec-rails (2.14.1)
 Using watir-classic (4.0.1)
 Using watir-webdriver (0.6.8)
 Using watir (5.0.0)
 Using watir-rails (1.0.3)
 Using watir-rspec (1.1.2)

 Regards,
 Arjen



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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: click_no_wait problem with IE8 but fine with IE9

2014-01-10 Thread Jarmo Pertman
Hi!

I have written about debugging #click_no_wait long time ago:
http://itreallymatters.net/post/378669758/debugging-watirs-click-no-wait-method-problems

This might still apply nowadays.

Jarmo

On Thursday, January 9, 2014 9:48:34 AM UTC+2, Stefano wrote:

 Hi, no one has had the same problem? Is there a solution?
  
 Thanks,
 Stefano

 Il giorno giovedì 19 dicembre 2013 09:13:48 UTC+1, Stefano ha scritto:

 Hi,

 we are facing a problem with click_no_wait command when we try to open 
 a modal_dialog popup with ruby 2.0.0, watir-classic-4.0.1 and IE8. However, 
 the same Ruby code works fine with IE9. With IE8, the commad 
 click_no_wait don't open the modal dialog popup, but only highlight in 
 yellow the button.

 We would like to have a unique version of our Ruby code allowing to test 
 both IE8 and IE9. 

 Please, can anyone help me? I did not find a solution in the previous 
 discussions.

 Thanks,
 Stefano



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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[wtr-general] Re: problem with using watir and win32ole together

2014-01-10 Thread Jarmo Pertman
Why are you requiring win32ole in the first place?

If you end up loading watir-classic, then it will be loaded for you. Or 
doesn't it?

Jarmo

On Thursday, January 9, 2014 1:33:55 PM UTC+2, marcwest...@gmail.com wrote:

 the order of the requires are ...
 require 'rubygems'
 require 'watir'
 require 'win32ole'


 versions are ...

 bigdecimal (1.2.0)
 childprocess (0.3.9)
 commonwatir (4.0.0)
 ffi (1.9.3 x86-mingw32)
 io-console (0.4.2)
 json (1.7.7)
 mini_magick (3.5.0)
 mini_portile (0.5.2)
 minitest (4.3.2)
 multi_json (1.8.2)
 nokogiri (1.6.1 x86-mingw32)
 psych (2.0.0)
 rake (0.9.6)
 rautomation (0.13.0)
 rdoc (4.0.0)
 rubyzip (1.1.0)
 selenium-webdriver (2.39.0)
 subexec (0.2.3)
 test-unit (2.0.0.0)
 watir (5.0.0 x86-mingw32)
 watir-classic (4.0.1)
 watir-webdriver (0.6.4)
 websocket (1.0.7)
 win32-api (1.5.0 universal-mingw32)
 win32-process (0.7.4)
 win32screenshot (1.0.10)
 windows-api (0.4.2)
 windows-pr (1.2.2)


 No I do not believe I am using blunder.



 On Wednesday, 8 January 2014 17:24:20 UTC, Chuck van der Linden wrote:

 On Monday, January 6, 2014 2:26:22 AM UTC-8, marcwest...@gmail.com wrote:

 I am using watir to automate a browser application which has modal 
 dialogs, but i also use excel to drive what automated tests are run.
  
 The problem I have is when I add the statement require 'win32ole' into 
 my script this then causes errors when I try and deal with a modal dialog. 
 When I take the require 'win32ole statement out it works fine.
  
 The error I get when require 'win32ole' is present and try and deal with 
 a modal dialog is this
  
 C:/Ruby2_0_0/lib/ruby/gems/2.0.0/gems/watir-classic-4.0.1/lib/watir-classic/modal_dialog.rb:59:in
  
 `locate': undefined method `connect_unknown' for WIN32OLE:Class 
 (NoMethodError)from 
 C:/Ruby2_0_0/lib/ruby/gems/2.0.0/gems/watir-classic-4.0.1/lib/watir-classic/modal_dialog.rb:15:in
  
 `title'
  
  
 When I remove the require 'win32ole' the above error does not happen.
  
  
 Has anyone come across this problem and if so how do I over come it ?


 What order are your require statements in?

 Can you do 'gem list' from the command line and give us the versions of 
 applicable gems?

 Are you using bundler? 



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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[wtr-general] Re: rautomation autoit adapter deprecated?

2014-01-05 Thread Jarmo Pertman
Hi!

The goal with RAutomation is to have only one adapter in the end - MsUia. 
This means that autoit and win_32 adapters will be removed in some far 
future.

You can try if ms_uia adapter works for you already. Also, check out this 
closed issue having similar problem to yours - maybe it helps:
https://github.com/jarmo/RAutomation/issues/69

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


On Thursday, January 2, 2014 7:24:13 PM UTC+2, Champ wrote:

 I am using the rautomation autoit adapter with watir-classic 3.7.0. 
 Whenever I run my scripts, I get a message that the autoit adapter will be 
 deprecated.

 I have the need to use autoit's feature of ControlSend where I can run 
 scripts when the computer is locked. 

 Can someone please let me know why the autoit adapter is going to be 
 deprecated soon?


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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [wtr-general] Re: watir, watir-webdriver, watir-classic: history and current state?

2013-12-25 Thread Jarmo Pertman
It's more or less the same.

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


On Monday, December 23, 2013 11:08:28 PM UTC+2, Madhu Ganesh wrote:

 Any update on this conversation? I'd like to know how it compares as of 
 today. 
 Thanks
 Madhu.


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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[wtr-general] Re: test is taking a long time in webdriver v classic

2013-12-24 Thread Jarmo Pertman
I have also noticed that as soon as you go down to table's row and cell 
levels (e.g using #td and #tr methods) then it becomes really, really, 
reaay slow when using webdriver. Not sure about the reason though.

Maybe Jari can comment on that?

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


On Tuesday, December 24, 2013 1:46:01 AM UTC+2, hillary wrote:

 I have a test that takes upwards of 15 minutes or more to complete when 
 running it in webdriver(ie, firefox, chrom) v classic for ie (which takes 
 35s). I'm using taza with turnip as the test framework, running on windows 
 7x64 bit with ruby 2.0. 

 Most of the test runs at a fine speed, but the step of the test that bogs 
 everything down is this loop 

 (1..slots).each do |s|
   @site.slotting.slot_title(@variant_id, s).text.should eq s.to_s
   @site.slotting.slot_checkmark(@variant_id, s).should exist
 end


 This is how i defined those elements: 
 element(:slot_title) {|variant_id,index| browser.div(:id, 
 grid_Variant_#{variant_id}).div(:id, 
 cpsess-#{variant_id}).table.tr.td(:index, 
 5).table.tr.td(:index, index).div(:index, 0)}
 element(:slot_checkmark) {|variant_id,index| browser.div(:id, 
 grid_Variant_#{variant_id}).div(:id, 
 cpsess-#{variant_id}).table.tr.td(:index, 
 5).table.tr.td(:index, index).div(:index, 1).image(:src, /checkmark.png/)}

 I currently have to use indexes because it is not fesable to ask for ids 
 for each tr/td element at this time. 


 So i'm wondering two things: 

1. Why is the following loop significantly slower in watir-webdriver? 
2. Is there a better way to write this validation. I'm trying to 
validate that all of the Columns in the highlighted section of the 
 attached 
screenshot have a checkmark underneath the number. 



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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[wtr-general] Re: Segmentation Fault on browser.alert.ok

2013-11-27 Thread Jarmo Pertman
Hi!

The problem is with current version (1.9.3) of ffi gem. Downgrade it to 
1.9.0.

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


On Monday, November 25, 2013 6:31:31 PM UTC+2, Liz Goodson wrote:

 I am doing a feasibility study on using watir classic to automate our web 
 application testing.  So far, I have been able to jump every little hurdle, 
 but now I am stuck.  It appears there is a bug or some incompatibility in 
 the combination of gems I am using.  Maybe I need to install later versions 
 of Watir and Ruby?  What are the latest stable compatible versions?  I am 
 happy to report the bug, but wanted to check here first, to make sure the 
 problem is not in my code.  I have seen similar issues posted elsewhere, 
 but no resolution, at least not a recent one.  I did update ffi, but have 
 not tried taking win32-api to an earlier version.  I am running IE 10 on 
 Windows 7 (64-bit), and Ruby 1.9.3.  Do I need a win64-api?  Does such a 
 thing exist?

 Thanks for any help you can offer!

 Liz

 *** LOCAL GEMS ***

 bigdecimal (1.1.0)
 childprocess (0.3.9)
 commonwatir (4.0.0)
 ffi (1.9.3 x86-mingw32, 1.9.2)
 io-console (0.3)
 json (1.5.5)
 mini_magick (3.5.0)
 mini_portile (0.5.2)
 minitest (2.5.1)
 multi_json (1.8.2)
 nokogiri (1.6.0 x86-mingw32)
 rake (0.9.2.2)
 rautomation (0.13.0)
 rdoc (3.9.5)
 rubygems-update (2.1.10)
 rubyzip (1.0.0)
 selenium-webdriver (2.37.0)
 subexec (0.2.3)
 watir (5.0.0 x86-mingw32)
 watir-classic (4.0.1)
 watir-webdriver (0.6.4)
 websocket (1.0.7)
 win32-api (1.5.0 universal-mingw32)
 win32-process (0.7.4)
 win32screenshot (1.0.9)
 windows-api (0.4.2)
 windows-pr (1.2.2)


 Here are snippets of the code:

 require io/console
 require Watir
 #require watir-webdriver
 require csv

 ...

   Ref_ID_String = (browser.link(:class = /inlineButton 
 printOfferDetails/).href).match /offer-result\/\d*(\d\d\d\d)\?/
   Ref_ID = $1
   puts Ref_ID
   
   browser.text_field(:name = reference_id).set #{Ref_ID}
   browser.radio(:value = ACCEPT).set
 browser.button(:value = Continue, ).click
  browser.alert.ok


 The Continue button does get clicked, and a confirmation javascript 
 popup appears, but then my code crashes with this error:

 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/functions.rb:296:
  
 [BUG] Segmentation fault
 ruby 1.9.3p448 (2013-06-27) [i386-mingw32]

 -- Control frame information 
 ---
 c:0022 p: s:0141 b:0141 l:000140 d:000140 CFUNC  :enum_child_windows
 c:0021 p:0065 s:0135 b:0135 l:000738 d:000738 METHOD 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/functions.rb:296
 c:0020 p:0015 s:0127 b:0127 l:00056c d:00056c METHOD 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/functions.rb:199
 c:0019 p:0025 s:0122 b:0122 l:000121 d:000121 METHOD 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/functions.rb:146
 c:0018 p:0035 s:0114 b:0113 l:000112 d:000112 METHOD 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/window.rb:254
 c:0017 p:0017 s:0109 b:0109 l:000108 d:000108 METHOD 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/window.rb:220
 c:0016 p: s:0104 b:0104 l:000103 d:000103 FINISH
 c:0015 p:0105 s:0102 b:0102 l:000101 d:000101 METHOD 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-4.0.1/lib/watir-classic/dialogs/alert.rb:50
 c:0014 p:0011 s:0099 b:0099 l:98 d:98 METHOD 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-4.0.1/lib/watir-classic/dialogs/alert.rb:37
 c:0013 p:1241 s:0096 b:0096 l:0017a4 d:95 BLOCK  Eval.rb:113
 c:0012 p:0028 s:0061 b:0061 l:60 d:60 METHOD 
 C:/Ruby193/lib/ruby/1.9.1/csv.rb:1792
 c:0011 p:0014 s:0057 b:0057 l:44 d:56 BLOCK 
  C:/Ruby193/lib/ruby/1.9.1/csv.rb:1208
 c:0010 p:0138 s:0054 b:0054 l:53 d:53 METHOD 
 C:/Ruby193/lib/ruby/1.9.1/csv.rb:1354
 c:0009 p:0030 s:0045 b:0045 l:44 d:44 METHOD 
 C:/Ruby193/lib/ruby/1.9.1/csv.rb:1207
 c:0008 p:0228 s:0039 b:0039 l:0017a4 d:001ce8 BLOCK  Eval.rb:44
 c:0007 p:0028 s:0034 b:0034 l:33 d:33 METHOD 
 C:/Ruby193/lib/ruby/1.9.1/csv.rb:1792
 c:0006 p:0014 s:0030 b:0030 l:17 d:29 BLOCK 
  C:/Ruby193/lib/ruby/1.9.1/csv.rb:1208
 c:0005 p:0138 s:0027 b:0027 l:26 d:26 METHOD 
 C:/Ruby193/lib/ruby/1.9.1/csv.rb:1354
 c:0004 p:0030 s:0018 b:0018 l:17 d:17 METHOD 
 C:/Ruby193/lib/ruby/1.9.1/csv.rb:1207
 c:0003 p:0350 s:0012 b:0012 l:0017a4 d:002434 EVAL   Eval.rb:32
 c:0002 p: s:0004 b:0004 l:03 d:03 FINISH
 c:0001 p: s:0002 b:0002 l:0017a4 d:0017a4 TOP

 -- Ruby level backtrace information 
 
 Eval.rb:32:in `main'
 C:/Ruby193/lib/ruby/1.9.1/csv.rb:1207:in `foreach'
 C:/Ruby193/lib/ruby/1.9.1/csv.rb:1354:in `open'
 C:/Ruby193/lib/ruby/1.9.1/csv.rb

[wtr-general] Re: Error selec_list on modal dialog

2013-11-24 Thread Jarmo Pertman
This is fixed with commit 
https://github.com/watir/watir-classic/commit/8b6b8445686e53b7929d45d75bb8f61e5989e28b

Thanks for reporting it!

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


On Monday, November 18, 2013 7:47:19 PM UTC+2, Justin Ko wrote:

 I created an issue for this - 
 https://github.com/watir/watir-classic/issues/64https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fwatir%2Fwatir-classic%2Fissues%2F64sa=Dsntz=1usg=AFQjCNGarj4WLb5oDjl68Xt-9kuFPne9eg

 In the short term, I think the best solution might be to simply monkey 
 patch a focus method in for the modal dialog. This would address the 
 exception without impacting focusing of elements in the regular part of the 
 browser (ie not modal dialog).

 require 'watir-classic'
 module Watir
   class ModalDialog
 def focus
 end
   end
 end

 Justin

 On Tuesday, November 5, 2013 2:24:57 AM UTC-5, Stefano wrote:

 Hi, there is the same issue with Ruby 2.0.0 and watir-classic (4.0.1). 
 Any idea?
  
 Stefano



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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[wtr-general] Re: does watir classic, not webdriver support IE 10 ?

2013-11-01 Thread Jarmo Pertman
This is definitely not a problem with watir-classic, but related with the 
Ruby itself. It depends of the code you're using there. Try to localize the 
problem by removing some lines using non-ascii symbols to see if you've 
found the culprit and then you have easier time for fixing them.

Jarmo

On Wednesday, October 30, 2013 10:52:02 AM UTC+2, satyendra kumar wrote:

 Hi Jarmo,

 I am using Ruby 1.9.3 with Watir-classic 3.6.0 on Win8. I am getting 
 syntax error in some file (those files work fine with Ruby 1.8.7)

  invalid multibyte char (US-ASCII)

 I have tried adding these line to problematic file

 '# encoding: utf-8'

 and 

 Encoding.default_external = Encoding::UTF_8
 Encoding.default_internal = Encoding::UTF_8

 But none of these helped.

 On Sunday, September 29, 2013 7:48:42 PM UTC+5:30, Jarmo Pertman wrote:

 I have tried it even with Ruby 2.0. There shouldn't be any problems with 
 1.9.3 too. What kind of problems are you seeing?

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


 On Saturday, September 28, 2013 5:42:06 PM UTC+3, Anukul wrote:

 Jarmo, what version of ruby did you use when you verified this worked 
 for IE10 with Win8?  I didn't get promising results with ruby 1.9.3  

 On Saturday, November 17, 2012 5:21:43 PM UTC+5:30, Jarmo Pertman wrote:

 I've verified that Watir-Classic works well with IE10 on Win8.

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


 On Saturday, November 3, 2012 1:57:45 PM UTC+2, Jarmo Pertman wrote:

 To be honest i haven't tried it, since i don't have any Win 8 boxes. 
 It should work though.

 Give it a try an let us know!

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

 On Wednesday, October 31, 2012 7:01:25 PM UTC+2, bobby sharma wrote:

 does watir classic support IE 10 on win 8 box ? 



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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[wtr-general] Re: does watir classic, not webdriver support IE 10 ?

2013-09-29 Thread Jarmo Pertman
I have tried it even with Ruby 2.0. There shouldn't be any problems with 
1.9.3 too. What kind of problems are you seeing?

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


On Saturday, September 28, 2013 5:42:06 PM UTC+3, Anukul wrote:

 Jarmo, what version of ruby did you use when you verified this worked for 
 IE10 with Win8?  I didn't get promising results with ruby 1.9.3  

 On Saturday, November 17, 2012 5:21:43 PM UTC+5:30, Jarmo Pertman wrote:

 I've verified that Watir-Classic works well with IE10 on Win8.

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


 On Saturday, November 3, 2012 1:57:45 PM UTC+2, Jarmo Pertman wrote:

 To be honest i haven't tried it, since i don't have any Win 8 boxes. It 
 should work though.

 Give it a try an let us know!

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

 On Wednesday, October 31, 2012 7:01:25 PM UTC+2, bobby sharma wrote:

 does watir classic support IE 10 on win 8 box ? 



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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [wtr-general] watir-rspec 1.0 released

2013-09-23 Thread Jarmo Pertman
Yes! It supports both - watir-webdriver and watir-classic.

Jarmo

On Monday, September 23, 2013 3:55:37 PM UTC+3, Eason wrote:

 great job! does it support watir-webdriver?


 2013/9/21 Jarmo jar...@gmail.com javascript:

 Hi!

 Released watir-rspec 1.0:

 * add installation binary watir-rspec for easier installation of the gem
 * many internal changes
 * README revamp


 Installation

 Add these lines to your application's Gemfile:

 group :test do
   gem 'watir-rspec'
 end

 Or install it manually as:

 gem install watir-rspec

 And execute the following command to add watir-rspec configuration into
 your spec_helper:

 watir-rspec install

 For more information check it out at GitHub -
 https://github.com/watir/watir-rspec
  
 Jarmo

 -- 
 -- 
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
  
 watir-...@googlegroups.com javascript:
 http://groups.google.com/group/watir-general
 watir-genera...@googlegroups.com javascript:
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 Watir General group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to watir-genera...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.




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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[wtr-general] Re: file_upload error

2013-09-23 Thread Jarmo Pertman
What version of ffi gem are you using? Try upgrading it to the latest 
version and if you have already the latest, then try downgrading it.

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


On Monday, September 23, 2013 6:22:34 AM UTC+3, AAA wrote:

 Hi everyone,

 I'm currently new to watir.  I'm having a problem regarding file_upload.
 I'm inserting a file and its unusual that its stop.  Sometimes it accepts 
 my file but most of the time its stops and this error usually shows when I 
 select the file manually.

 C:/Tech/Ruby200/lib/ruby/gems/2.0.0/gems/rautomation-0.12.0/lib/rautomation/adapter/win_32/functions.rb:294:
  
 [BUG] Segmentation fault
 ruby 2.0.0p247 (2013-06-27) [i386-mingw32]

 -- Control frame information 
 ---
 c:0033 p: s:0150 e:000149 CFUNC  :enum_windows


 [NOTE]
 You may have encountered a bug in the Ruby interpreter or extension 
 libraries.
 Bug reports are welcome.
 For details: http://www.ruby-lang.org/bugreport.html


 This application has requested the Runtime to terminate it in an unusual 
 way.
 Please contact the application's support team for more information.



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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[wtr-general] Re: Watir Installation Issue

2013-09-17 Thread Jarmo Pertman
The problem is in the currently latest version of mini_magick (3.6.0) gem. 
See the issue here:
https://github.com/minimagick/minimagick/issues/145

To install Watir now, install previous version of mini_magick first and 
then watir:
gem install mini_magick -v 3.5.0
gem install watir

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

On Friday, September 13, 2013 2:21:11 AM UTC+3, gato...@gmail.com wrote:

 I had the following error message occur after attempting the latest Watir 
 installation.  PLEASE HELP!

 /Error during installation of Watir//

 1.  Installed Ruby:Ruby 2.0.0-p247 (successful install)
 2.  Installed devkit:  DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe 
 (successful install and
 initialization) (Ruby 2.0.0: mingw64-32-4.7.2)
 3.  Attempted to Install Watir using command:  gem install watir --no-ri 
 --no-rdoc.

 RECEIVED ERROR MESSAGE DURING Watir install:

 *While executing gem ... Errno::EINVAL*
 *   Invalid argument - 
 C:/Ruby200/lib/ruby/gems/2.0.0/gems/mini_magick-3.6.0/test/*
 *   files/special! chars'.gif*

 System Details of machine trying to install on:

 OS Name Microsoft Windows XP Home Edition
 Version 5.1.2600 Service Pack 3 Build 2600
 OS Manufacturer Microsoft Corporation
 System Model Inspiron 6000
 System Type X86-based PC
 Processor x86 Family 6 Model 13 Stepping 6 GenuineIntel ~1296 Mhz
 BIOS Version/Date Dell Inc. A09, 9/28/2005
 SMBIOS Version 2.3
 Windows Directory C:\WINDOWS
 System Directory C:\WINDOWS\system32
 Boot Device \Device\HarddiskVolume1
 Locale United States
 Hardware Abstraction Layer Version = 5.1.2600.5512 (xpsp.080413-2111)
 User Name SARA-7F35E82C65\Sara
 Time Zone Central Daylight Time
 Total Physical Memory 1,024.00 MB
 Available Physical Memory 380.94 MB
 Total Virtual Memory 2.00 GB
 Available Virtual Memory 1.96 GB
 Page File Space 2.39 GB
 Page File C:\pagefile.sys



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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[wtr-general] Re: which version of watir can i install

2013-09-17 Thread Jarmo Pertman
You could try to install older versions of win32-process before updating 
your Ruby. Not sure which one of the older versions will work with 1.8.7, 
but i would try one by one until succeeding to install:
gem install win32-process -v 3.6.0
gem install win32-process -v 3.5.0
...
gem install watir

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


On Monday, September 16, 2013 2:15:39 AM UTC+3, Rakesh Kapoor wrote:

 i run ruby

 C:\Users\ruby -ver
 ruby 1.8.7 (2012-10-12 patchlevel 371) [i386-mingw32]

 C:\Users\gem install watir
 ERROR:  Error installing watir:
 win32-process requires Ruby version  1.9.0.


 Which is latest version of watir can i install?



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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [wtr-general] Watir WebDriver Vs Selenium

2013-09-15 Thread Jarmo Pertman
Biggest difference is API. Check out following short articles:
http://watirmelon.com/2010/04/10/watir-selenium-webdriver/
http://watirmelon.com/2011/05/05/selenium-webdriver-vs-watir-webdriver-in-ruby/

Saying that the only difference is misleading, because this is THE best 
difference :)

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


On Monday, September 9, 2013 11:13:44 PM UTC+3, Oscar.Rieken wrote:

 the only difference is that watir has wrappers to help you locate elements 


 On Sun, Sep 8, 2013 at 5:57 AM, Avihay Eyal aviha...@gmail.comjavascript:
  wrote:

 Hi, I'm trying to evaluate the two frameworks, and I couldn't find a 
 recent and comprehensive comparison of the two...

 So, is there any reason to choose one over the other?


 Thanks.

 -- 
 -- 
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
  
 watir-...@googlegroups.com javascript:
 http://groups.google.com/group/watir-general
 watir-genera...@googlegroups.com javascript:
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 Watir General group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to watir-genera...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.




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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[wtr-general] Re: rautomation send_keys failing when running on remote machine that is minimized

2013-08-20 Thread Jarmo Pertman
There was a similar issue lately. Read the part at the really end:
https://github.com/jarmo/RAutomation/issues/69

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


On Tuesday, August 20, 2013 4:10:32 AM UTC+3, Dan wrote:

 If it's a javascript popup you don't need rautomation and you shouldn't 
 have this problem.  Check out 
 http://watirwebdriver.com/javascript-dialogs/ or 
 http://rubydoc.info/github/watir/watir-classic/frames.

 On Monday, August 19, 2013 6:27:31 PM UTC-4, Champ wrote:

 Hello,

 I use rautomation frequently within my watir scripts to work with popups. 
 It works really well when I have an open active window and browser open and 
 I use the send_keys functionality.

 However,  it is failing when I run the scripts on a remote machine 
 minimized as a window, It just stays at the popup where it is supposed to 
 send the keys.

 I am suspecting it is something to do with activating the popup window, 
 but not sure.

 Any inputs?

 Eg script:

   @ie.button(:text, logoff).click_no_wait
   logoff_win= RAutomation::Window.new(:title = page title, :adapter = 
 :autoit)
   logoff_win.WinWait(page title,'',7)
   logoff_win.WinActivate(page title)
   logoff_win.send_keys('{ENTER}')


 -champ



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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [wtr-general] how to check TextArea is enabled or disabled

2013-06-26 Thread Jarmo Pertman
I'm not sure that there even should be #enabled? method for input elements 
- there should be `disabled?`. Although maybe creating an `enabled?` is not 
too bad idea either.

Jarmo

On Wednesday, June 19, 2013 3:07:26 PM UTC+3, Željko Filipin wrote:

 On Wed, Jun 19, 2013 at 1:53 PM, Sohail Mirza mrz...@gmail.comjavascript:
  wrote:

 NoMethodError: undefined method `enabled?' for 
 #Watir::TextArea:0x2fb0350


 That sounds like a bug to me. You should report it here:

 https://github.com/watir/watir-webdriver/issues

 Željko


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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [wtr-general] Get PHP Session Variable

2013-06-05 Thread Jarmo Pertman
No, it is not possible unless that variable's value is exposed somehow at 
the html source.

If it would be possible to read values of PHP variables using any tools 
just like that, then it would not be possible to write secure applications 
in PHP at all.

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


On Tuesday, June 4, 2013 4:09:31 PM UTC+3, He Bing Lin wrote:

 yeah i was thinking about that too. just asking if that was possible. 
 thanks

 On Tuesday, June 4, 2013 4:42:53 AM UTC-4, Željko Filipin wrote:

 On Mon, Jun 3, 2013 at 10:19 PM, He Bing Lin pete...@gmail.com wrote:

 I wonder if you can get php session variable


 I think this is a general Ruby question, not specific to Watir. How would 
 one see PHP variables from a Ruby script?

 Željko
 --
 https://leanpub.com/watirbook 



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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[wtr-general] Re: Introducing Watirsome

2013-05-19 Thread Jarmo Pertman
By the way, element class method in test-page is not the same as your 
tag-based methods. Element in test-page is a method for providing container 
element - e.g. like el in Backbone.js. The method name is element 
because it is framework agnostic - e.g. you can use it with 
Watir-WebDriver, Selenium-Webdriver, Capybara or with whatever other 
framework - i'd say that's the real main difference between test-page and 
Watirsome.

Jarmo

On Saturday, May 18, 2013 7:22:18 PM UTC+3, Alex Rodionov wrote:

 For the record, I have updated Watir readme to include all these libraries.

 On Saturday, May 18, 2013 8:19:47 PM UTC+7, Alex Rodionov wrote:

 @Jarmo @Chuck

 I created this because I've been using 
 page-objecthttps://github.com/cheezy/page-objectfor more than a year and I 
 didn't know abut test-factory and test-page. It 
 has a bit different API compared to them: test-factory and test-page 
 provide with #element class method, while page-object provides with a range 
 of tag-based methods (#div, #text_field, etc.) I find it much nicer as it 
 is more readable.

 I've been contributing to page-object constantly but at some point faced 
 architecture limitations which resulted that it may be easier to create my 
 own library which implements similar API other than modify page-object. So 
 I did just the same.

 The main idea is to be as close to Watir API as possible (the same 
 locators, method names) + some extra stuff. It's achieved because watirsome 
 is practically a proxy to Watir browser. This allowed me to move all 
 element definitions to class methods so it's much easier to support such 
 page classes.

 Extra stuff includes initializers for page classes and region modules (to 
 support polymorphous page 
 objectshttp://p0deje.blogspot.ru/2012/01/polymorphous-page-objects.html), 
 custom 
 locators which for now is any boolean method Watir::Element responds to. 
 For example:

 # find first visible text field with label Username
 text_field :username, label: 'Username', visible: true

 I treat it as an alternative to gems you mentioned which is more suitable 
 for me.


 On Saturday, May 18, 2013 6:46:25 PM UTC+7, Jarmo Pertman wrote:

 Hi!

 If you're looking something really lightweight, then my gem Test::Page 
 is the one you're looking for:
 https://github.com/jarmo/test-page

 Jarmo

 On Friday, May 17, 2013 11:46:18 PM UTC+3, Chuck van der Linden wrote:

 On Monday, May 13, 2013 11:36:12 PM UTC-7, Alex Rodionov wrote:

 Hey guys!

 I've recently released Watirsome, which is a gem I've been using at 
 work for a long time as an alternative to well known page-object. 

 It's a lot similar to it, but more dynamic and based on 
 watir-webdriver. Thus (at least for now), it works only with it.

 Anyways, you can take a look at https://github.com/p0deje/watirsome and 
 probably give it a shot!


 How is it different from, or would you contrast it with the 
 test-factory page objects gem?  http://rubygems.org/gems/test-factory

 just wondering as that is a lightweight, designed for Watir page 
 objects gem that I'm using (and so far like very much) 



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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[wtr-general] Re: Introducing Watirsome

2013-05-18 Thread Jarmo Pertman
Hi!

If you're looking something really lightweight, then my gem Test::Page is 
the one you're looking for:
https://github.com/jarmo/test-page

Jarmo

On Friday, May 17, 2013 11:46:18 PM UTC+3, Chuck van der Linden wrote:

 On Monday, May 13, 2013 11:36:12 PM UTC-7, Alex Rodionov wrote:

 Hey guys!

 I've recently released Watirsome, which is a gem I've been using at work 
 for a long time as an alternative to well known page-object. 

 It's a lot similar to it, but more dynamic and based on watir-webdriver. 
 Thus (at least for now), it works only with it.

 Anyways, you can take a look at https://github.com/p0deje/watirsome and 
 probably give it a shot!


 How is it different from, or would you contrast it with the test-factory 
 page objects gem?  http://rubygems.org/gems/test-factory

 just wondering as that is a lightweight, designed for Watir page objects 
 gem that I'm using (and so far like very much) 


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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[wtr-general] Re: click_no_wait not working

2013-05-18 Thread Jarmo Pertman
You still have to use #click_no_wait with Watir-Classic to make the alert 
to appear. Using #click would block indefinitely :(

I have written about debugging #click_no_wait problems in the past. It can 
be slightly out of date, but the big picture should be the same. Read it 
here:
http://itreallymatters.net/post/378669758/debugging-watirs-click-no-wait-method-problemshttp://itreallymatters.net/post/378669758/debugging-watirs-click-no-wait-method-problems#.UZdqWLVTDN4

Jarmo

On Friday, May 17, 2013 8:50:44 PM UTC+3, Chuck van der Linden wrote:

 On Thursday, May 16, 2013 4:34:56 AM UTC-7, Marc Westwood wrote:

 I'm having some problems with click_no_wait.

 I have a button which when clicked displays a modaldialog. I am using 
 click_no_wait when clicking the button the button turns yellow but I am not 
 getting the modal dialog displayed. If I use .click the button turns yellow 
 and the modal dialog is displayed. I have also tried .click! this also 
 displays the modal dialog but scripts haults because of the dialog. The 
 button is located within a frame and I am using IE.

 I read that a few people have had this issue in the past I was wondering 
 if it has being resolved, I am using ruby version 1.9.3p374 and 
 wait-classic 3.7.0


 if it's a true JS 'alert' type modal, why not just use .click and the new 
 .alert methods?  

 these are supported by both Watir-classic and Watir-webdriver.   See here 
 for some examples http://watirwebdriver.com/javascript-dialogs/

 at this point click_no_wait is pretty much deprecated when it comes to 
 dealing with JS dialogs 


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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[wtr-general] Re: Looking for click_no_wait functionality/solution for Browser.alert

2013-05-10 Thread Jarmo Pertman
You could overwrite the alert function in JavaScript before triggering the 
first alert. Something like this:
browser.execute_script window.alert = function() {}

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


On Friday, May 10, 2013 10:19:39 PM UTC+3, dubsbox wrote:

 Thank you for the response, Ankita.  Unfortunately, it appears that using 
 the browser.alert.wait_while_present does not help me move forward to close 
 out the second alert pop-up.  Rather, it achieves the same result of 
 hanging my script when the second pop-up appears.  This makes sense as 
 wait_while_present does the following: Wait while element is present 
 before continuing.  What I'm looking for is the opposite - no waiting 
 while the element is present before continuing.

 On Thursday, May 9, 2013 6:59:05 PM UTC-7, Ankita@Adslot wrote:

 How about using 
 browser.alert.wait_while_present

 this will wait for the next line of code to execute until alert goes away

 On Friday, May 10, 2013 5:42:54 AM UTC+10, dubsbox wrote:

 I'm testing a home-grown shopping cart application which has scenarios 
 where adding an item to the cart results in an alert pop-up appearing. 
  Scenarios that have just a single alert pop-up can be handled with 
 Browser.alert.ok.  I have run into a couple of scenarios where adding an 
 item to the cart results in multiple consecutive alert pop-ups that need to 
 be cleared.  The first alert can be cleared just fine with 
 Browser.alert.ok.  I am then unable to clear the second alert pop-up. 
  Working this scenario in irb, I see that after issuing the first 
 Browser.alert.ok command, the irb prompt is not returned.  It seems like 
 the second alert pop-up is blocking progress similar to when an alert 
 pop-up is triggered by clicking a button with just .click instead of 
 .click_no_wait.  So, I'm wondering if anyone has run into a similar 
 situation and has a solution.  It looks like there is no .click_no_wait 
 method defined for the alert pop-ups.

 For reference, my successful scenarios look like this:

 browser.button(:value,Add To Cart).click_no_wait # This triggers 
 the alert pop-up.
 ($browser.wait_until(10) { $browser.alert.exists? }) ? 
 ($browser.alert.ok) : () # Wait a bit and if alert pop-up exists, click 
 OK.  No additional alert pop-up appears.

 My unsuccessful scenarios are when an additional alert pop-up appears 
 after clicking OK on the first alert pop-up.

 Thanks.

 Johnathan





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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[wtr-general] Re: Browser resize on watir-classic.

2013-03-21 Thread Jarmo Pertman
You may create an issue for watir-classic so these methods would be added 
at https://github.com/watir/watir-classic/issues?state=open

Jarmo

On Thursday, March 21, 2013 12:30:32 AM UTC+2, Chuck van der Linden wrote:

 When I compare the rdocs for the Window class  between watir-webdriver and 
 watir-classic, there are a number of size related methods for 
 watir-webdriver which are not there in watir-classic, so I believe the 
 answer to your question is Nope, not supported on watir-classic


 On Tuesday, March 19, 2013 11:24:58 AM UTC-7, Sharanya Viswanath wrote:

 Hi,

 I am trying to resize my IE browser using watir classic. Is there a 
 method to do that? Currently, the code that I have incorporated into my 
 framework works for FF and Chrome. Does watir-classic support resizing of 
 IE browsers? Here's a sample code: 

def init_browser
   if (ENV[BROWSERWIDTH].nil? || ENV[BROWSERWIDTH].empty? || 
 ENV[BROWSER] == IE || ENV[BROWSER] == ipad || ENV[BROWSER] == 
 iphone)
 if (ENV[BROWSER] == IE || ENV[BROWSER] == ipad || 
 ENV[BROWSER] == iphone)  (!ENV[BROWSERWIDTH].nil? || 
 !ENV[BROWSERWIDTH].empty?)
   @logger.info Resizing of browsers is not supported on iOS 
 Simulator, IE 
 end
 @browser = get_browser.__start(@debug_mode)
 add_page_checkers
   else
 @browser = get_browser.__start(@debug_mode)
 if ENV[BROWSERHEIGHT].nil? || ENV[BROWSERHEIGHT].empty?
   width = ENV[BROWSERWIDTH].to_i
   @browser.window.resize_to(width,1024)
   @logger.info Browser height has not been specified. Using 
 default height:1024.\nYour browser has been resized to width:#{width} 
 height:1024
 else
   width = ENV[BROWSERWIDTH].to_i
   height = ENV[BROWSERHEIGHT].to_i
   @browser.window.resize_to(width,height)
   @logger.info Your browser has been resized to width:#{width} 
 height:#{height}
 end
 add_page_checkers
   end
 end

 def activate_ie
   unless RUBY_PLATFORM =~ /win32|mingw/
 raise This platform is not supported (#{PLATFORM})
   end
   @logger.step('Launching INTERNET EXPLORER...')
   require 'watir-classic'
   ie = Watir::IE
   require 'common/assertions'
   require 'core/browser_overrides/common_browser_overrides'
   require 'core/browser_overrides/ie.rb'
   return ie
 end

  class IE
   def self.__start(debug_mode=false)
 Watir::Browser.new(:ie)
   end
 end

 Any help is appreciated.

 Thanks,
 Sharanya V



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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[wtr-general] Re: Watir-Classic 3.6.0 Released!

2013-03-16 Thread Jarmo Pertman
Just in case - if you see ffi gem problems on Ruby 2.0, then install 
1.5.0.pre1 version manually until 1.5.0 has been released:
  gem install ffi --pre

With Best Regards,
Jarmo Pertman

On Saturday, March 16, 2013 10:29:10 AM UTC+2, Jarmo Pertman wrote:

 Good news everyone!

 I'm happy to announce that Watir-Classic 3.6.0 has been released!

 Put it into your Gemfile:
   gem watir-classic, ~ 3.6.0

 Or install it manually with:
   gem install watir-classic

 Changes:
 * Add full support for Ruby 2.0 and IE10.
 * Add support for modal dialogs on Ruby 2.0.
 * Bump up nokogiri dependency for Ruby 2.0 support.
 * Fix Browser#version for IE10.
 * SelectList#select and SelectList#select_value return empty string when 
 value is removed after selection.


 With Best Regards,
 Jarmo Pertman


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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[wtr-general] Re: Watir does not supply credentials to IE

2013-03-15 Thread Jarmo Pertman
What about running these commands in IRB after you've navigated to your 
site:
browser.exists?
browser.title
browser.url
browser.text_fields.size
browser.text_fields.map(:name)

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


On Thursday, March 14, 2013 4:00:42 PM UTC+2, Anthony Coley wrote:

 Update:  I guess require 'rubygems' = false, just means it's already 
 loaded, so it's not the issuse. 

 C:\Ruby193\bingem env 
 RubyGems Environment: 
   - RUBYGEMS VERSION: 2.0.3 
   - RUBY VERSION: 1.9.3 (2013-02-22 patchlevel 392) [i386-mingw32] 
   - INSTALLATION DIRECTORY: C:/Ruby193/lib/ruby/gems/1.9.1 
   - RUBY EXECUTABLE: C:/Ruby193/bin/ruby.exe 
   - EXECUTABLE DIRECTORY: C:/Ruby193/bin 
   - RUBYGEMS PLATFORMS: 
 - ruby 
 - x86-mingw32 
   - GEM PATHS: 
  - C:/Ruby193/lib/ruby/gems/1.9.1 
  - F:/.gem/ruby/1.9.1 
   - GEM CONFIGURATION: 
  - :update_sources = true 
  - :verbose = true 
  - :backtrace = false 
  - :bulk_threshold = 1000 
   - REMOTE SOURCES: 
  - https://rubygems.org/ 


 C:\Ruby193\bin 




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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [wtr-general] Watir 3X is not running in Virtual Machines

2013-03-06 Thread Jarmo Pertman
Watir does not require to be run with administrative privileges. I'm not 
sure as to why you think so, Željko.

Bibhu, run these scripts directly from the command line itself so you can 
see any error messages which might appear.

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


On Tuesday, March 5, 2013 11:51:44 AM UTC+2, Željko Filipin wrote:

 On Tue, Mar 5, 2013 at 7:49 AM, Bibhu acharya 
 chikun@gmail.comjavascript:
  wrote:

 The above steps are working fine when I run from the Admin account.


 As far as I remember Watir always required admin account to work properly 
 on Windows. If you are running tests in a virtual machine, why do you care 
 if the account is admin or not?

 Željko
 --
 https://leanpub.com/watirbook 


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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[wtr-general] Re: How to determine selection criteria (e.g. :name) supported by a given element in watir-webdriver?

2013-03-02 Thread Jarmo Pertman
You can usually use whatever attribute is already valid in html. name for 
tables, as far as i know, is not a valid attribute for example.

You can get a rough estimation of the available attributes at w3 site[1]. 
For example, if you look at the table element[2], then it supports border 
and global attributes. When you look at the global attributes[3], then 
name is not listed there.

There might be of course differences between html4 and html5. In short - if 
you're using some attribute in your html markup and it is a valid attribute 
for that element, then just trying it out in watir should work. If it does 
not, then feel free to open up an issue in watir-classic[4] or 
watir-webdriver[5] repository respectably.

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

[1] http://www.w3.org/TR/html-markup/elements.html
[2] http://www.w3.org/TR/html-markup/table.html#table
[3] http://www.w3.org/TR/html-markup/global-attributes.html
[4] https://github.com/watir/watir-classic/issues
[5] https://github.com/watir/watir-webdriver/issues

On Saturday, March 2, 2013 3:03:11 AM UTC+2, Justin Ko wrote:

 As far as I can tell, the code checks against the attribute_list to 
 determine if the attribute is valid. You can see the list for a specific 
 element type by doing:

 browser.element.class.attribute_list

 where element can be any element type (text_field, link, div, etc.). I 
 believe it is auto-generated some how.

 Justin Ko



 On Friday, March 1, 2013 1:04:25 PM UTC-5, Chuck van der Linden wrote:

 We used to have a big chart, which listed all the elements, and what 
 could be used to identify them, but it was hard to keep up to date, and I'm 
 not sure it's around, linked, or up to date if it is.  

 Is there a simple way (perhaps it has escaped me) to know (perhaps via 
 the rubydocs) what things can be used to select an element?

 for example 
  browser.text_field(:name = foo)  #valid
  browser.tables(:name = foo)  # results in: invalid attribute: :name 
 (Watir::Exception::MissingWayOfFindingObjectException)

 If I look up the tables method in the rubydoc, all I see is  tables 
 (*args)   how can I tell what a valid arg is?




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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[wtr-general] Re: watir-classic issue with execute_script and JSON

2013-02-13 Thread Jarmo Pertman
I just noticed an error in my previous code. I have an extra ' character at 
the start of src attribute value :(

Please try again with the following correct code:
html
  head
script type=text/javascript 
src=file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js/script
  /head
  body
foo
  /body
/html

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

On Wednesday, February 13, 2013 3:14:42 PM UTC+2, enroxorz wrote:

 Please make sure to post your findings. I've been monitoring this because 
 I also have the same issue as you (didn't post because I didn't have 
 anything new to add to this).

 On Tuesday, February 12, 2013 5:51:37 PM UTC-5, captin wrote:

 The issue still exists when trying your suggestion. I will play around 
 with security settings and see if that leads to any resolution.
  
 Thanks!

 On Saturday, February 9, 2013 5:19:14 AM UTC-6, Jarmo Pertman wrote:

 To be honest - i'm not sure where's the problem since i cannot reproduce 
 it on my IE8. I have one idea - create a local html file with the contents:
 html
   head
 script type=text/javascript 
 src='file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js/script
   /head
   body
 foo
   /body
 /html

 Open that file with your internet explorer and try then the JavaScript 
 commands in the developer tools. If they still don't work then it has 
 probably something to do with your IE security settings.

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


 On Friday, February 8, 2013 5:51:27 PM UTC+2, captin wrote:

 Same result. The script errors just continue to pile up.
  
 Do you think this is a bug? If so, is it a json2.js or a watir-classic 
 issue?
  
 Thanks.
  

 On Friday, February 8, 2013 1:39:14 AM UTC-6, Jarmo Pertman wrote:

 That's sad to hear. What if you run execute_script two times in a row 
 - will you also get an error for the second run?

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

 On Thursday, February 7, 2013 12:58:36 AM UTC+2, captin wrote:

 Jarmo,
  
 My apologies for the versioning miscommunication. My initial post and 
 initial error messages are correct with Ruby 1.9.3 and Watir-Classic 
 3.4.0, 
 but the line 
 json2.src='file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js';
  
 is probably what threw you off. That was a copy/paste mistake. The line 
 that I truly used for troubleshooting was 
 json2.src='file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js';
  
 I hope this clears things up.
  
 I also tried copying the json2.js file you linked into my 
 watir-classic gem, and then I ran the same troubleshooting commands 
 along 
 with the original watir command I am trying to use. Same results, even 
 though the two json2.js files are slightly different.
  
  

 On Wednesday, February 6, 2013 11:11:19 AM UTC-6, Jarmo Pertman wrote:

 Hi!

 I just noticed that you had Ruby 1.9.3 vs 1.9.2 and Watir-Classic 
 3.3.0 vs 3.4.0 in your error messages.
 Which one was it actually and why do they differ?

 Can you try to copy the watir-classic gem's json2.js file over with 
 the contents of 
 https://raw.github.com/douglascrockford/JSON-js/master/json2.js and 
 see if that makes any difference?

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


 On Monday, February 4, 2013 4:53:52 PM UTC+2, captin wrote:

 Jarmo,
  
 There is no error when I copy the local json2.js file (located at 
 file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js)
  
 contents to the IE developer tools window. When I run the stringify 
 command 
 you gave me, the out put is {a:foo}. And I get the exact 
 same results when I use the other json2.js you linked and then run the 
 command again.
 I also tried the original commands you gave previously (typeof JSON 
 and typeof JSON.stringify) after I loaded the json2.js script 
 manually, and 
 the outputs were object and function respectively.
  
 In your opinion, is there some sort of automatic loading or 
 accessing issue between JSON and IE?
  
 Thanks.
  
 On Saturday, February 2, 2013 9:47:53 AM UTC-6, Jarmo Pertman wrote:

 Can you try by copying all the contents of the json2.js file from 
 file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js
  to 
 your IE developer tools window? Do you get any errors when doing that 
 too? 
 What does this code return after doing that: JSON.stringify({a: 
 foo})

 What about using the code at 
 https://raw.github.com/douglascrockford/JSON-js/master/json2.js ?

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


 On Thursday, January 31, 2013 1:01:11 AM UTC+2, captin wrote:

 I have encountered an issue with execute_script using IE9 with 
 ruby 1.9.3p327 and watir-classic

[wtr-general] Re: watir-classic issue with execute_script and JSON

2013-02-13 Thread Jarmo Pertman
I think that i can reproduce the problem with tweaking a setting in IE.

There is a setting under Internet Options - Advanced - Security - Allow 
active content to run in files on My Computer. This is disabled by default. 
Enable it, restart IE and try if it will make #execute_script working.

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

On Wednesday, February 13, 2013 10:15:50 PM UTC+2, Jarmo Pertman wrote:

 I just noticed an error in my previous code. I have an extra ' character 
 at the start of src attribute value :(

 Please try again with the following correct code:
 html
   head
 script type=text/javascript 
 src=file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js/script
   /head
   body
 foo
   /body
 /html

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

 On Wednesday, February 13, 2013 3:14:42 PM UTC+2, enroxorz wrote:

 Please make sure to post your findings. I've been monitoring this because 
 I also have the same issue as you (didn't post because I didn't have 
 anything new to add to this).

 On Tuesday, February 12, 2013 5:51:37 PM UTC-5, captin wrote:

 The issue still exists when trying your suggestion. I will play around 
 with security settings and see if that leads to any resolution.
  
 Thanks!

 On Saturday, February 9, 2013 5:19:14 AM UTC-6, Jarmo Pertman wrote:

 To be honest - i'm not sure where's the problem since i cannot 
 reproduce it on my IE8. I have one idea - create a local html file with 
 the 
 contents:
 html
   head
 script type=text/javascript 
 src='file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js/script
   /head
   body
 foo
   /body
 /html

 Open that file with your internet explorer and try then the JavaScript 
 commands in the developer tools. If they still don't work then it has 
 probably something to do with your IE security settings.

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


 On Friday, February 8, 2013 5:51:27 PM UTC+2, captin wrote:

 Same result. The script errors just continue to pile up.
  
 Do you think this is a bug? If so, is it a json2.js or a watir-classic 
 issue?
  
 Thanks.
  

 On Friday, February 8, 2013 1:39:14 AM UTC-6, Jarmo Pertman wrote:

 That's sad to hear. What if you run execute_script two times in a row 
 - will you also get an error for the second run?

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

 On Thursday, February 7, 2013 12:58:36 AM UTC+2, captin wrote:

 Jarmo,
  
 My apologies for the versioning miscommunication. My initial post 
 and initial error messages are correct with Ruby 1.9.3 and 
 Watir-Classic 
 3.4.0, but the line 
 json2.src='file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js';
  
 is probably what threw you off. That was a copy/paste mistake. The line 
 that I truly used for troubleshooting was 
 json2.src='file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js';
  
 I hope this clears things up.
  
 I also tried copying the json2.js file you linked into my 
 watir-classic gem, and then I ran the same troubleshooting commands 
 along 
 with the original watir command I am trying to use. Same results, even 
 though the two json2.js files are slightly different.
  
  

 On Wednesday, February 6, 2013 11:11:19 AM UTC-6, Jarmo Pertman 
 wrote:

 Hi!

 I just noticed that you had Ruby 1.9.3 vs 1.9.2 and Watir-Classic 
 3.3.0 vs 3.4.0 in your error messages.
 Which one was it actually and why do they differ?

 Can you try to copy the watir-classic gem's json2.js file over with 
 the contents of 
 https://raw.github.com/douglascrockford/JSON-js/master/json2.js and 
 see if that makes any difference?

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


 On Monday, February 4, 2013 4:53:52 PM UTC+2, captin wrote:

 Jarmo,
  
 There is no error when I copy the local json2.js file (located at 
 file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js)
  
 contents to the IE developer tools window. When I run the stringify 
 command 
 you gave me, the out put is {a:foo}. And I get the exact 
 same results when I use the other json2.js you linked and then run 
 the 
 command again.
 I also tried the original commands you gave previously (typeof 
 JSON and typeof JSON.stringify) after I loaded the json2.js script 
 manually, and the outputs were object and function respectively.
  
 In your opinion, is there some sort of automatic loading or 
 accessing issue between JSON and IE?
  
 Thanks.
  
 On Saturday, February 2, 2013 9:47:53 AM UTC-6, Jarmo Pertman 
 wrote:

 Can you try by copying all the contents of the json2.js file from 
 file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js
  to 
 your IE developer tools

[wtr-general] Re: watir-classic issue with execute_script and JSON

2013-02-13 Thread Jarmo Pertman
:(

What about opening the html you created above?

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

On Wednesday, February 13, 2013 10:56:44 PM UTC+2, captin wrote:

 I located the registry setting and successfully changed it and verified 
 the setting was enabled. Then I ran the execute_script command and it still 
 errored out with the original error message and code:
  
 WIN32OLERuntimeError: (in OLE method `execScript': )
 OLE error code:80020101 in Unknown
   Could not complete the operation due to error 80020101.
 HRESULT error code:0x80020009
   Exception occurred.
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:29:in
  
 `method_missing'
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:29:in
  
 `rescue in execute_script'
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:22:in
  
 `execute_script'
 from (irb):3
 from C:/Ruby193/bin/irb:12:in `main'
  
  

 On Wednesday, February 13, 2013 2:40:20 PM UTC-6, captin wrote:

 The HTML code worked properly when I fixed the extra character issue you 
 highlighted. When I run the typeof JSON command it returns object and 
 when I run typeof JSON.stringify it returns function.
  
 My enterprise security settings don't allow me to change that setting so 
 I'm unable to prove out your theory. On my system, the setting appears to 
 be disabled by default, and when I open the HTML file from your previous 
 suggestion I get a message saying there's blocked content, but I'm able to 
 click a button to allow it. I am able to modify my registry, so if I can 
 locate that setting in the registry I might be able to test out your theory.
  
 In the meantime, maybe enroxorz is able to proove it out.
  
 Thanks.
  

 On Wednesday, February 13, 2013 2:28:56 PM UTC-6, Jarmo Pertman wrote:

 I think that i can reproduce the problem with tweaking a setting in IE.

 There is a setting under Internet Options - Advanced - Security - 
 Allow active content to run in files on My Computer. This is disabled by 
 default. Enable it, restart IE and try if it will make #execute_script 
 working.

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

 On Wednesday, February 13, 2013 10:15:50 PM UTC+2, Jarmo Pertman wrote:

 I just noticed an error in my previous code. I have an extra ' 
 character at the start of src attribute value :(

 Please try again with the following correct code:
 html
   head
 script type=text/javascript 
 src=file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js/script
   /head
   body
 foo
   /body
 /html

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

 On Wednesday, February 13, 2013 3:14:42 PM UTC+2, enroxorz wrote:

 Please make sure to post your findings. I've been monitoring this 
 because I also have the same issue as you (didn't post because I didn't 
 have anything new to add to this).

 On Tuesday, February 12, 2013 5:51:37 PM UTC-5, captin wrote:

 The issue still exists when trying your suggestion. I will play 
 around with security settings and see if that leads to any resolution.
  
 Thanks!

 On Saturday, February 9, 2013 5:19:14 AM UTC-6, Jarmo Pertman wrote:

 To be honest - i'm not sure where's the problem since i cannot 
 reproduce it on my IE8. I have one idea - create a local html file with 
 the 
 contents:
 html
   head
 script type=text/javascript 
 src='file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js/script
   /head
   body
 foo
   /body
 /html

 Open that file with your internet explorer and try then the 
 JavaScript commands in the developer tools. If they still don't work 
 then 
 it has probably something to do with your IE security settings.

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


 On Friday, February 8, 2013 5:51:27 PM UTC+2, captin wrote:

 Same result. The script errors just continue to pile up.
  
 Do you think this is a bug? If so, is it a json2.js or a 
 watir-classic issue?
  
 Thanks.
  

 On Friday, February 8, 2013 1:39:14 AM UTC-6, Jarmo Pertman wrote:

 That's sad to hear. What if you run execute_script two times in a 
 row - will you also get an error for the second run?

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

 On Thursday, February 7, 2013 12:58:36 AM UTC+2, captin wrote:

 Jarmo,
  
 My apologies for the versioning miscommunication. My initial post 
 and initial error messages are correct with Ruby 1.9.3 and 
 Watir-Classic 
 3.4.0, but the line 
 json2.src='file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js';
  
 is probably what threw you off. That was a copy/paste mistake. The 
 line 
 that I truly used

[wtr-general] Re: watir-classic issue with execute_script and JSON

2013-02-09 Thread Jarmo Pertman
To be honest - i'm not sure where's the problem since i cannot reproduce it 
on my IE8. I have one idea - create a local html file with the contents:
html
  head
script type=text/javascript 
src='file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js/script
  /head
  body
foo
  /body
/html

Open that file with your internet explorer and try then the JavaScript 
commands in the developer tools. If they still don't work then it has 
probably something to do with your IE security settings.

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


On Friday, February 8, 2013 5:51:27 PM UTC+2, captin wrote:

 Same result. The script errors just continue to pile up.
  
 Do you think this is a bug? If so, is it a json2.js or a watir-classic 
 issue?
  
 Thanks.
  

 On Friday, February 8, 2013 1:39:14 AM UTC-6, Jarmo Pertman wrote:

 That's sad to hear. What if you run execute_script two times in a row - 
 will you also get an error for the second run?

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

 On Thursday, February 7, 2013 12:58:36 AM UTC+2, captin wrote:

 Jarmo,
  
 My apologies for the versioning miscommunication. My initial post and 
 initial error messages are correct with Ruby 1.9.3 and Watir-Classic 3.4.0, 
 but the line 
 json2.src='file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js';
  
 is probably what threw you off. That was a copy/paste mistake. The line 
 that I truly used for troubleshooting was 
 json2.src='file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js';
  
 I hope this clears things up.
  
 I also tried copying the json2.js file you linked into my watir-classic 
 gem, and then I ran the same troubleshooting commands along with the 
 original watir command I am trying to use. Same results, even though the 
 two json2.js files are slightly different.
  
  

 On Wednesday, February 6, 2013 11:11:19 AM UTC-6, Jarmo Pertman wrote:

 Hi!

 I just noticed that you had Ruby 1.9.3 vs 1.9.2 and Watir-Classic 3.3.0 
 vs 3.4.0 in your error messages.
 Which one was it actually and why do they differ?

 Can you try to copy the watir-classic gem's json2.js file over with the 
 contents of 
 https://raw.github.com/douglascrockford/JSON-js/master/json2.js and 
 see if that makes any difference?

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


 On Monday, February 4, 2013 4:53:52 PM UTC+2, captin wrote:

 Jarmo,
  
 There is no error when I copy the local json2.js file (located at 
 file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js)
  
 contents to the IE developer tools window. When I run the stringify 
 command 
 you gave me, the out put is {a:foo}. And I get the exact same 
 results when I use the other json2.js you linked and then run the command 
 again.
 I also tried the original commands you gave previously (typeof JSON 
 and typeof JSON.stringify) after I loaded the json2.js script manually, 
 and 
 the outputs were object and function respectively.
  
 In your opinion, is there some sort of automatic loading or accessing 
 issue between JSON and IE?
  
 Thanks.
  
 On Saturday, February 2, 2013 9:47:53 AM UTC-6, Jarmo Pertman wrote:

 Can you try by copying all the contents of the json2.js file from 
 file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js
  to 
 your IE developer tools window? Do you get any errors when doing that 
 too? 
 What does this code return after doing that: JSON.stringify({a: foo})

 What about using the code at 
 https://raw.github.com/douglascrockford/JSON-js/master/json2.js ?

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


 On Thursday, January 31, 2013 1:01:11 AM UTC+2, captin wrote:

 I have encountered an issue with execute_script using IE9 with ruby 
 1.9.3p327 and watir-classic 3.4.0. I was doing some research and found 
 my exact 
 same issue detailed at Stack 
 Overflowhttp://stackoverflow.com/questions/14142905/issue-with-execute-script,
  
 but the thread is stale (and I'm too new to be able to comment on the 
 issue 
 there). Jarmo was assisting but the OP hasn't responded in over three 
 weeks.
  
 I hate redundancy but I also hate waiting indefinitely so I figured 
 I'd pose the question here. Using the following code:
  
 browser.execute_script window.confirm = function() { return true; 
 }
  
 I get the following error:
  
 WIN32OLERuntimeError: (in OLE method `execScript': )
 OLE error code:80020101 in Unknown
   Could not complete the operation due to error 80020101.
 HRESULT error code:0x80020009
   Exception occurred.
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:29:in
  
 `method_missing'
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir

[wtr-general] Re: watir, watir-webdriver, watir-classic: history and current state?

2013-02-07 Thread Jarmo Pertman
By the way, Watir-Classic works quite similarly today when compared to 
Watir-Webdriver - e.g. handling of popups is the same and you cannot 
interact with hidden elements. In other words - there should not have many 
of incompatibilities between the two.

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


On Wednesday, February 6, 2013 5:49:39 PM UTC+2, Alex Shtayer wrote:

 General impression:
 I created hundreds of cases for different functionality (in some cases 
 really complex one) on watir classic and firewatir. After that I spent last 
 six months to migrate everything on one platform (watir-webdriver) as it 
 helps me keep code for all browsers much more maintainable and in the same 
 way. (we don't need all this firefox plug-ins and etc). Also I love new way 
 of handling pop-ups in watir-webdriver, so I finally get rid all AutoIT 
 code and have pure watir code.
 As for me, watir-webdriver works MUCH more reliable than watir for small 
 cases (I do not see any random things), but for long runs I see some 
 crashes that I cannot debug in any way due the driver itself (.exe, so 
 black box for me). So if you do not see any issues with driver, I will 
 recommend to use watir-webdriver

 Is it true that watir-webdriver has improved significantly in the past 12 
 months?
 I know only for last 6 months, but yes. As for me - as Željko said 'Not 
 sure if I would say significantly, but I would say it has improved'

 The true motivation for watir-classic:
 If you have all your code on watir and you don't want to migrate it. As 
 watir-webdrvier completely differently interacts with elements in 
 comparison with watir, you will need to work a lot for such migration. Even 
 the syntax is similar, it doesn't mean that your code will work. For 
 example, my watir code can click on elements that are not visible (like 
 directly through DOM), but watir-webdriver will definitely crash and etc.







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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[wtr-general] Re: watir-classic issue with execute_script and JSON

2013-02-07 Thread Jarmo Pertman
That's sad to hear. What if you run execute_script two times in a row - 
will you also get an error for the second run?

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

On Thursday, February 7, 2013 12:58:36 AM UTC+2, captin wrote:

 Jarmo,
  
 My apologies for the versioning miscommunication. My initial post and 
 initial error messages are correct with Ruby 1.9.3 and Watir-Classic 3.4.0, 
 but the line 
 json2.src='file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js';
  
 is probably what threw you off. That was a copy/paste mistake. The line 
 that I truly used for troubleshooting was 
 json2.src='file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js';
  
 I hope this clears things up.
  
 I also tried copying the json2.js file you linked into my watir-classic 
 gem, and then I ran the same troubleshooting commands along with the 
 original watir command I am trying to use. Same results, even though the 
 two json2.js files are slightly different.
  
  

 On Wednesday, February 6, 2013 11:11:19 AM UTC-6, Jarmo Pertman wrote:

 Hi!

 I just noticed that you had Ruby 1.9.3 vs 1.9.2 and Watir-Classic 3.3.0 
 vs 3.4.0 in your error messages.
 Which one was it actually and why do they differ?

 Can you try to copy the watir-classic gem's json2.js file over with the 
 contents of 
 https://raw.github.com/douglascrockford/JSON-js/master/json2.js and see 
 if that makes any difference?

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


 On Monday, February 4, 2013 4:53:52 PM UTC+2, captin wrote:

 Jarmo,
  
 There is no error when I copy the local json2.js file (located at 
 file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js)
  
 contents to the IE developer tools window. When I run the stringify command 
 you gave me, the out put is {a:foo}. And I get the exact same 
 results when I use the other json2.js you linked and then run the command 
 again.
 I also tried the original commands you gave previously (typeof JSON and 
 typeof JSON.stringify) after I loaded the json2.js script manually, and the 
 outputs were object and function respectively.
  
 In your opinion, is there some sort of automatic loading or accessing 
 issue between JSON and IE?
  
 Thanks.
  
 On Saturday, February 2, 2013 9:47:53 AM UTC-6, Jarmo Pertman wrote:

 Can you try by copying all the contents of the json2.js file from 
 file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js
  to 
 your IE developer tools window? Do you get any errors when doing that too? 
 What does this code return after doing that: JSON.stringify({a: foo})

 What about using the code at 
 https://raw.github.com/douglascrockford/JSON-js/master/json2.js ?

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


 On Thursday, January 31, 2013 1:01:11 AM UTC+2, captin wrote:

 I have encountered an issue with execute_script using IE9 with ruby 
 1.9.3p327 and watir-classic 3.4.0. I was doing some research and found my 
 exact 
 same issue detailed at Stack 
 Overflowhttp://stackoverflow.com/questions/14142905/issue-with-execute-script,
  
 but the thread is stale (and I'm too new to be able to comment on the 
 issue 
 there). Jarmo was assisting but the OP hasn't responded in over three 
 weeks.
  
 I hate redundancy but I also hate waiting indefinitely so I figured 
 I'd pose the question here. Using the following code:
  
 browser.execute_script window.confirm = function() { return true; }
  
 I get the following error:
  
 WIN32OLERuntimeError: (in OLE method `execScript': )
 OLE error code:80020101 in Unknown
   Could not complete the operation due to error 80020101.
 HRESULT error code:0x80020009
   Exception occurred.
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:29:in
  
 `method_missing'
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:29:in
  
 `rescue in execute_script'
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:22:in
  
 `execute_script'
 from (irb):14
 from C:/Ruby193/bin/irb:12:in `main'
  
 The following JavaScript errors are also present in the browser:
  
 SCRIPT1014: Invalid character
 *json2.js, line 1 character 1*
  
 SCRIPT5009: 'JSON' is undefined 
 *edit-location?pageTitle=Edit 
 LocationcontactId=8590307238folderId=0folderName=%5BGlobal%5DcardId=8590242330,
  
 line 1 character 1*
  
 Jarmo, I performed the actions you suggested at Stack Overflow and got 
 the following results:
  
  typeof JSON
 undefined 
  
  typeof JSON.stringify 
 'JSON' is undefined 
  
  if (!window.JSON || !window.JSON.stringify) {
 var json2=document.createElement('script');
 json2.type='text/javascript';
 json2.src

[wtr-general] Re: watir-classic issue with execute_script and JSON

2013-02-06 Thread Jarmo Pertman
Hi!

I just noticed that you had Ruby 1.9.3 vs 1.9.2 and Watir-Classic 3.3.0 vs 
3.4.0 in your error messages.
Which one was it actually and why do they differ?

Can you try to copy the watir-classic gem's json2.js file over with the 
contents of https://raw.github.com/douglascrockford/JSON-js/master/json2.js and 
see if that makes any difference?

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


On Monday, February 4, 2013 4:53:52 PM UTC+2, captin wrote:

 Jarmo,
  
 There is no error when I copy the local json2.js file (located at 
 file:///C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/ext/json2.js)
  
 contents to the IE developer tools window. When I run the stringify command 
 you gave me, the out put is {a:foo}. And I get the exact same 
 results when I use the other json2.js you linked and then run the command 
 again.
 I also tried the original commands you gave previously (typeof JSON and 
 typeof JSON.stringify) after I loaded the json2.js script manually, and the 
 outputs were object and function respectively.
  
 In your opinion, is there some sort of automatic loading or accessing 
 issue between JSON and IE?
  
 Thanks.
  
 On Saturday, February 2, 2013 9:47:53 AM UTC-6, Jarmo Pertman wrote:

 Can you try by copying all the contents of the json2.js file from 
 file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js
  to 
 your IE developer tools window? Do you get any errors when doing that too? 
 What does this code return after doing that: JSON.stringify({a: foo})

 What about using the code at 
 https://raw.github.com/douglascrockford/JSON-js/master/json2.js ?

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


 On Thursday, January 31, 2013 1:01:11 AM UTC+2, captin wrote:

 I have encountered an issue with execute_script using IE9 with ruby 
 1.9.3p327 and watir-classic 3.4.0. I was doing some research and found my 
 exact 
 same issue detailed at Stack 
 Overflowhttp://stackoverflow.com/questions/14142905/issue-with-execute-script,
  
 but the thread is stale (and I'm too new to be able to comment on the issue 
 there). Jarmo was assisting but the OP hasn't responded in over three weeks.
  
 I hate redundancy but I also hate waiting indefinitely so I figured I'd 
 pose the question here. Using the following code:
  
 browser.execute_script window.confirm = function() { return true; }
  
 I get the following error:
  
 WIN32OLERuntimeError: (in OLE method `execScript': )
 OLE error code:80020101 in Unknown
   Could not complete the operation due to error 80020101.
 HRESULT error code:0x80020009
   Exception occurred.
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:29:in
  
 `method_missing'
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:29:in
  
 `rescue in execute_script'
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:22:in
  
 `execute_script'
 from (irb):14
 from C:/Ruby193/bin/irb:12:in `main'
  
 The following JavaScript errors are also present in the browser:
  
 SCRIPT1014: Invalid character
 *json2.js, line 1 character 1*
  
 SCRIPT5009: 'JSON' is undefined 
 *edit-location?pageTitle=Edit 
 LocationcontactId=8590307238folderId=0folderName=%5BGlobal%5DcardId=8590242330,
  
 line 1 character 1*
  
 Jarmo, I performed the actions you suggested at Stack Overflow and got 
 the following results:
  
  typeof JSON
 undefined 
  
  typeof JSON.stringify 
 'JSON' is undefined 
  
  if (!window.JSON || !window.JSON.stringify) {
 var json2=document.createElement('script');
 json2.type='text/javascript';
 json2.src='file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js';
  

 document.getElementsByTagName('head')[0].appendChild(json2)
 } 
 SCRIPT1014: Invalid character 
 *json2.js, line 1 character 1* https://groups.google.com/forum/0 
 [object] {
 nextSibling : ,
 onresizeend : null,
 onrowenter : null,
 aria-haspopup : ,
 childNodes : [object],
 ondragleave : null,
 oncut : null,
 clientHeight : 0,
 onbeforepaste : null,
 ondragover : null
 ...
 } 
 Do you or anyone else have any further troubleshooting steps I can 
 attempt?
  
 Thanks!



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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[wtr-general] Re: watir-classic issue with execute_script and JSON

2013-02-02 Thread Jarmo Pertman
Can you try by copying all the contents of the json2.js file from 
file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js
 to 
your IE developer tools window? Do you get any errors when doing that too? 
What does this code return after doing that: JSON.stringify({a: foo})

What about using the code 
at https://raw.github.com/douglascrockford/JSON-js/master/json2.js ?

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


On Thursday, January 31, 2013 1:01:11 AM UTC+2, captin wrote:

 I have encountered an issue with execute_script using IE9 with ruby 
 1.9.3p327 and watir-classic 3.4.0. I was doing some research and found my 
 exact 
 same issue detailed at Stack 
 Overflowhttp://stackoverflow.com/questions/14142905/issue-with-execute-script,
  
 but the thread is stale (and I'm too new to be able to comment on the issue 
 there). Jarmo was assisting but the OP hasn't responded in over three weeks.
  
 I hate redundancy but I also hate waiting indefinitely so I figured I'd 
 pose the question here. Using the following code:
  
 browser.execute_script window.confirm = function() { return true; }
  
 I get the following error:
  
 WIN32OLERuntimeError: (in OLE method `execScript': )
 OLE error code:80020101 in Unknown
   Could not complete the operation due to error 80020101.
 HRESULT error code:0x80020009
   Exception occurred.
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:29:in
  
 `method_missing'
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:29:in
  
 `rescue in execute_script'
 from 
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.4.0/lib/watir-classic/page-container.rb:22:in
  
 `execute_script'
 from (irb):14
 from C:/Ruby193/bin/irb:12:in `main'
  
 The following JavaScript errors are also present in the browser:
  
 SCRIPT1014: Invalid character
 *json2.js, line 1 character 1*
  
 SCRIPT5009: 'JSON' is undefined 
 *edit-location?pageTitle=Edit 
 LocationcontactId=8590307238folderId=0folderName=%5BGlobal%5DcardId=8590242330,
  
 line 1 character 1*
  
 Jarmo, I performed the actions you suggested at Stack Overflow and got the 
 following results:
  
  typeof JSON
 undefined 
  
  typeof JSON.stringify 
 'JSON' is undefined 
  
  if (!window.JSON || !window.JSON.stringify) {
 var json2=document.createElement('script');
 json2.type='text/javascript';
 json2.src='file:///C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.3.0/lib/watir-classic/ext/json2.js';
  

 document.getElementsByTagName('head')[0].appendChild(json2)
 } 
 SCRIPT1014: Invalid character 
 *json2.js, line 1 character 1* https://groups.google.com/forum/0 
 [object] {
 nextSibling : ,
 onresizeend : null,
 onrowenter : null,
 aria-haspopup : ,
 childNodes : [object],
 ondragleave : null,
 oncut : null,
 clientHeight : 0,
 onbeforepaste : null,
 ondragover : null
 ...
 } 
 Do you or anyone else have any further troubleshooting steps I can attempt?
  
 Thanks!


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

--- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[wtr-general] Re: Watir vs Watir Classic

2013-01-25 Thread Jarmo Pertman
On Thursday, January 24, 2013 6:20:38 PM UTC+2, Dan wrote:

 Actually the statement below about identifiers/locators isn't correct. 
  This is a ruby syntax thing and not a watir one.

 
Actually this statement isn't correct either.

  b.text_field(:name = q).exists?

is actually same as:
  b.text_field({:name = q}).exists?

In other words - it is a method invocation with one argument (a Hash).

On the other hand, this syntax:
  b.text_field(:name,q).exists?

Is a method call with two separate arguments (a Symbol and a String).

Watir supports both syntaxes and converts into Hash one internally for 
backward compatibility. This is done in watir-classic in format_specifiers 
method 
at 
https://github.com/watir/watir-classic/blob/master/lib/watir-classic/supported_elements.rb#L184-L191.
 
There is some similar solution in watir-webdriver too.

Using always a Hash syntax is a recommended way.
 

Answering the original question, watir is a meta-gem, which will install 
and load the gem which works on your platform (watir-classic on Windows and 
watir-webdriver on unix systems by default).

So, install Watir and then start using watir-webdriver or watir-classic 
depending of your OS and needs.

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

-- 
-- 
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: Undefined method 'javascript_dialog' using Watir 4.0.2/Ruby 1.9.3

2013-01-18 Thread Jarmo Pertman
As Dan mentioned - use the JavaScript dialogs API. Use the #alert method 
(http://rubydoc.info/github/watir/watir-classic/Watir/Container:alert) and 
then appropriate Alert 
(http://rubydoc.info/github/watir/watir-classic/Watir/Alert) methods.

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


On Friday, January 18, 2013 2:49:05 AM UTC+2, Dan wrote:

 There's a better way to do it now.  Check this out:

 http://watirwebdriver.com/javascript-dialogs/

 On Thursday, January 17, 2013 5:54:10 PM UTC-5, captin wrote:

 I've searched all over this user group and the web and can't find an 
 answer to my issue. I'm attempting to use the 'javascript_dialog' method 
 to access alert windows. It's my understanding that this capability is 
 supposed to be included in the standard watir (at least it once 
 was according to information like 
 thishttp://stackoverflow.com/questions/8164039/handling-a-javascript-popup-occurring-on-a-keyup-event/8172888#8172888).
  
 I am trying to determine if this functionality has been deprecated or if I 
 might have an issue with my configuration. If it has been deprecated, is 
 there a better way to achieve what I'm trying to through watir-webdriver or 
 watir-classic?
  
 Thanks in advance!
  
 Ruby version: ruby 1.9.3p327 (2012-11-10) [i386-mingw32]
  
 *** LOCAL GEMS ***
 addressable (2.3.2)
 bigdecimal (1.1.0)
 builder (3.1.4)
 childprocess (0.3.6)
 commonwatir (4.0.0)
 diff-lcs (1.1.3)
 ffi (1.2.0 x86-mingw32)
 firewatir (1.9.4)
 hoe (3.3.1)
 io-console (0.3)
 json (1.5.4)
 libwebsocket (0.1.6.1)
 logger (1.2.8)
 mini_magick (3.2.1)
 minitest (2.5.1)
 multi_json (1.3.7)
 nokogiri (1.5.5 x86-mingw32)
 rake (0.9.2.2)
 rautomation (0.7.3)
 rdoc (3.9.4)
 rspec (2.12.0)
 rspec-core (2.12.2)
 rspec-expectations (2.12.1)
 rspec-mocks (2.12.0)
 rubyzip (0.9.9)
 s4t-utils (1.0.4)
 selenium-webdriver (2.26.0)
 subexec (0.0.4)
 syntax (1.0.0)
 test-unit (2.5.3)
 user-choices (1.1.6.1)
 watir (4.0.2 x86-mingw32)
 watir-classic (3.3.0)
 watir-webdriver (0.6.1)
 websocket (1.0.4)
 win32-api (1.4.8 x86-mingw32)
 win32-process (0.7.0)
 win32screenshot (1.0.7)
 windows-api (0.4.2)
 windows-pr (1.2.2)
 xml-simple (1.1.2)



-- 
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: Custom attributes within a table

2013-01-09 Thread Jarmo Pertman
You can also access data attributes directly by converting dashes into 
underscores:
b.tr(:class = pathUserRow).data_path_user_status_id

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


On Tuesday, January 8, 2013 8:00:24 PM UTC+2, janjos wrote:

 you sir are a gentleman and a scholar!

 It worked. Thanks :)

 That path ID only has one instance at this point in the test, so there's 
 no real need to make it more specific/complex. This worked just fine. 

 On Monday, January 7, 2013 3:08:16 PM UTC-5, Dan wrote:

 Try something like this:

 b.tr(:class = pathUserRow).attribute_value data-path-user-status-id

 Although you'll likely need to find some better way to identify the table 
 row.

 On Monday, January 7, 2013 2:19:30 PM UTC-5, janjos wrote:

 I'm working with this html line:
  tr class=pathUserRow data-path-user-status-id=219917

 And my goal is to save the data-path-user-status-id value into a 
 variable and use it elsewhere in my test. 
 Are there any guidelines for custom attributes within a table, using 
 firefox?


 Thanks!



-- 
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 on Windows XP Pro Sp3 doesn't work

2013-01-04 Thread Jarmo Pertman
How come i couldn't reproduce it then? Is there anything in additional 
which makes that error appear?

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


On Thursday, January 3, 2013 11:32:44 PM UTC+2, Daniel Berger wrote:

 I didn't know this until recently. It seems _get_errno is available on 
 Windows XP, but isn't actually an exported function on that runtime. Phooey.

 I'll probably have to replace it with FFI.errno (aka GetLastError) for XP 
 but it will be potentially inaccurate error information.

 Regards,

 Dan

 On Tuesday, October 23, 2012 10:28:33 AM UTC-6, Jarmo Pertman wrote:

 I'm wondering if the author of win32-process gem is aware of this issue 
 already? If some of you could take some time and create an issue under 
 https://github.com/djberg96/win32-process/issues - that would be awesome 
 :)

 I'm not on win xp and can't reproduce it.

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


 On Tuesday, October 23, 2012 8:43:15 AM UTC+3, pranay bhagde wrote:


 Down grading the win32-processes to 0.6.5 really works thanks a lot.




 On Saturday, 8 September 2012 03:19:04 UTC+5:30, Željko Filipin wrote:

 On Fri, Sep 7, 2012 at 5:15 PM, Emanuele Mandaglio e.gi...@gmail.com 
 wrote:
  ffi (1.1.5)
  
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/browser.rb:89:in
  
 `eval': Function '_get_errno' not found in [msvcrt.dll] 
 (FFI::NotFoundError)

 This looks like a problem with ffi gem. We had problems with that gem 
 before. Try upgrading or downgrading the gem. Let us know if you do not 
 know how to do that.

 Željko
 --
 filipin.eu 
  


-- 
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] Function '_get_errno' not found in [msvcrt.dll] (FFI::NotFoun dError)

2012-12-24 Thread Jarmo Pertman
Try this:
C:\Users\Jarmo\gem uninstall win32-process

Select gem to uninstall:
 1. win32-process-0.6.6
 2. win32-process-0.7.0
 3. All versions
 3
Successfully uninstalled win32-process-0.6.6

You have requested to uninstall the gem:
win32-process-0.7.0
watir-classic-3.3.0 depends on [win32-process (= 0.5.5)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]  y
Successfully uninstalled win32-process-0.7.0

C:\Users\Jarmo\gem install win32-process -v 0.6.6
Fetching: win32-process-0.6.6.gem (100%)
Successfully installed win32-process-0.6.6
1 gem installed

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


On Monday, December 24, 2012 10:10:36 AM UTC+2, Igor Morozov wrote:

 I am the beginner in ruby and watir, so I am not sure that I do everything 
 right.
 I wrote in cmd:  gem install win32-process v-0.6.6
 The answer was: Successfully installed win32-process-0.7.0
 ERROR:  Could not find a valid gem '0.6.6' (= 0) in any repository
 1 gem installed
 Did I write anything wrong?
 The error from my first message is still present..

 воскресенье, 23 декабря 2012 г., 16:39:32 UTC+6 пользователь Jarmo Pertman 
 написал:

 Downgrade to win32-process 0.6.6.

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


 On Friday, December 21, 2012 11:21:40 AM UTC+2, Željko Filipin wrote:

 On Fri, Dec 21, 2012 at 9:59 AM, Igor Morozov ivm...@gmail.com wrote:

 What i need to do to solve this?


 For start, you have to let us know which line caused the error. :)

 Željko
 --
 https://leanpub.com/watirbook 



-- 
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] Function '_get_errno' not found in [msvcrt.dll] (FFI::NotFoun dError)

2012-12-23 Thread Jarmo Pertman
Downgrade to win32-process 0.6.6.

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


On Friday, December 21, 2012 11:21:40 AM UTC+2, Željko Filipin wrote:

 On Fri, Dec 21, 2012 at 9:59 AM, Igor Morozov ivm...@gmail.comjavascript:
  wrote:

 What i need to do to solve this?


 For start, you have to let us know which line caused the error. :)

 Željko
 --
 https://leanpub.com/watirbook 


-- 
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: Switching between watir and webdriver

2012-12-07 Thread Jarmo Pertman
Just letting you know that i'm using Watir-Classic to test against IE daily 
and i don't have any problems with it. The name classic does not meen 
it's old, deprecated and not working. By the way, i'm also one of the core 
developers for Watir-Classic so if you find some bugs which you can 
reproduce then i'm willing to investigate and fix these :)

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


On Thursday, December 6, 2012 4:54:06 PM UTC+2, Oscar.Rieken wrote:

 What are the actual errors if you are using xpath there could be problems 
 with that if they are timeouts it would be a different error 

 Without an actual error especially since they are intermittent the best I 
 could offer you is to bump the implicit wait for only ie and see if this 
 helps 

 Sent from my iPhone

 On Dec 6, 2012, at 9:41 AM, Kapil Rajak kapil108...@gmail.comjavascript: 
 wrote:

 I got it Željko, thanks, my last two question, 

 1. what can be the possible reason/explanation for the issue I am getting 
 when I am running thousands of cases, the execution becomes idle, I mean I 
 can see no progress is going on browser, but when I click one of the 
 browser which was doing nothing, execution resumed, I can see the browser 
 started working.

 2. If Watir-webdriver is not that good with IE, is there any other 
 alternative? or what you suggest.
   

 On Thursday, 6 December 2012 19:01:39 UTC+5:30, Željko Filipin wrote:

 On Thu, Dec 6, 2012 at 1:57 PM, Kapil Rajak kapil108...@gmail.comwrote:

 But don't you get issues like I mentioned?


 Yes. From my experience, IEdriver has the most problems that are hard to 
 fix. (I have a lot of experience with Firefox and Chrome drivers, both 
 pretty stable. I do not have a lot of experience with Opera and Safari 
 drivers.) Most of the problems that I have seen is caused by IEdriver not 
 waiting enough before executing the next action.

 Example: enter username and password, click login button, then check if 
 the page contains text welcome. The script fails when checking for the 
 text, the error message says it is not there. Problem fixed by waiting for 
 an element to be on the page, then checking page text:

 http://watirwebdriver.com/waiting/

 Željko

  -- 
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
  
 watir-...@googlegroups.com javascript:
 http://groups.google.com/group/watir-general
 watir-genera...@googlegroups.com javascript:



-- 
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: Switching between watir and webdriver

2012-12-03 Thread Jarmo Pertman
I think that you mean watir-classic for IE and watir-webdriver for 
chrome/ff. Watir is just a meta gem, which installs all the necessary gems 
and allows to switch between the two. The only limitation is that you 
cannot switch between the two more than once during one Ruby process.

This means that you have to drive the selection from outside, if you want 
to switch between them for different Ruby processes. One way to do that 
would be to use environment variables. For example, on your command line 
you can do it like this:
set WATIR_DRIVER=classic
ruby your_test.rb

set WATIR_DRIVER=webdriver
ruby your_test.rb

And your_test.rb should be like this:
require watir

Watir::Browser.new

If you want to switch between chrome and firefox too, then you may use a 
custom environment variable, for example WATIR_BROWSER:

set WATIR_BROWSER=chrome

And use that variable in your_test.rb:
require watir

Watir::Browser.new ENV[WATIR_BROWSER] || :ie


When it comes to incompatibilities between webdriver and classic, it 
depends what code have you written. If you have written for example Firefox 
profile specific code then that won't obviously work with watir-classic. In 
other words, if you've been just using plain Watir API then it should work 
99% between the two. You can check out some differences and API from 
watirspec, which they both run against - http://github.com/watir/watirspec

Let us know if you have any specific problems or questions.

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


On Friday, November 30, 2012 1:40:52 PM UTC+2, Kapil Rajak wrote:

 I was using watir-webdriver for automation, but having some known focusing 
 issue like: link 
 herehttp://stackoverflow.com/questions/10204725/ie-cannot-work-with-c-sharp-selenium-script-while-firefox-works-well-
  wasn't able to click links, sometimes it wasn't able to find a 
 html-component. I thank to Alister Scott for his suggestion to use watir 
 for IE and watir-webdriver for chrome/ff. He says latest version of watir 
 supports switching between the two. But document on github, says it has the 
 limitation. So please let me know the version which supports it and the way 
 I can do that.

 As mentioned, I have developed the whole code based on webdriver, so is 
 there any specific code which may not be compatible with watir-which; I 
 need to change?
 Because, I started using watir, but finding problems, still to find the 
 root cause.   


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

2012-11-24 Thread Jarmo Pertman
Lose the driver part - this makes the code work in both of 
watir-webdriver and watir-classic. So you would do like this instead:
b.save_screenshot(screenshot.png)

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


On Friday, November 23, 2012 9:23:20 PM UTC+2, MEDBEDb wrote:

 I do it as simple as that: 
 *b.driver.save_screenshot #{__FILE__}.png*
 Where it saves renames the screen after .rb script name.


 On Monday, June 2, 2008 10:31:47 AM UTC+3, @90kts wrote:

 Hmmm, wasn't happy paying for SnagIt, and had some teething problems 
 with those recommended gems. So I've rolled my own solution ... 

 First thing I did was created a small app called snapit.exe which you 
 can download a href='http://90kts.com/blog/wp-content/uploads/2008/06/ 
 snapit.exe http://90kts.com/blog/wp-content/uploads/2008/06/snapit.exe' 
 title='snapIt.exe by 90kts'here/a. If anyone is 
 interested in improving the code, you're welcome to get a copy of my 
 source code a href='http://90kts.com/blog/wp-content/uploads/2008/06/ 
 snapit.zip http://90kts.com/blog/wp-content/uploads/2008/06/snapit.zip' 
 title='snapIt Source Code'here/a. In short, all this 
 app does is take a screenshot of the entire screen, and save it to a 
 default location (currently C:\snapit.png). Repeated use of the app 
 will increment the filename by 1 i.e. snapit1.png, snapit2.png ... 

 You can change the default file path by passing it a parameter at 
 runtime 
 e.g. D:\snapit.exe D:\images\testcase.png 

 Next thing to do is call it from your watir code. In Ruby, this is as 
 simple as: 
 cmd = 'D:\\snapit.exe' 
 puts %x{#{cmd}} 

 Putting it all together with some watir as an example: 
 require watir 
 test_site = http://www.90kts.com; 
 ie = Watir::IE.new 
 ie.goto test_site 
 ie.link(:text, Contact).click 
 cmd = 'D:\\snapit.exe D:\\images\testsuite.png' 
 puts %x{#{cmd}} 

 Cheers, 
 Tim



-- 
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] Can you create an array from the values in a select list?

2012-11-22 Thread Jarmo Pertman
You can also do it like this:
b.select_list(:id, 'blah').options.map(:value)

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


On Thursday, November 22, 2012 6:32:24 AM UTC+2, Oscar.Rieken wrote:

 I have a few questions. 
 Why would you want to collect the values to make sure they are in the 
 select? what if they are not in the right order? what if the text and the 
 values do not match up correctly?

 what value is this test really giving?

 but to answer your question which you were on the right track. something 
 like this could work

 select_list = b.select_list(:id, 'blah')
 select_list.options.collect{ |i| i.attribute_value(value)}


 On Wed, Nov 21, 2012 at 11:06 PM, Adrian Killens 
 ack...@googlemail.comjavascript:
  wrote:

 It looks like this and I'd live to get an array of 1, 2, 3 rather than 
 Thing One, Thing Two, Thing Three.

 select name=things size=1 onchange=# id=things class=test
 option value=1Thing One/option
 option value=2Thing Two/option
 option value=3Thing Three/option
 /select

 Hope that makes sense.


 On Thursday, 22 November 2012 00:37:33 UTC, Oscar.Rieken wrote:

 what does the html of the select list look like 


 On Wed, Nov 21, 2012 at 5:14 PM, Adrian Killens 
 ack...@googlemail.comwrote:

 I can do it with options like this:

 selectList = b.select_list(:id, 'blah')
   selectContent = selectList.values.map(:text)
   b.select(:id, 'blah').select_value(**selectContent[1])


 But was wondering how I could do the same thing using the value rather 
 than just the option?

 Cheers
 Aidy

 -- 
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
  
 watir-...@googlegroups.com
 http://groups.google.com/**group/watir-generalhttp://groups.google.com/group/watir-general
 watir-genera...@**googlegroups.com


  -- 
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
  
 watir-...@googlegroups.com javascript:
 http://groups.google.com/group/watir-general
 watir-genera...@googlegroups.com javascript:




-- 
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: does watir classic, not webdriver support IE 10 ?

2012-11-17 Thread Jarmo Pertman
I've verified that Watir-Classic works well with IE10 on Win8.

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


On Saturday, November 3, 2012 1:57:45 PM UTC+2, Jarmo Pertman wrote:

 To be honest i haven't tried it, since i don't have any Win 8 boxes. It 
 should work though.

 Give it a try an let us know!

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

 On Wednesday, October 31, 2012 7:01:25 PM UTC+2, bobby sharma wrote:

 does watir classic support IE 10 on win 8 box ? 



-- 
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-Automation on Windows 7 with IE8

2012-11-16 Thread Jarmo Pertman
Why do you need to run it with administrator? I have also seen that problem 
in the past and its not how Watir work, but for some strange reason Windows 
won't list all IE instances when using WIN32OLE.

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


On Thursday, November 15, 2012 12:15:29 AM UTC+2, user2085 wrote:

 1 down vote 
 favoritehttp://stackoverflow.com/questions/13386356/watir-automation-on-windows-7-with-ie8#
  
   
 I am trying to run watir scripts on Wndows 7 on IE8 as administrator. 

 Here is problem description: Problem was with below statement(popup 
 windows) popup = Watir::IE.attach(:url, /ContactDetails/) and Error message 
 was ‘ Unable to locate the url(ContactDetails)

 The issue seems to be that when there already exists an instance of IE8 
 that was opened with administrative privs, Watir won't see any other IE8 
 windows that are being run as admin, including ones it opens itself.

 Fix that i have been doing: Turn off User Account Control (set to the 
 lowest setting). Go to Control Panel-System and Security-Action 
 Center-Change User Account Control settings, and drop the slider to the 
 lowest setting.

 But this is not a permanent fix, i have to change the windows 7 settings 
 every day to run my automation script.

 Can anyone help me finding out the permanent solution ?


-- 
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: [Cucumber] Screenshots with Cucumber/Watir on Windows 7 with IE9

2012-11-15 Thread Jarmo Pertman
In that case you have to find out how to share that variable between the 
scope where you make the browser and After block. I haven't used Cucumber 
so much so i can't help you with that. Sorry.

Jarmo

On Thursday, November 15, 2012 5:15:52 AM UTC+2, Ry wrote:

 ie happens to be my browser variable

 ie = Watir::Browser.new

 On Monday, November 12, 2012 4:11:48 AM UTC-8, Jarmo Pertman wrote:

 Instead of just using ie, use the browser variable name which is used 
 everywhere else in your tests.

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


 On Sunday, November 11, 2012 8:04:28 PM UTC+2, Ry wrote:

 Thank you.

 1) I removed the 'include watir line

 2) updated my hooks.rb

 After do |scenario|
   if scenario.failed?
 Dir::mkdir('screenshots') if not File.directory?('screenshots')
 screenshot = ./screenshots/FAILED_#{scenario.name.gsub(' 
 ','_').gsub(/[^0-9A-Za-z_]/, '')}.png
 ie.save_screenshot(screenshot)
 embed screenshot, 'image/png'
   end
 end


 error I see in the log now is

 undefined local variable or method `ie' for #Object:0x3361d10 (NameError)

 C:/Users/Darkhudson/Desktop/DEMO/watirDemo/workspace/features/support/hooks.rb:5:in
  `After'


 and it highlights this line as the syntax error

 *ie.save_screenshot(screenshot) *




-- 
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: [Cucumber] Screenshots with Cucumber/Watir on Windows 7 with IE9

2012-11-12 Thread Jarmo Pertman
Instead of just using ie, use the browser variable name which is used 
everywhere else in your tests.

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


On Sunday, November 11, 2012 8:04:28 PM UTC+2, Ry wrote:

 Thank you.

 1) I removed the 'include watir line

 2) updated my hooks.rb

 After do |scenario|
   if scenario.failed?
 Dir::mkdir('screenshots') if not File.directory?('screenshots')
 screenshot = ./screenshots/FAILED_#{scenario.name.gsub(' 
 ','_').gsub(/[^0-9A-Za-z_]/, '')}.png
 ie.save_screenshot(screenshot)
 embed screenshot, 'image/png'
   end
 end


 error I see in the log now is

 undefined local variable or method `ie' for #Object:0x3361d10 (NameError)

 C:/Users/Darkhudson/Desktop/DEMO/watirDemo/workspace/features/support/hooks.rb:5:in
  `After'


 and it highlights this line as the syntax error

 *ie.save_screenshot(screenshot) *




-- 
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: [Cucumber] Screenshots with Cucumber/Watir on Windows 7 with IE9

2012-11-11 Thread Jarmo Pertman
1) Do not perform include Watir - it is not necessary and will clutter 
the global objects namespace.
2) Use this code for saving screenshots:
  ie.save_screenshot screenshot

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


On Sunday, November 11, 2012 1:52:58 AM UTC+2, Ry wrote:

 I am trying to set up ability to take screen shots. I'm not concerned if 
 they embed or are saved to a directory. 

 I have googled several suggestions, but none have worked. 

 Right now I am trying to use example from 
 http://watirmelon.com/tag/cucumber/

 I am using Ruby 1.9, Watir 4.0.2, and Cucumber 1.2.1

 Windows 7 with IE 9

 I have a hooks.rb file with the following

 After do |scenario|
   if scenario.failed?
 Dir::mkdir('screenshots') if not File.directory?('screenshots')
 screenshot = ./screenshots/FAILED_#{scenario.name.gsub(' 
 ','_').gsub(/[^0-9A-Za-z_]/, '')}.png
 Browser::BROWSER.driver.save_screenshot(screenshot)
 embed screenshot, 'image/png'
   end
 end

 start of my ruby file is 

 require 'watir' 
 include Watir 

 ie = Watir::Browser.new

 The script finishes and when I check my html log, I see this after the 
 failed feature.

 uninitialized constant Watir::Browser::BROWSER (NameError)

 C:/Users/Darkhudson/Desktop/DEMO/watirDemo/workspace/features/support/hooks.rb:5:in
  `After'

 3Dir::mkdir('screenshots') if not File.directory?('screenshots')4
 screenshot = ./screenshots/FAILED_#{scenario.name.gsub(' 
 ','_').gsub(/[^0-9A-Za-z_]/, '')}.png5
 Browser::BROWSER.driver.save_screenshot(screenshot)6embed screenshot, 
 'image/png'7  end



 any suggestions to making this work?

 Or if better suggestion to including other gems in my script and using 
 something I am totally open. I just would like to get screenshots to work, 
 specifically on failed features. 

 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


[wtr-general] Re: does watir classic, not webdriver support IE 10 ?

2012-11-03 Thread Jarmo Pertman
To be honest i haven't tried it, since i don't have any Win 8 boxes. It 
should work though.

Give it a try an let us know!

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

On Wednesday, October 31, 2012 7:01:25 PM UTC+2, bobby sharma wrote:

 does watir classic support IE 10 on win 8 box ? 

-- 
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: Flash objects identification in Watir

2012-11-02 Thread Jarmo Pertman
They can't be identified by Watir.

Watir can only interact with html elements.

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


On Friday, November 2, 2012 8:15:29 AM UTC+2, Inder Pal wrote:

 hi all,
 I am using Watir for automation testing of our website. Recently 
 our developers have introduced a lot of Flash elements in the application.
 Hence I will require your inputs on how these elements (Buttons and 
 uploaded options) can be identified in Watir.

 Thanks and regards
 Inder Pal Singh


-- 
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: [Wtr-development] Classic Element.Style vs Webdriver Element.Style

2012-10-27 Thread Jarmo Pertman
It is now implemented in Watir-Classic 3.3.0.

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


On Friday, October 26, 2012 6:34:55 PM UTC+3, alex.ikhelis wrote:

 Thanks Jarmo, we will raise the request.

 JFYI both, this is the original discussion around #style() in watir and is 
 the reason we are following up on this:

 https://github.com/watir/watir-webdriver/issues/11

 Thank you,
 Aliaksandr Ikhelis


 On Fri, Oct 26, 2012 at 4:18 PM, Jarmo jar...@gmail.com javascript:wrote:

 I don't see any reason why it should not be doable in watir-classic too - 
 didn't know that feature exists in watir-webdriver. Please open up a 
 feature request under https://github.com/watir/watir-classic/issues and 
 i'll try to introduce that in the next version.

 J.

 On Fri, Oct 26, 2012 at 1:16 PM, Connor Culleton 
 connor...@gmail.comjavascript:
  wrote:

 Hey Jarmo, 

 In the latest wair-classic the element.style() method works as follows

# return the css style as a string
 def style
   assert_exists
   ole_object.style.cssText
 end


 but it still doesn't behave like the webdriver version (which takes a 
 property argument).

def style(property = nil)
   if property
 assert_exists
 @element.style property
   else
 attribute_value(style).to_s.strip
   end
 end


  It would be really useful if the watir-classic behaviour matched the 
 web driver version. Are there any plans to update this in the future or is 
 there a specfic reason they are different? 
  
 Thanks for everything,
 Connor

 ___
 Wtr-development mailing list
 wtr-dev...@rubyforge.org javascript:
 http://rubyforge.org/mailman/listinfo/wtr-development



 ___
 Wtr-development mailing list
 wtr-dev...@rubyforge.org javascript:
 http://rubyforge.org/mailman/listinfo/wtr-development




-- 
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: Checking if a certain value exists in a dropdown

2012-10-23 Thread Jarmo Pertman
SelectList#include? works only by checking option elements text. So this 
should work:
browser.select.include? Mr

I would do like this instead if wanting to make sure if option exists:
browser.select.option(:value = 26).exists?

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


On Monday, October 22, 2012 4:33:51 PM UTC+3, Adrian Killens wrote:

 Legend!!

 On Monday, 22 October 2012 13:06:17 UTC+1, Adrian Killens wrote:

 select name=title id=titleoption value=-1/option
 option value=26Mr /option
 option value=27Mrs /option
 option value=28Miss /option
 /select

 How would I write a statement to do something if value 26 exists?

 I tried this and it didn't work:
 if b.select(:id, title).include?('26')
 do something
 end



-- 
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 on Windows XP Pro Sp3 doesn't work

2012-10-23 Thread Jarmo Pertman
I'm wondering if the author of win32-process gem is aware of this issue 
already? If some of you could take some time and create an issue under 
https://github.com/djberg96/win32-process/issues - that would be awesome :)

I'm not on win xp and can't reproduce it.

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


On Tuesday, October 23, 2012 8:43:15 AM UTC+3, pranay bhagde wrote:


 Down grading the win32-processes to 0.6.5 really works thanks a lot.




 On Saturday, 8 September 2012 03:19:04 UTC+5:30, Željko Filipin wrote:

 On Fri, Sep 7, 2012 at 5:15 PM, Emanuele Mandaglio e.gi...@gmail.com 
 wrote:
  ffi (1.1.5)
  
 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-classic/browser.rb:89:in
  
 `eval': Function '_get_errno' not found in [msvcrt.dll] (FFI::NotFoundError)

 This looks like a problem with ffi gem. We had problems with that gem 
 before. Try upgrading or downgrading the gem. Let us know if you do not 
 know how to do that.

 Željko
 --
 filipin.eu 
  


-- 
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: Unable to select item from selectlist on watir-classic 3.2: SystemStackError: stack level too deep

2012-10-20 Thread Jarmo Pertman
Awesome, i can reproduce it. Thanks! Will look into it.

Jarmo

On Friday, October 19, 2012 7:35:29 PM UTC+3, Justin Ko wrote:

 To reproduce the SystemStackError error, you can use the w3schools page:

 require 'watir-classic'
 browser = Watir::Browser.new
 browser.goto('
 http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select')
 browser.frame(:name, 'view').select_list.select('Saab')

 Or if you want to do it locally, you can create a page with an iframe and 
 select list:

 main.htm:

 html
 body
 iframe name=view src=frame.htm
 /body
 /html

 frame.htm:

 html
 body
 select
 option value=volvoVolvo/option
 option value=saabSaab/option
 option value=opelOpel/option
 option value=audiAudi/option
 /select
 /body
 /html

 Note: The problem can be seen with iframes as well as framesets.

 Hope that helps.

 - Justin


-- 
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: Unable to select item from selectlist on watir-classic 3.2: SystemStackError: stack level too deep

2012-10-20 Thread Jarmo Pertman
The problem is fixed with commit 
https://github.com/watir/watir-classic/commit/22f94a69ac4a09d893c4088f9f526d1698093542

Thank you for your help!

Jarmo

On Saturday, October 20, 2012 12:29:44 PM UTC+3, Jarmo Pertman wrote:

 Awesome, i can reproduce it. Thanks! Will look into it.

 Jarmo

 On Friday, October 19, 2012 7:35:29 PM UTC+3, Justin Ko wrote:

 To reproduce the SystemStackError error, you can use the w3schools page:

 require 'watir-classic'
 browser = Watir::Browser.new
 browser.goto('
 http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select')
 browser.frame(:name, 'view').select_list.select('Saab')

 Or if you want to do it locally, you can create a page with an iframe and 
 select list:

 main.htm:

 html
 body
 iframe name=view src=frame.htm
 /body
 /html

 frame.htm:

 html
 body
 select
 option value=volvoVolvo/option
 option value=saabSaab/option
 option value=opelOpel/option
 option value=audiAudi/option
 /select
 /body
 /html

 Note: The problem can be seen with iframes as well as framesets.

 Hope that helps.

 - Justin



-- 
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: Having trouble accessing the download bar in IE 9.

2012-10-19 Thread Jarmo Pertman
Hi,

The download bar in IE9 is a really strange thing - it is not anything you 
could automate with RAutomation or AutoIt easily. The easiest way you could 
do anything at all would be to change the default download directory for IE 
with win32-registry and then issue some commands like ctrl+s (not sure 
about this one) or send some tab and enter keystrokes. In short - really 
painful thing to do.

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


On Thursday, October 18, 2012 8:34:29 AM UTC+3, $uraj wrote:

 Hi,

 I am having trouble in accessing the new download bar at the bottom in IE 
 9.
 I am using watir 2.0.4..Is there a way available to access 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] Re: Unable to select item from selectlist on watir-classic 3.2: SystemStackError: stack level too deep

2012-10-19 Thread Jarmo Pertman
But this error is not SystemStackError and might be something else. I'll 
investigate it, but would like to reproduce SystemStackError with minimal 
code sample. It would be awesome if you could reproduce that error too.

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


On Friday, October 19, 2012 12:29:47 AM UTC+3, Champ wrote:

 I removed the frame and created a simple html with a selectlist and saved 
 it as sel.html

 *Html:*
 *htmltabletrtd*
 *SELECT size=1 name=filter OPTION selected value=OPTION 
 value=YActiveOPTION value=NIn-Active/OPTION/SELECT*
 */td/tr/table/html*
 *
 *
 *Watir Code*
 *require 'watir'*
 *require 'watir-classic'*
 *browser=Watir::Browser.start file:///sel.html #Specify complete path*
 *browser.select_list.select(Active)*

 *Response*:
 *C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/element.rb:66:in
  
 `assert_exists': Unable to locate element, using {:tag_name=[select]} 
 (Watir::Exception::UnknownObjectException)*
 * from 
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/element.rb:418:in
  
 `perform_action'*
 * from 
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/input_elements.rb:37:in
  
 `select'*
 * from sel.rb:4:in `main'*

 Note that the same html and the code worked fine on Ruby 1.8.7 and 
 watir-2.0.4

 On Thursday, October 18, 2012 2:54:26 PM UTC-4, Jarmo Pertman wrote:

 Your select is also inside of the frame. I don't see if Champ tried to 
 run that code directly inside of the frame or not, but can you try if that 
 makes any changes if you open the source of the frame in your browser and 
 then manipulate select directly inside of your browser and not a frame?

 J.

 On Thursday, October 18, 2012 8:31:11 PM UTC+3, Drake wrote:

 Further information:
 If you go to the browser and manually select the value, then run the 
 code, it returns a successful value.
 If the value selected manually is anything but the one you want in the 
 code, it freezes and errors out.
 Champ's solution of changing the input_elements.rb file worked for me as 
 well.
  

 On Thursday, 18 October 2012 12:35:45 UTC-4, Drake wrote:

 OK, so it looks like I'm having the same problem.
 Frame: id=mainControlFrame
 List in the frame: 
 select size=4 name=provList id=provList onChange=onChange() 
 ondblclick=onOkClick()
 option value=9Alberta/option
 option value=10British Columbia/option
 option value=7Manitoba/option
 option value=4New Brunswick/option
 option value=1Newfoundland/option
 option value=6Ontario/option
 /select
 There is an OK button below this in a table cell.
  
 watir code I'm using:
 provsel.frame(:id, mainControlFrame).select_list(:id, 
 provList).select(New Brunswick)
 provsel.frame(:id, mainControlFrame).td(:text, OK).click_no_wait
  
 There is code prior to this that runs smooth, but as soon as it hits 
 the select statement, the list box turns yellow, and nothing gets done. 
 Eventually, if I leave it long enough, I get the same error: Stack level 
 too deep.
 On Wednesday, 17 October 2012 20:58:46 UTC-4, Champ wrote:

 Ok. Here is the html for the select_list that was found.

  searching
  found: SELECT style=BACKGROUND-COLOR: yellow 
 class=NORMDATA size=1 name=filter OPTION selected value=OPTION 
 style=BACKGROUND-COLOR: yellow value=YActiveOPTION 
 value=NIn-Active/OPTION/SELECT
 E

 ===
 Error: test_01
   SystemStackError: stack level too deep

 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:129

 ===

 On Wednesday, October 17, 2012 4:04:34 PM UTC-4, Jarmo Pertman wrote:

 Replace the found like to this:
 puts  found: #{found_select.html}

 Jarmo

 On Tuesday, October 16, 2012 7:49:11 PM UTC+3, Champ wrote:

 Jarmo,

 I tried with the code that you shared. The select_list does get 
 identified but shows id: and not the element and I get the stack error 
 message below. This might be the cause 

 **
  searching
  found: id:   
 E

 ===
 Error: test_01
   SystemStackError: stack level too deep

 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:129

 On Tuesday, October 16, 2012 11:31:49 AM UTC-4, Jarmo Pertman wrote:

 That's just strange. I don't see any reasons why this code ought to 
 go turn into stack overflow. However if you change the line to 
 ole_object.focus then sometimes select list onChange event won't be 
 triggered. It would be awesome if you'd figure it out what exactly 
 goes 
 into endless loop there and how to reproduce it. E.g. does the 
 select_list 
 itself get found in change_selected? You can find that out by changing

[wtr-general] Re: Unable to select item from selectlist on watir-classic 3.2: SystemStackError: stack level too deep

2012-10-18 Thread Jarmo Pertman
Your select is also inside of the frame. I don't see if Champ tried to run 
that code directly inside of the frame or not, but can you try if that 
makes any changes if you open the source of the frame in your browser and 
then manipulate select directly inside of your browser and not a frame?

J.

On Thursday, October 18, 2012 8:31:11 PM UTC+3, Drake wrote:

 Further information:
 If you go to the browser and manually select the value, then run the code, 
 it returns a successful value.
 If the value selected manually is anything but the one you want in the 
 code, it freezes and errors out.
 Champ's solution of changing the input_elements.rb file worked for me as 
 well.
  

 On Thursday, 18 October 2012 12:35:45 UTC-4, Drake wrote:

 OK, so it looks like I'm having the same problem.
 Frame: id=mainControlFrame
 List in the frame: 
 select size=4 name=provList id=provList onChange=onChange() 
 ondblclick=onOkClick()
 option value=9Alberta/option
 option value=10British Columbia/option
 option value=7Manitoba/option
 option value=4New Brunswick/option
 option value=1Newfoundland/option
 option value=6Ontario/option
 /select
 There is an OK button below this in a table cell.
  
 watir code I'm using:
 provsel.frame(:id, mainControlFrame).select_list(:id, 
 provList).select(New Brunswick)
 provsel.frame(:id, mainControlFrame).td(:text, OK).click_no_wait
  
 There is code prior to this that runs smooth, but as soon as it hits the 
 select statement, the list box turns yellow, and nothing gets done. 
 Eventually, if I leave it long enough, I get the same error: Stack level 
 too deep.
 On Wednesday, 17 October 2012 20:58:46 UTC-4, Champ wrote:

 Ok. Here is the html for the select_list that was found.

  searching
  found: SELECT style=BACKGROUND-COLOR: yellow class=NORMDATA 
 size=1 name=filter OPTION selected value=OPTION 
 style=BACKGROUND-COLOR: yellow value=YActiveOPTION 
 value=NIn-Active/OPTION/SELECT
 E

 ===
 Error: test_01
   SystemStackError: stack level too deep

 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:129

 ===

 On Wednesday, October 17, 2012 4:04:34 PM UTC-4, Jarmo Pertman wrote:

 Replace the found like to this:
 puts  found: #{found_select.html}

 Jarmo

 On Tuesday, October 16, 2012 7:49:11 PM UTC+3, Champ wrote:

 Jarmo,

 I tried with the code that you shared. The select_list does get 
 identified but shows id: and not the element and I get the stack error 
 message below. This might be the cause 

 **
  searching
  found: id:   
 E

 ===
 Error: test_01
   SystemStackError: stack level too deep

 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:129

 On Tuesday, October 16, 2012 11:31:49 AM UTC-4, Jarmo Pertman wrote:

 That's just strange. I don't see any reasons why this code ought to 
 go turn into stack overflow. However if you change the line to 
 ole_object.focus then sometimes select list onChange event won't be 
 triggered. It would be awesome if you'd figure it out what exactly goes 
 into endless loop there and how to reproduce it. E.g. does the 
 select_list 
 itself get found in change_selected? You can find that out by changing 
 the 
 code to something like this:

 def change_selected(value)
   puts  searching
   found_select = select_list
   puts  found: #{found_select}
   found_select.focus
   puts  focused
   ole_object.selected = value
   puts  selected
   found_select.dispatch_event(onChange)
   puts  dispatched
   @container.wait
   puts  waiting done
 end

 Jarmo


 On Monday, October 15, 2012 10:44:48 PM UTC+3, Champ wrote:

 After trying a long time, I figured that the cause of error is the 
 change_selected method in the input_elements.rb. I am not sure if this 
 impacts anything else. However, changing the select_list.focus to 
 ole_object.focus seems to have resolved the issue for me.

 Any inputs/comments?

 On Monday, October 15, 2012 2:29:51 PM UTC-4, Jarmo Pertman wrote:

 Can you open up the url set in your iframe directly with watir and 
 try that select_list code directly without being in an iframe? Can you 
 try 
 if swapping the order of your select list codes will make any 
 difference - 
 e.g. if you try to select the failing select list first and then the 
 one 
 which passes currently?

 Also, set $DEBUG=true before that failing select list, maybe you 
 will get some other additional information. It is really hard to go 
 from 
 here if there's no additional information as to why it might be 
 happening 
 for you :(

 Jarmo

[wtr-general] Re: Unable to select item from selectlist on watir-classic 3.2: SystemStackError: stack level too deep

2012-10-17 Thread Jarmo Pertman
Replace the found like to this:
puts  found: #{found_select.html}

Jarmo

On Tuesday, October 16, 2012 7:49:11 PM UTC+3, Champ wrote:

 Jarmo,

 I tried with the code that you shared. The select_list does get identified 
 but shows id: and not the element and I get the stack error message below. 
 This might be the cause 

 **
  searching
  found: id:   
 E

 ===
 Error: test_01
   SystemStackError: stack level too deep

 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:129

 On Tuesday, October 16, 2012 11:31:49 AM UTC-4, Jarmo Pertman wrote:

 That's just strange. I don't see any reasons why this code ought to go 
 turn into stack overflow. However if you change the line to 
 ole_object.focus then sometimes select list onChange event won't be 
 triggered. It would be awesome if you'd figure it out what exactly goes 
 into endless loop there and how to reproduce it. E.g. does the select_list 
 itself get found in change_selected? You can find that out by changing the 
 code to something like this:

 def change_selected(value)
   puts  searching
   found_select = select_list
   puts  found: #{found_select}
   found_select.focus
   puts  focused
   ole_object.selected = value
   puts  selected
   found_select.dispatch_event(onChange)
   puts  dispatched
   @container.wait
   puts  waiting done
 end

 Jarmo


 On Monday, October 15, 2012 10:44:48 PM UTC+3, Champ wrote:

 After trying a long time, I figured that the cause of error is the 
 change_selected method in the input_elements.rb. I am not sure if this 
 impacts anything else. However, changing the select_list.focus to 
 ole_object.focus seems to have resolved the issue for me.

 Any inputs/comments?

 On Monday, October 15, 2012 2:29:51 PM UTC-4, Jarmo Pertman wrote:

 Can you open up the url set in your iframe directly with watir and try 
 that select_list code directly without being in an iframe? Can you try if 
 swapping the order of your select list codes will make any difference - 
 e.g. if you try to select the failing select list first and then the one 
 which passes currently?

 Also, set $DEBUG=true before that failing select list, maybe you will 
 get some other additional information. It is really hard to go from here 
 if 
 there's no additional information as to why it might be happening for you 
 :(

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


 On Monday, October 15, 2012 4:59:47 PM UTC+3, Champ wrote:

 Changing the search_filter to a non-blank too shows the same error 
 message. 

 Not sure of how to go about this. There are quite a lot of 
 select_lists in the application and this is a showstopper :(.

 On Sunday, October 14, 2012 5:12:21 AM UTC-4, Jarmo Pertman wrote:

 And this is the only line in the stacktrace? Strange. But maybe it 
 has something to do with the empy search_filter. Try to put there 
 anything 
 else to see if that makes any difference.

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


 On Saturday, October 13, 2012 7:59:09 PM UTC+3, Champ wrote:

 search_by=ARC
 search_filter=

 There is no backtrace to point to the origin of the message. Only 
 error it shows is *SystemStackError: stack level too deep*
 *
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:129
 *
 *
 *
 Thats the reason I am finding it hard to debug.

 -Champ

 On Saturday, October 13, 2012 6:12:33 AM UTC-4, Jarmo Pertman wrote:

 What is the value of search_filter and search_by for example? Also, 
 please share the whole backtrace of that error and not the one line.

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


 On Saturday, October 13, 2012 1:13:47 AM UTC+3, Champ wrote:

 It is a normal selectlist and I use the following command. The 
 page has 2 selectlists side by side. The first one gets selected and 
 the 
 second one hangs and shows the error.

 My watir code looks like this.


 @ie.frame(:id, application_frame).select_list(:name, 
 searchcol).select(search_by)  (This works fine)
 @ie.frame(:id, application_frame).select_list(:name, 
 filter).select(search_filter) (This fails)


 On Friday, October 12, 2012 3:20:15 PM UTC-4, Champ wrote:

  I am on Ruby 1.9.2 and watir-classic 3.2

 I get the following error when I try to select an item from the 
 selectlist. 

 The selectlist gets highlighted in yellow and then hangs. Nothing 
 happens. But after a while I see an error message as below, without 
 indication of the origin of the error. 

 *  SystemStackError: stack level too deep*
 *
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:129
 *

 The fix to this is very critical. Any help

[wtr-general] Re: Unable to select item from selectlist on watir-classic 3.2: SystemStackError: stack level too deep

2012-10-16 Thread Jarmo Pertman
That's just strange. I don't see any reasons why this code ought to go turn 
into stack overflow. However if you change the line to ole_object.focus 
then sometimes select list onChange event won't be triggered. It would be 
awesome if you'd figure it out what exactly goes into endless loop there 
and how to reproduce it. E.g. does the select_list itself get found in 
change_selected? You can find that out by changing the code to something 
like this:

def change_selected(value)
  puts  searching
  found_select = select_list
  puts  found: #{found_select}
  found_select.focus
  puts  focused
  ole_object.selected = value
  puts  selected
  found_select.dispatch_event(onChange)
  puts  dispatched
  @container.wait
  puts  waiting done
end

Jarmo


On Monday, October 15, 2012 10:44:48 PM UTC+3, Champ wrote:

 After trying a long time, I figured that the cause of error is the 
 change_selected method in the input_elements.rb. I am not sure if this 
 impacts anything else. However, changing the select_list.focus to 
 ole_object.focus seems to have resolved the issue for me.

 Any inputs/comments?

 On Monday, October 15, 2012 2:29:51 PM UTC-4, Jarmo Pertman wrote:

 Can you open up the url set in your iframe directly with watir and try 
 that select_list code directly without being in an iframe? Can you try if 
 swapping the order of your select list codes will make any difference - 
 e.g. if you try to select the failing select list first and then the one 
 which passes currently?

 Also, set $DEBUG=true before that failing select list, maybe you will get 
 some other additional information. It is really hard to go from here if 
 there's no additional information as to why it might be happening for you :(

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


 On Monday, October 15, 2012 4:59:47 PM UTC+3, Champ wrote:

 Changing the search_filter to a non-blank too shows the same error 
 message. 

 Not sure of how to go about this. There are quite a lot of select_lists 
 in the application and this is a showstopper :(.

 On Sunday, October 14, 2012 5:12:21 AM UTC-4, Jarmo Pertman wrote:

 And this is the only line in the stacktrace? Strange. But maybe it has 
 something to do with the empy search_filter. Try to put there anything 
 else 
 to see if that makes any difference.

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


 On Saturday, October 13, 2012 7:59:09 PM UTC+3, Champ wrote:

 search_by=ARC
 search_filter=

 There is no backtrace to point to the origin of the message. Only 
 error it shows is *SystemStackError: stack level too deep*
 *
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:129
 *
 *
 *
 Thats the reason I am finding it hard to debug.

 -Champ

 On Saturday, October 13, 2012 6:12:33 AM UTC-4, Jarmo Pertman wrote:

 What is the value of search_filter and search_by for example? Also, 
 please share the whole backtrace of that error and not the one line.

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


 On Saturday, October 13, 2012 1:13:47 AM UTC+3, Champ wrote:

 It is a normal selectlist and I use the following command. The page 
 has 2 selectlists side by side. The first one gets selected and the 
 second 
 one hangs and shows the error.

 My watir code looks like this.


 @ie.frame(:id, application_frame).select_list(:name, 
 searchcol).select(search_by)  (This works fine)
 @ie.frame(:id, application_frame).select_list(:name, 
 filter).select(search_filter) (This fails)


 On Friday, October 12, 2012 3:20:15 PM UTC-4, Champ wrote:

  I am on Ruby 1.9.2 and watir-classic 3.2

 I get the following error when I try to select an item from the 
 selectlist. 

 The selectlist gets highlighted in yellow and then hangs. Nothing 
 happens. But after a while I see an error message as below, without 
 indication of the origin of the error. 

 *  SystemStackError: stack level too deep*
 *
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:129
 *

 The fix to this is very critical. Any help in this regard is 
 greatly appreciated.

 -Champ



-- 
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: Unable to select item from selectlist on watir-classic 3.2: SystemStackError: stack level too deep

2012-10-15 Thread Jarmo Pertman
Can you open up the url set in your iframe directly with watir and try that 
select_list code directly without being in an iframe? Can you try if 
swapping the order of your select list codes will make any difference - 
e.g. if you try to select the failing select list first and then the one 
which passes currently?

Also, set $DEBUG=true before that failing select list, maybe you will get 
some other additional information. It is really hard to go from here if 
there's no additional information as to why it might be happening for you :(

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


On Monday, October 15, 2012 4:59:47 PM UTC+3, Champ wrote:

 Changing the search_filter to a non-blank too shows the same error 
 message. 

 Not sure of how to go about this. There are quite a lot of select_lists in 
 the application and this is a showstopper :(.

 On Sunday, October 14, 2012 5:12:21 AM UTC-4, Jarmo Pertman wrote:

 And this is the only line in the stacktrace? Strange. But maybe it has 
 something to do with the empy search_filter. Try to put there anything else 
 to see if that makes any difference.

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


 On Saturday, October 13, 2012 7:59:09 PM UTC+3, Champ wrote:

 search_by=ARC
 search_filter=

 There is no backtrace to point to the origin of the message. Only error 
 it shows is *SystemStackError: stack level too deep*
 *
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:129
 *
 *
 *
 Thats the reason I am finding it hard to debug.

 -Champ

 On Saturday, October 13, 2012 6:12:33 AM UTC-4, Jarmo Pertman wrote:

 What is the value of search_filter and search_by for example? Also, 
 please share the whole backtrace of that error and not the one line.

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


 On Saturday, October 13, 2012 1:13:47 AM UTC+3, Champ wrote:

 It is a normal selectlist and I use the following command. The page 
 has 2 selectlists side by side. The first one gets selected and the 
 second 
 one hangs and shows the error.

 My watir code looks like this.


 @ie.frame(:id, application_frame).select_list(:name, 
 searchcol).select(search_by)  (This works fine)
 @ie.frame(:id, application_frame).select_list(:name, 
 filter).select(search_filter) (This fails)


 On Friday, October 12, 2012 3:20:15 PM UTC-4, Champ wrote:

  I am on Ruby 1.9.2 and watir-classic 3.2

 I get the following error when I try to select an item from the 
 selectlist. 

 The selectlist gets highlighted in yellow and then hangs. Nothing 
 happens. But after a while I see an error message as below, without 
 indication of the origin of the error. 

 *  SystemStackError: stack level too deep*
 *
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:129
 *

 The fix to this is very critical. Any help in this regard is greatly 
 appreciated.

 -Champ



-- 
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: Unable to select item from selectlist on watir-classic 3.2: SystemStackError: stack level too deep

2012-10-14 Thread Jarmo Pertman
And this is the only line in the stacktrace? Strange. But maybe it has 
something to do with the empy search_filter. Try to put there anything else 
to see if that makes any difference.

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


On Saturday, October 13, 2012 7:59:09 PM UTC+3, Champ wrote:

 search_by=ARC
 search_filter=

 There is no backtrace to point to the origin of the message. Only error it 
 shows is *SystemStackError: stack level too deep*
 *
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:129
 *
 *
 *
 Thats the reason I am finding it hard to debug.

 -Champ

 On Saturday, October 13, 2012 6:12:33 AM UTC-4, Jarmo Pertman wrote:

 What is the value of search_filter and search_by for example? Also, 
 please share the whole backtrace of that error and not the one line.

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


 On Saturday, October 13, 2012 1:13:47 AM UTC+3, Champ wrote:

 It is a normal selectlist and I use the following command. The page has 
 2 selectlists side by side. The first one gets selected and the second one 
 hangs and shows the error.

 My watir code looks like this.


 @ie.frame(:id, application_frame).select_list(:name, 
 searchcol).select(search_by)  (This works fine)
 @ie.frame(:id, application_frame).select_list(:name, 
 filter).select(search_filter) (This fails)


 On Friday, October 12, 2012 3:20:15 PM UTC-4, Champ wrote:

  I am on Ruby 1.9.2 and watir-classic 3.2

 I get the following error when I try to select an item from the 
 selectlist. 

 The selectlist gets highlighted in yellow and then hangs. Nothing 
 happens. But after a while I see an error message as below, without 
 indication of the origin of the error. 

 *  SystemStackError: stack level too deep*
 *
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:129
 *

 The fix to this is very critical. Any help in this regard is greatly 
 appreciated.

 -Champ



-- 
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: Unable to select item from selectlist on watir-classic 3.2: SystemStackError: stack level too deep

2012-10-13 Thread Jarmo Pertman
What is the value of search_filter and search_by for example? Also, please 
share the whole backtrace of that error and not the one line.

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


On Saturday, October 13, 2012 1:13:47 AM UTC+3, Champ wrote:

 It is a normal selectlist and I use the following command. The page has 2 
 selectlists side by side. The first one gets selected and the second one 
 hangs and shows the error.

 My watir code looks like this.


 @ie.frame(:id, application_frame).select_list(:name, 
 searchcol).select(search_by)  (This works fine)
 @ie.frame(:id, application_frame).select_list(:name, 
 filter).select(search_filter) (This fails)


 On Friday, October 12, 2012 3:20:15 PM UTC-4, Champ wrote:

  I am on Ruby 1.9.2 and watir-classic 3.2

 I get the following error when I try to select an item from the 
 selectlist. 

 The selectlist gets highlighted in yellow and then hangs. Nothing 
 happens. But after a while I see an error message as below, without 
 indication of the origin of the error. 

 *  SystemStackError: stack level too deep*
 *
 C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/locator.rb:129
 *

 The fix to this is very critical. Any help in this regard is greatly 
 appreciated.

 -Champ



-- 
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 no worky on Ruby 1.9.3

2012-10-11 Thread Jarmo Pertman
Maybe it has something to do with iframe. Can you go to the frame-s source 
url directly so you won't be inside of any frames and then click that 
button with #click_no_wait without being in the context of any frames?

If that helps then try again with frame, but this time edit the outputted 
command like this.

Instead of:
Watir::IE.attach(:hwnd, xx).frame({:tag_name=['frame', 'iframe'], 
:id='viewIFRAME'})

Like this:
Watir::IE.attach(:hwnd, xx).frame({:tag_name= Array.new  'frame'  
'iframe', :id='viewIFRAME'})

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

On Thursday, October 11, 2012 1:10:42 AM UTC+3, Paul wrote:

 Tried it with no success, also I note that the backslashes are there in my 
 1.9.2 installation. That path is my RUBYLIB env var.

 Regards

 On Thursday, 11 October 2012 05:37:31 UTC+13, Jarmo Pertman wrote:

 Can you try if changing \\ in that #click_no_wait command to / 
 instead will make any difference. I can see this entry in that command:

 C:\\Users\\pauld\\workspace\\SopranoMedicalRecords\\AutomatedTests\\med_rec\\

 Let us know of your results.

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


 On Tuesday, October 9, 2012 6:29:16 AM UTC+3, Paul wrote:

 Edited subject to click_no_wait no worky on Ruby 1.9.3

 On Monday, 8 October 2012 10:57:02 UTC+13, Paul wrote:

 Here is my ruby version and gem list (after re-installing Ruby 1.9.3 
 and gems):

 C:\Users\pauld\workspace\SopranoMedicalRecords\AutomatedTests\med_rec\testsruby
  
 -v
 ruby 1.9.3p194 (2012-04-20) [i386-mingw32]

 C:\Users\pauld\workspace\SopranoMedicalRecords\AutomatedTests\med_rec\testsgem
  
 list

 *** LOCAL GEMS ***

 addressable (2.3.2)
 bigdecimal (1.1.0)
 builder (3.1.3)
 childprocess (0.3.5)
 commonwatir (4.0.0)
 ffi (1.1.5 x86-mingw32)
 hoe (3.1.0)
 io-console (0.3)
 json (1.5.4)
 libwebsocket (0.1.5)
 mini_magick (3.2.1)
 minitest (2.5.1)
 multi_json (1.3.6)
 nokogiri (1.5.5 x86-mingw32)
 rake (0.9.2.2)
 rautomation (0.7.2)
 rdoc (3.9.4)
 ruby-oci8 (2.1.2 x86-mingw32)
 rubyzip (0.9.9)
 s4t-utils (1.0.4)
 selenium-webdriver (2.25.0)
 subexec (0.0.4)
 sys-proctable (0.9.1 universal-mingw32)
 user-choices (1.1.6.1)
 watir (4.0.0 x86-mingw32)
 watir-classic (3.2.0)
 watir-webdriver (0.6.1)
 win32-api (1.4.8 x86-mingw32)
 win32-process (0.7.0)
 win32screenshot (1.0.7)
 windows-api (0.4.2)
 windows-pr (1.2.2)
 xml-simple (1.1.1)
 yajl-ruby (1.1.0 x86-mingw32)

 Here is an IRB session, the button to click is deep within some frames. 

 irb(main):014:0 require 'rubygems'
 = true
 irb(main):015:0 require 'watir-classic'
 = true
 irb(main):016:0 b = Watir::Browser.attach :url, /concerto/
 = #Watir::IE:0x..f953476 url=
 http://chch-medsrec-vm04/concerto/Concerto.htm; title=Concerto - 
 Example Clinician
 irb(main):017:0 cc = b.frame(:id, 'ConcertoContext')
 = #Watir::Frame:0x7a30ef0e located=false 
 specifiers={:tag_name=[frame, iframe], :id=ConcertoContext}
 irb(main):018:0 ca = cc.frame(:id, 'ConcertoApplication')
 = #Watir::Frame:0x750f406 located=false 
 specifiers={:tag_name=[frame, iframe], :id=ConcertoApplication}
 irb(main):019:0 eds = ca.frame(:name, 'EDSMain')
 = #Watir::Frame:0x..f91b2c866 located=false 
 specifiers={:tag_name=[frame, iframe], :name=EDSMain}
 irb(main):020:0 r = eds.frame(:name, 'Right')
 = #Watir::Frame:0x..f8e09a25e located=false 
 specifiers={:tag_name=[frame, iframe], :name=Right}
 irb(main):021:0 l = eds.frame(:name, 'Left')
 = #Watir::Frame:0x3d17c2c6 located=false 
 specifiers={:tag_name=[frame, iframe], :name=Left}
 irb(main):022:0 lt = l.frame(:name, 'LeftTop')
 = #Watir::Frame:0x..f860f0e9e located=false 
 specifiers={:tag_name=[frame, iframe], :name=LeftTop}
 irb(main):023:0 lb = l.frame(:name, 'LeftBottom')
 = #Watir::Frame:0x19ca55c6 located=false 
 specifiers={:tag_name=[frame, iframe], :name=LeftBottom}
 irb(main):024:0 lb.button(:id, 'exitButton').exist?
 = true
 irb(main):025:0 lb.button(:id, 'exitButton').click_no_wait
 = 
 irb(main):026:0 lb.button(:id, 'exitButton').click
 *[Manually clicked Ok button on javascript dialog]*
 = 0.065006 
 irb(main):027:0


 When I run from my framework you can see a flash (looks like a cmd 
 window for a split second) as if the button is clicked (click_no_wait) but 
 the javascript dialog box does not appear as it did with watir versions 
 prior to 1.7.1.
 Running from IRB as above I do not see that flash.
 If I do a button.click the dialog box appears and blocks the script.
   
 Looking at the Ruby source there is not a click_no_wait method in 
 element.rb but the method is being called otherwise I would get a no 
 method 
 exception.

 Am I missing something here?

 thanks
 - paul


 On Friday, 5 October 2012 22:18:46 UTC+13, Jarmo Pertman wrote:

 I can't see Watir 4.0 in your gemlist. Can you show us minimal example 
 of your code, which fails (e.g. require statements, browser 
 initialization)?

 Jarmo Pertman
 -
 IT does really matter - http

[wtr-general] Re: Watir - Problem with pop up in IE9

2012-10-11 Thread Jarmo Pertman
It seems to be some different popup when you read the texts. I'm suspecting 
that in IE9 this is not a regular JavaScript confirm popup.

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

On Thursday, October 11, 2012 5:31:11 AM UTC+3, Paul wrote:


 https://lh4.googleusercontent.com/-MTUdBOfenBs/UHYvWQx8_CI/AAc/kI-LT-cE9PQ/s1600/IMG_11102012_151226.png
 For some reason my images of the popups did not save, attaching instead.

 On Thursday, 11 October 2012 15:26:08 UTC+13, Paul wrote:


 Hi, we have this popup in IE 8 and browser.alert.ok will work well.

 In IE9 the popup has changed to this:


 browser.alert.exists?
  true

 browser.alert.close
 - minimises the popup

 browser.alert.ok
 - nothing

 I have tried some suggestions from the web like overriding the 
 javascript, sending keystrokes ('l' as in alt + l) and various other things.

 Does anyone have a solution?

 I am using ruby 1.9.2 and watir-classic 3.2.0. I don't want to move to 
 webdriver as it does not have attach().

 Regards



-- 
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 no worky on Ruby 1.9.3

2012-10-10 Thread Jarmo Pertman
Can you try if changing \\ in that #click_no_wait command to / instead 
will make any difference. I can see this entry in that command:
C:\\Users\\pauld\\workspace\\SopranoMedicalRecords\\AutomatedTests\\med_rec\\

Let us know of your results.

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


On Tuesday, October 9, 2012 6:29:16 AM UTC+3, Paul wrote:

 Edited subject to click_no_wait no worky on Ruby 1.9.3

 On Monday, 8 October 2012 10:57:02 UTC+13, Paul wrote:

 Here is my ruby version and gem list (after re-installing Ruby 1.9.3 and 
 gems):

 C:\Users\pauld\workspace\SopranoMedicalRecords\AutomatedTests\med_rec\testsruby
  
 -v
 ruby 1.9.3p194 (2012-04-20) [i386-mingw32]

 C:\Users\pauld\workspace\SopranoMedicalRecords\AutomatedTests\med_rec\testsgem
  
 list

 *** LOCAL GEMS ***

 addressable (2.3.2)
 bigdecimal (1.1.0)
 builder (3.1.3)
 childprocess (0.3.5)
 commonwatir (4.0.0)
 ffi (1.1.5 x86-mingw32)
 hoe (3.1.0)
 io-console (0.3)
 json (1.5.4)
 libwebsocket (0.1.5)
 mini_magick (3.2.1)
 minitest (2.5.1)
 multi_json (1.3.6)
 nokogiri (1.5.5 x86-mingw32)
 rake (0.9.2.2)
 rautomation (0.7.2)
 rdoc (3.9.4)
 ruby-oci8 (2.1.2 x86-mingw32)
 rubyzip (0.9.9)
 s4t-utils (1.0.4)
 selenium-webdriver (2.25.0)
 subexec (0.0.4)
 sys-proctable (0.9.1 universal-mingw32)
 user-choices (1.1.6.1)
 watir (4.0.0 x86-mingw32)
 watir-classic (3.2.0)
 watir-webdriver (0.6.1)
 win32-api (1.4.8 x86-mingw32)
 win32-process (0.7.0)
 win32screenshot (1.0.7)
 windows-api (0.4.2)
 windows-pr (1.2.2)
 xml-simple (1.1.1)
 yajl-ruby (1.1.0 x86-mingw32)

 Here is an IRB session, the button to click is deep within some frames. 

 irb(main):014:0 require 'rubygems'
 = true
 irb(main):015:0 require 'watir-classic'
 = true
 irb(main):016:0 b = Watir::Browser.attach :url, /concerto/
 = #Watir::IE:0x..f953476 url=
 http://chch-medsrec-vm04/concerto/Concerto.htm; title=Concerto - 
 Example Clinician
 irb(main):017:0 cc = b.frame(:id, 'ConcertoContext')
 = #Watir::Frame:0x7a30ef0e located=false 
 specifiers={:tag_name=[frame, iframe], :id=ConcertoContext}
 irb(main):018:0 ca = cc.frame(:id, 'ConcertoApplication')
 = #Watir::Frame:0x750f406 located=false 
 specifiers={:tag_name=[frame, iframe], :id=ConcertoApplication}
 irb(main):019:0 eds = ca.frame(:name, 'EDSMain')
 = #Watir::Frame:0x..f91b2c866 located=false 
 specifiers={:tag_name=[frame, iframe], :name=EDSMain}
 irb(main):020:0 r = eds.frame(:name, 'Right')
 = #Watir::Frame:0x..f8e09a25e located=false 
 specifiers={:tag_name=[frame, iframe], :name=Right}
 irb(main):021:0 l = eds.frame(:name, 'Left')
 = #Watir::Frame:0x3d17c2c6 located=false 
 specifiers={:tag_name=[frame, iframe], :name=Left}
 irb(main):022:0 lt = l.frame(:name, 'LeftTop')
 = #Watir::Frame:0x..f860f0e9e located=false 
 specifiers={:tag_name=[frame, iframe], :name=LeftTop}
 irb(main):023:0 lb = l.frame(:name, 'LeftBottom')
 = #Watir::Frame:0x19ca55c6 located=false 
 specifiers={:tag_name=[frame, iframe], :name=LeftBottom}
 irb(main):024:0 lb.button(:id, 'exitButton').exist?
 = true
 irb(main):025:0 lb.button(:id, 'exitButton').click_no_wait
 = 
 irb(main):026:0 lb.button(:id, 'exitButton').click
 *[Manually clicked Ok button on javascript dialog]*
 = 0.065006 
 irb(main):027:0


 When I run from my framework you can see a flash (looks like a cmd window 
 for a split second) as if the button is clicked (click_no_wait) but the 
 javascript dialog box does not appear as it did with watir versions prior 
 to 1.7.1.
 Running from IRB as above I do not see that flash.
 If I do a button.click the dialog box appears and blocks the script.
   
 Looking at the Ruby source there is not a click_no_wait method in 
 element.rb but the method is being called otherwise I would get a no method 
 exception.

 Am I missing something here?

 thanks
 - paul


 On Friday, 5 October 2012 22:18:46 UTC+13, Jarmo Pertman wrote:

 I can't see Watir 4.0 in your gemlist. Can you show us minimal example 
 of your code, which fails (e.g. require statements, browser initialization)?

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


 On Friday, October 5, 2012 12:13:22 AM UTC+3, Paul wrote:

 Here is my gem list:

 C:\Ruby193\lib\ruby\gems\1.9.1\gemsgem list

 *** LOCAL GEMS ***

 addressable (2.3.2)
 bigdecimal (1.1.0)
 builder (3.1.3)
 childprocess (0.3.5)
 commonwatir (4.0.0, 3.0.0)
 ffi (1.1.5 x86-mingw32)
 hoe (3.1.0)
 io-console (0.3)
 json (1.5.4)
 libwebsocket (0.1.5)
 mini_magick (3.2.1)
 minitest (2.5.1)
 multi_json (1.3.6)
 nokogiri (1.5.5 x86-mingw32)
 rake (0.9.2.2)
 rautomation (0.7.2)
 rdoc (3.9.4)
 ruby-oci8 (2.1.2 x86-mingw32)
 rubyzip (0.9.9)
 s4t-utils (1.0.4)
 selenium-webdriver (2.25.0)
 subexec (0.0.4)
 sys-proctable (0.9.1 universal-mingw32)
 test-unit (2.5.2)
 user-choices (1.1.6.1)
 watir-classic (3.2.0)
 watir-webdriver (0.6.1)
 win32-api (1.4.8 x86-mingw32)
 win32-process (0.7.0)
 win32screenshot (1.0.7)
 windows-api (0.4.2)
 windows-pr (1.2.2)
 xml-simple (1.1.1)
 yajl

[wtr-general] Re: Ruby interpreter (GUI) 1.8.6 [i386-mswin32] has stopped working

2012-10-10 Thread Jarmo Pertman
On Monday, October 8, 2012 3:48:40 PM UTC+3, Ste wrote:

 Do you think that this update will require a big effort in terms of 
 script source refactoring? 


It depends of what parts of API have you been using. Refer to changelog at 
https://github.com/watir/watir-classic/blob/master/CHANGES to see if 
there's many parts in your scripts which might get hit. If you've been 
using :index as a locator too much then that will be the biggest hit i'm 
afraid - in newer versions of Watir index is 0-based. You can however use 
an option, which might be removed in some future versions, to use 1-based 
indexing until you've comfortable to decrement all your indexes by one in 
scripts. 

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

-- 
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 no worky on watir-classic 3.2.0

2012-10-08 Thread Jarmo Pertman
What is the exact crash message when you run the command printed out by 
$DEBUG on your command line?

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


On Monday, October 8, 2012 6:36:41 AM UTC+3, Paul wrote:

 Ok, does no crash on my VM so its something to do with my PC environment.

 On Monday, 8 October 2012 16:17:00 UTC+13, Paul wrote:

 I see now that click_no_wait is run from method_missing in element.rb.

 I turned on DEBUG, grabbed the spawned process command and ran it at the 
 command prompt.

 ruby -e 
 $:.unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/win32ole/1.9.3').unshift('C:\\Users\\pauld\\workspace\\SopranoMedicalRecords\\AutomatedTests\\med_rec\\').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5-x86-mingw32/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/win32-process-0.7.0/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/win32-api-1.4.8-x86-mingw32/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/windows-api-0.4.2/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/windows-pr-1.2.2/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.5-x86-mingw32/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.7.2/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/xml-simple-1.1.1/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/hoe-3.1.0/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/s4t-utils-1.0.4/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/builder-3.1.3/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/user-choices-1.1.6.1/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/yajl-ruby-1.1.0-x86-mingw32/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/subexec-0.0.4/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/mini_magick-3.2.1/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/win32screenshot-1.0.7/lib').unshift('c:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib').unshift('c:/Ruby193/lib/ruby/site_ruby/1.9.1').unshift('c:/Ruby193/lib/ruby/site_ruby/1.9.1/i386-msvcrt').unshift('c:/Ruby193/lib/ruby/site_ruby').unshift('c:/Ruby193/lib/ruby/vendor_ruby/1.9.1').unshift('c:/Ruby193/lib/ruby/vendor_ruby/1.9.1/i386-msvcrt').unshift('c:/Ruby193/lib/ruby/vendor_ruby').unshift('c:/Ruby193/lib/ruby/1.9.1').unshift('c:/Ruby193/lib/ruby/1.9.1/i386-mingw32');require
  
 'c:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.2.0/lib/watir-classic/core';Watir::Button.new(Watir::IE.attach(:hwnd,
  
 922786).frame({:tag_name=['frame', 'iframe'], :id='viewIFRAME'}), 
 :tag_name = Array.new  'button'  'submit'  'image'  'reset', 
 :unique_number = 1).click!();



 Again so we can see all the info:




 Looks like that process is crashing. Anyone else have that problem? Maybe 
 it is something with my environment - will set up a VM and try that.

 I will keep debugging this, it is crucial I solve this. I am handing over 
 the framework I wrote to my collegues as I start a new job next week.

 Any help is appreciated.

 On Friday, 5 October 2012 09:52:31 UTC+13, Paul wrote:

 Hi, I have just upgraded my framework to 1.9.3 and watir 4.0, I am using 
 watir-classic 3.2.0. I have been using click_no_wait but now it does not 
 work and I can't find the method in the source. element.rb no longer has 
 this method!

 If I can't solve this I will try to patch it in or downgrade watir.

 - thanks



-- 
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 framework using method_missing and ghost methods

2012-10-08 Thread Jarmo Pertman
Hi!

Thanks for sharing, maybe someone finds it helpful :)

I have a question though - why do you need to climb up in the DOM to get 
the latest elements? Are you seeing some errors if you don't do that? Is 
Watir caching too much for you?

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


On Monday, October 8, 2012 3:36:19 AM UTC+3, Paul wrote:

 This is not a question but a share of my latest Watir framework engine 
 code using metaprogramming.

 In the app under test there are a lot of deeply nested frames and divs, in 
 addition there is lots of javascipt and Ajax going on that can change page 
 layouts often.
 Every call to a Watir method should step up the DOM stack (actually a tree 
 but I will logically call it a stack) to Browser to ensure we have the 
 latest handles on all elements.

 For example:
   def context__frame
 @browser.frame(:name, 'Context')
   end
   def application__frame
 context__frame.frame(:name, 'Application')
   end
   def main__frame
 application__frame.frame(:name, 'Main')
   end
   def main__div
 main__frame.div(:id, 'Main')
   end

 A call to main__div() calls main_frame() that calls application__frame() 
 that calls context__frame().

 All good, but I should extract out the watir how, what info to a single 
 source. I created hashes of the how whats:

 @elements = {
   :context__frame   = {:how = :name, :what = 'Context'},
   :application__frame   = {:how = :name, :what = 'Application'},
   :main__frame  = {:how = :name, :what = 'Main'},
   :main__div= {:how = :id, :what = 'Main'},
 }

 Now the methods look like this:
   def context__frame
 field = @elements[:context__frame]
 @browser.frame field[:how], field[:what]
   end
   def application__frame
 field = @elements[:application__frame]
 context__frame.frame field[:how], field[:what]
   end
   def main__frame
 field = @elements[:main__frame]
 application__frame.frame field[:how], field[:what]
   end
   def main__div
 field = @elements[:main__div]
 main__frame.div field[:how], field[:what]
   end

 The concept here is that each method up the stack represents the container 
 of the caller.
 Note the method names are the same as the hash keys.
 This is a trivial example, but you get the picture, I ended up with 50 or 
 so methods that look essentially the same, and more would be added all the 
 time.

 Bring on method_missing and ghost methods. All I needed to do is add the 
 container of each element to my hash (@elements in this case). The hash now 
 looks like this:

 @elements = {
   :context__frame   = {:how = :name, :what = 'Context'},
   :application__frame   = {:who = :context__frame, :how = :name, 
 :what = 'Application'},
   :main__frame  = {:who = :application__frame, :how = 
 :name, :what = 'Main'},
   :main__div= {:who = :main__frame, :how = :id, :what 
 = 'Main'},
 }

 Now I have the who as well as the how and what.
 Next I wrote the method_missing and the handler method:

   def method_missing(method, *args, block)
 if method.to_s =~ /__(\w+)$/
   get_field_how_what($1.to_sym, method.to_sym)
 else
   super # let Ruby continue with method lookup
 end
   end
  
   def get_field_how_what(watir_method, method_key)
 container = @elements[method_key][:who]
 how = @elements[method_key][:how]
 what = @elements[method_key][:what]
  
 # if the method exists - call it
 if self.respond_to? container
   # method exists
   element = method(container).call
 else
   # method not exist
   element = self.send :method_missing, container
 end
 # parent element exists - call the watir method on it
 element.method(watir_method).call how, what
   end

 Then I deleted all the methods (in this example main__div(), main_frame() 
 and application__frame()) but left context__frame() as it is the top level 
 method that uses @browser.

 This works by using 'ghost methods', methods that do not exist until you 
 define them at runtime.
 In method_missing() I catch any missing method that ends with __frame, 
 __div, __button, etc, and pass these off to get_field_how_what().
 I know the watir method to call from the regex match on the missing method 
 name. 

 Using the method name I can access the global hash of all the fields 
 (@elements) and know what the parent container is (:who) and how to access 
 the element (:how, :what).
 If the parent container method exists, I call it, returning the parent 
 element.
 If the container method does not exist, I call method_missing again with 
 the container (:who). 
 This gets done repeatedly until we get to the top level method, then each 
 parent is returned, effectively moving back down the stack to the element 
 we want.

 I have created an example that hits the Ruby web site and accesses some 
 elements:

 require 'rubygems'
 require 'watir-classic'

 class

[wtr-general] Re: Ruby interpreter (GUI) 1.8.6 [i386-mswin32] has stopped working

2012-10-06 Thread Jarmo Pertman
Oh, right, you're also using very old version of Watir, which didn't even 
need ffi. In that case i don't even have any ideas what to think about the 
whole situation :(

Watir and #click_no_wait code itself have changed quite much from that 
version, which means that you might have encountered some bug, which exists 
with some combos.

I can only recommend you to upgrade Ruby and then Watir. Upgrading Ruby 
should be easier process than Watir. At least i don't notice any gems on 
your list which might cause problems.

Give it a try, that's all i can say.

J.

On Friday, October 5, 2012 12:42:07 PM UTC+3, Ste wrote:

 Hi Jarmo, 

 thanks for your answer. I saw that ffi requires Ruby version = 1.9.2, 
 but I have 1.8.6. The win32-process we have tried are 0.6.2, 0.5.3, 
 but it still does't work. The following is the complete list of 
 installed gems. 
 I can provide you more information, please let me know 

 Thanks in advance 

 Stefano 


 *** LOCAL GEMS *** 

 activesupport (2.3.5) 
 builder (2.1.2) 
 commonwatir (1.6.5) 
 firewatir (1.6.5) 
 fxri (0.3.6) 
 fxruby (1.6.12) 
 hoe (2.6.0) 
 hpricot (0.6) 
 json_pure (1.2.4) 
 log4r (1.0.5) 
 nokogiri (1.4.1) 
 ocra (1.1.3, 1.1.2) 
 parseconfig (0.0.1) 
 rake (0.8.7, 0.7.3) 
 ruby-oci8 (1.0.7, 1.0.5) 
 rubyforge (2.0.4) 
 rubygems-update (1.3.6) 
 s4t-utils (1.0.4) 
 user-choices (1.1.6.1) 
 watir (1.6.5) 
 win32-api (1.4.6, 1.0.4) 
 win32-clipboard (0.4.3) 
 win32-dir (0.3.2) 
 win32-eventlog (0.4.6) 
 win32-file (0.5.4) 
 win32-file-stat (1.2.7) 
 win32-process (0.6.2, 0.5.3) 
 win32-sapi (0.1.4) 
 win32-sound (0.4.1) 
 windows-api (0.4.0, 0.2.0) 
 windows-pr (1.0.9, 0.7.2) 
 xml-simple (1.0.12) 

 On 5 Ott, 11:17, Jarmo Pertman jarm...@gmail.com wrote: 
  You could try different FFI version or win32-process versions. 
  Unfortunately there's not much information provided by you to guess 
  anything more. 
  
  Jarmo Pertman 
  - 
  IT does really matter -http://itreallymatters.net 
  
  
  
  On Thursday, October 4, 2012 12:56:50 PM UTC+3, Ste wrote: 
  
   Hi, 
  
   I have changed the environment of our automated tests harness based on 
   Watir. The new environment (seemingly) has the same features of the 
   previsous one (Windows Server 2008, IE 8). In previous one Ruby/Watir 
   works fine. Now we have the problem in appendix a this email, never 
   experienced before. The problem seems tied to clicking modal dialog 
   (clic_no_wait) 
  
   We are comparing the internet options but they are same between both 
   environments. 
  
   Do you have any idea? (I know that the version of Ruby is old but it 
   workded fine until now). I saw that other people had the same problem, 
   but I have no found a workaround, yet. 
  
   Thanks in advance 
  
   Stefano 
  
 Problem signature: 
 Problem Event Name:APPCRASH 
 Application Name:rubyw.exe 
 Application Version:1.8.6.0 
 Application Timestamp:470624bd 
 Fault Module Name:msvcrt-ruby18.dll 
 Fault Module Version:1.8.6.0 
 Fault Module Timestamp:470624bc 
 Exception Code:4015 
 Exception Offset:00026644 
 OS Version:6.1.7601.2.1.0.16.7 
 Locale ID:1033 
 Additional Information 1:ae47 
 Additional Information 2:ae478bf014838a6fa0309e6e83d2de6a 
 Additional Information 3:0df2 
 Additional Information 4:0df2c6d65cc6052e6a4e93596e7f7eab 
  
   Read our privacy statement online: 
http://go.microsoft.com/fwlink/?linkid=104288clcid=0x0409 
  
   If the online privacy statement is not available, please read our 
   privacy statement offline: 
 C:\Windows\system32\en-US\erofflps.txt- Nascondi testo citato 
  
  - Mostra testo citato - 


-- 
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: Ruby interpreter (GUI) 1.8.6 [i386-mswin32] has stopped working

2012-10-05 Thread Jarmo Pertman
You could try different FFI version or win32-process versions. 
Unfortunately there's not much information provided by you to guess 
anything more.

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


On Thursday, October 4, 2012 12:56:50 PM UTC+3, Ste wrote:

 Hi, 

 I have changed the environment of our automated tests harness based on 
 Watir. The new environment (seemingly) has the same features of the 
 previsous one (Windows Server 2008, IE 8). In previous one Ruby/Watir 
 works fine. Now we have the problem in appendix a this email, never 
 experienced before. The problem seems tied to clicking modal dialog 
 (clic_no_wait) 

 We are comparing the internet options but they are same between both 
 environments. 

 Do you have any idea? (I know that the version of Ruby is old but it 
 workded fine until now). I saw that other people had the same problem, 
 but I have no found a workaround, yet. 

 Thanks in advance 

 Stefano 

   Problem signature: 
   Problem Event Name:APPCRASH 
   Application Name:rubyw.exe 
   Application Version:1.8.6.0 
   Application Timestamp:470624bd 
   Fault Module Name:msvcrt-ruby18.dll 
   Fault Module Version:1.8.6.0 
   Fault Module Timestamp:470624bc 
   Exception Code:4015 
   Exception Offset:00026644 
   OS Version:6.1.7601.2.1.0.16.7 
   Locale ID:1033 
   Additional Information 1:ae47 
   Additional Information 2:ae478bf014838a6fa0309e6e83d2de6a 
   Additional Information 3:0df2 
   Additional Information 4:0df2c6d65cc6052e6a4e93596e7f7eab 

 Read our privacy statement online: 
   http://go.microsoft.com/fwlink/?linkid=104288clcid=0x0409 

 If the online privacy statement is not available, please read our 
 privacy statement offline: 
   C:\Windows\system32\en-US\erofflps.txt 


-- 
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 no worky on watir-classic 3.2.0

2012-10-05 Thread Jarmo Pertman
I can't see Watir 4.0 in your gemlist. Can you show us minimal example of 
your code, which fails (e.g. require statements, browser initialization)?

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


On Friday, October 5, 2012 12:13:22 AM UTC+3, Paul wrote:

 Here is my gem list:

 C:\Ruby193\lib\ruby\gems\1.9.1\gemsgem list

 *** LOCAL GEMS ***

 addressable (2.3.2)
 bigdecimal (1.1.0)
 builder (3.1.3)
 childprocess (0.3.5)
 commonwatir (4.0.0, 3.0.0)
 ffi (1.1.5 x86-mingw32)
 hoe (3.1.0)
 io-console (0.3)
 json (1.5.4)
 libwebsocket (0.1.5)
 mini_magick (3.2.1)
 minitest (2.5.1)
 multi_json (1.3.6)
 nokogiri (1.5.5 x86-mingw32)
 rake (0.9.2.2)
 rautomation (0.7.2)
 rdoc (3.9.4)
 ruby-oci8 (2.1.2 x86-mingw32)
 rubyzip (0.9.9)
 s4t-utils (1.0.4)
 selenium-webdriver (2.25.0)
 subexec (0.0.4)
 sys-proctable (0.9.1 universal-mingw32)
 test-unit (2.5.2)
 user-choices (1.1.6.1)
 watir-classic (3.2.0)
 watir-webdriver (0.6.1)
 win32-api (1.4.8 x86-mingw32)
 win32-process (0.7.0)
 win32screenshot (1.0.7)
 windows-api (0.4.2)
 windows-pr (1.2.2)
 xml-simple (1.1.1)
 yajl-ruby (1.1.0 x86-mingw32)

 On Friday, 5 October 2012 09:52:31 UTC+13, Paul wrote:

 Hi, I have just upgraded my framework to 1.9.3 and watir 4.0, I am using 
 watir-classic 3.2.0. I have been using click_no_wait but now it does not 
 work and I can't find the method in the source. element.rb no longer has 
 this method!

 If I can't solve this I will try to patch it in or downgrade watir.

 - thanks



-- 
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: Check to see if a dropdown list contains a value

2012-10-05 Thread Jarmo Pertman
b.select(:id, title).include?('Mr') should work, but it might not because 
of this https://github.com/watir/watir-classic/issues/43

Let me know of your results.

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

On Friday, October 5, 2012 11:42:07 AM UTC+3, Adrian Killens wrote:

 How would I check to see if a dropdown list contained a specific value? So 
 the test would be something along the lines of:

 if *select box contains the value MR*
 *   b.select(:id, title).select('Mr')
 *



-- 
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: Get select list text

2012-10-02 Thread Jarmo Pertman
You can do something like this:
select_list = b.select_list(:name = 'xxx')
select_list.option(:value = select_list.value).text

Or a different solution in one line:
b.select_list(:name = 'xxx').selected_options[0].text

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


On Monday, October 1, 2012 8:45:53 PM UTC+3, enroxorz wrote:

 I am having the following issue. The API changes for SelectList has 
 changed, and caused one of our scripts to fail.

 Before 3.0 changed

 select name=xxx size=1 
 option value=1 selected=selectedXXX/option 
 option value=2YYY/option 
 option value=3ZZZ/option 
 /select 

  b.select_list(:name = 'xxx').value
XXX
  
 After 3.0 changes

 select name=xxx size=1 
 option value=1 selected=selectedXXX/option 
 option value=2YYY/option 
 option value=3ZZZ/option 
 /select 

  b.select_list(:name = 'xxx').value
1

 How can I get the value as if it were before the 3.0 changes?


-- 
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 ternary operator with Watir

2012-10-02 Thread Jarmo Pertman
Or even
result.click if result

But i would drop the #find call also and use just Watir API:
result = @browser.table(:index, 3).link(:text = link_name)
result.click if result.exists?

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


On Tuesday, October 2, 2012 6:47:30 AM UTC+3, Oscar.Rieken wrote:


 http://railstips.org/blog/archives/2008/12/01/unless-the-abused-ruby-conditional/

 if result
   result.click
 end 


 On Mon, Oct 1, 2012 at 3:57 PM, John Fitisoff jfit...@yahoo.comjavascript:
  wrote:

 Here's another way that might work:

 #This should return either an object or nil
 result = @browser.table(:index, 3).links.find {|tr| tr.text == link_name}
 result.click unless result.nil? 



   --
 *From:* Joe Fl joefl...@gmail.com javascript:
 *To:* watir-...@googlegroups.com javascript: 
 *Sent:* Monday, October 1, 2012 11:16 AM
 *Subject:* [wtr-general] Using ternary operator with Watir
  
 Hi everyone,

 I am experimenting with the ruby and I would like to know if I could 
 include a 'break' in the loop below once the link
 is clicked.

 I have tried a couple of ideas but they just ended in a syntax error.

 @browser.table(:index,3).links.each{|tr| puts tr.text == link_name ? 
 (@browser.a(:text,tr.text).click) : (puts Not fiond)}

 Any help would be greatly appreciated.

 Thank you,
 Joe
  -- 
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
  
 watir-...@googlegroups.com javascript:
 http://groups.google.com/group/watir-general
 watir-genera...@googlegroups.com javascript:


   -- 
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
  
 watir-...@googlegroups.com javascript:
 http://groups.google.com/group/watir-general
 watir-genera...@googlegroups.com javascript:




-- 
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: Unable to click buttons in the pop-up when the machine is locked

2012-10-02 Thread Jarmo Pertman
You could also try to monkey patch RAutomation as described in this issue:
https://github.com/jarmo/RAutomation/issues/28

Maybe it helps, i haven't tried.

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


On Tuesday, October 2, 2012 3:37:11 PM UTC+3, enroxorz wrote:

 Have you looked at this?

 http://watirwebdriver.com/javascript-dialogs/

 The latter portion will work with 3.0.0 (3.1.0 and higher will need to use 
 the former).

 Also, if you are planning on using 3.1 or 3.2 in the future look at this 
 post for an odd caveat that I found with Javascript Dialog Boxes and 
 onclick events for buttons:

 https://groups.google.com/d/topic/watir-general/KeuVqLLmOig/discussion

 One last thing. Locking windows causes more headaches than its worth. Do 
 you need your windows session to be locked? If not than leave it open. If 
 it is a VM and you RDP into that VM, dont RDP. Use a VNC or something else 
 instead because once you leave your RDP session it locks.

 Hope this helps.

 On Monday, October 1, 2012 9:46:42 PM UTC-4, praveen kumar wrote:

 Watir 3.0.0

 On Tuesday, October 2, 2012 1:27:55 AM UTC+5:30, enroxorz wrote:

 What version of Watir are you using? 

 On Monday, October 1, 2012 2:26:35 AM UTC-4, praveen kumar wrote:

  Hi All,

 There is a javascript pop-up. I am handling as shown below. It is 
 working fine only if that window is enabled. 

 If the machine is locked or moving to the another window while 
 execution. Its not working. Is there any way to focus that window after 
 pop 
 up is enabled.

 $ie.wait_until{$ie.javascript_dialog.button('OK').enabled?}
  $ie.javascript_dialog.button('OK').click

 Please let me know your thoughts.

 Thanks,
 Praveen



-- 
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-Classic does not close Javascript Dialog when button onclick event fired

2012-09-30 Thread Jarmo Pertman
Yes, you should use #click_no_wait together with Watir Alert API (
http://watirwebdriver.com/javascript-dialogs/)

In your case:
require 'watir-classic'
b = Watir::Browser.new
b.goto 'file:///c:/test.html'
b.button(:value = Press).click_no_wait
b.alert.ok

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


On Sunday, September 30, 2012 7:27:07 PM UTC+3, enroxorz wrote:

 When I do the following, the Javascript Dialog does not close (in fact, 
 the button click is stuck and does not go any further). Is there a work 
 around?

 irb(main):001:0 require 'watir-classic'
 irb(main):002:0 b = Watir::Browser.new
 irb(main):003:0 b.goto 'file:///c:/test.html'
 irb(main):004:0 b.button(:value = Press).click

 Watir 3.2.0
 Ruby 1.9.3


-- 
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 slow performance on a remote selenium grid2

2012-09-25 Thread Jarmo Pertman
One solution would be to use the alternative method described 
at http://watirwebdriver.com/javascript-dialogs/

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

On Friday, September 21, 2012 11:28:30 AM UTC+3, Željko Filipin wrote:

 I would suggest that you send this to wtr-dev...@rubyforge.orgjavascript:

 Željko
 --
 filipin.eu 


 On Fri, Sep 21, 2012 at 1:42 AM, Thien-An Mac thien...@gmail.comjavascript:
  wrote:

 I have started to point my cucumber/watir-webdriver test suites on our 
 remote grid (hosted on another server, in a different physical location) 
 and the performance is quite dreadful compared to a local grid (ie i'm 
 executing my cucumber scripts on the same machine as the grid). The 
 performance went from 8 minutes to over 40 minutes (both runs our script in 
 parallel)! I did a bit of digging and it seems that the reason why it's so 
 slow is that there is a significant delay when i'm filling out my webforms. 
 Oddly enough, when i run the same scenario, but using webdriver, the 
 performance went decrease by alot.

 Here are the two sample scripts I'm using to compare (both doing a simple 
 google search) with a rather complex timing system

 watir:

 require 'rubygems'
 require 'watir-webdriver'
 browser = Watir::Browser.new(:remote, :url = remote_grid_url)
 browser.goto www.google.com
 now = Time.now.to_f
 browser.text_field(:name = q).set We the People
 endd = Time.now.to_f
 browser.button(:name = btnG).click

 delta =  endd - now
 browser.close

 puts Took :  + delta.to_s

 watir:
 require 'rubygems'
 require 'selenium-webdriver'
 browser = Selenium::WebDriver.for(:remote, :url = remote_grid_url)
 browser.get http://www.google.com;
 now = Time.now.to_f
 browser.find_element(:name = q).send_keys We the People
 endd = Time.now.to_f
 browser.find_element(:name = btnG).click
 delta =  endd - now
 puts Took :  + delta.to_s

 As you can see both scripts capture the time it takes to find the element 
 and populate it. I ran both scripts seperately, and on average, the 
 webdriver takes 1 second to find and populate, and watir takes 3 seconds, 
 which is 3x more!

 Is there a special setting i need on the grid to make it faster or do i 
 need to optimize my locators (ie find the div, then the child element)?
  

 -- 
 Before posting, please read http://watir.com/support. In short: search 
 before you ask, be nice.
  
 watir-...@googlegroups.com javascript:
 http://groups.google.com/group/watir-general
 watir-genera...@googlegroups.com javascript:




-- 
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] Would like to use other attribute_value as element identifier...but how?

2012-09-22 Thread Jarmo Pertman
There is also support for html5 data-* attributes:
browser.div(:data_id = '32143').click
browser.div(:data_column = '2' , :data-row = '6')

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


On Friday, September 21, 2012 9:16:03 PM UTC+3, Željko Filipin wrote:

 On Fri, Sep 21, 2012 at 7:06 PM, RJ rj41...@gmail.com javascript: 
 wrote:
  browser.div(:data-id = '32143').click

 Watir has support for css selectors. Something like this:

 browser.element(:css = div[data-id='32143']).click

 Željko
 --
 filipin.eu 


-- 
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: Unable to locate element, using {:tag_name=[checkbox]

2012-09-21 Thread Jarmo Pertman
Your if statement is wrong:
if cell.hidden(:value, DOE, JOHN)

This is always true since it will return a HiddenElement instance. Add 
#exists? as an additional check like this and see if there's any difference:
if cell.hidden(:value, DOE, JOHN).exists?

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


On Tuesday, September 18, 2012 7:38:58 AM UTC+3, glenn71 wrote:

 Hi All,

 I have hit a problem with finding a checkbox inside a table cell. I am 
 able to find a hidden input in the same cell but not the checkbox. Any 
 ideas on what I might be doing wrong?

 *Error:* Unable to locate element, using {:tag_name=[checkbox], 
 :index=1} (Watir::Exception::UnknownObjectException)

 *HTML Snippet:*
 tr
 td class=tableHeadTime Due/td
 td class=tableHeadNext Due/td
 /tr
 tr class=odd valign=top
 td align=center class=rightBorder bottomBorder valign=middleinput 
 type=checkbox id=cbPerson1 name=cbPerson1 
 value={604E310A-3895-4814-94F2-255363CBB737} 
 onclick=updateSelectedCount(this, 1) index=1input type=hidden 
 id=patientName1 name=patientName1 value=DOE, JOHN disabledinput 
 type=hidden id=room1 name=room1 value= disabledinput 
 type=hidden id=bed1 name=bed1 value= disabled/td
 td align=center class=rightBorder bottomBorder 
 /td
 td align=center class=rightBorder bottomBorder 
 /td
 td align=center class=rightBorder bottomBordera 
 id=medChartSummaryIcon href=# onclick=tciOpenWindowModal(window, 
 '../patient/SummaryMedChartDlg.asp?loadAlways=1amp;patientId={604E310A-3895-4814-94F2-255363CBB737}',
  
 -1, -1, 1000, 600) title=Show Medication Chart Summaryimg 
 class=alpha src=../MedChart/style/summaryMedChart.png/a/td
 td class=rightBorder bottomBorderDOE, JOHNbr0332430/td
 td class=rightBorder bottomBorder
 table cellpadding=0 cellspacing=0 width=100%
 tbody
 col width=23px class=tableCell
 col width=* class=tableCell style=font-weight : bold;
 tr
 tdimg src=../medChart/style/overdue.png class=locationImg alpha 
 style=vertical-align:middle/td
 td108 overdue  starting on 24/01/2012 
  at 08:00/td
 /tr


 *Code Snippet:
 *
   require 'watir'

   browser = Watir::IE.start(
 http://svhhatrixtest/medchart/user/MedChartFrame.asp?url=Login.asp;
   browser.frame(:id, medChartFrame).text_field(:name, 
 username).set(myuser)
   browser.frame(:id, medChartFrame).text_field(:name, 
 password).set(mypass)
   browser.frame(:id, medChartFrame).button(:value,Log In).click
   browser.frame(:id, medChartFrame).link(:id,administration).click
   browser.frame(:id, 
 medChartFrame).select_list(:name,locationId).option(:text, 3N).select

   browser.frame(:id, medChartFrame).table(:index, 1).rows.each do |row| 
 row.cells.each do |cell|
   if cell.hidden(:value, DOE, JOHN)
* cell.checkbox(:index,1).click  # this fails!!*
   end
 end
   end 




-- 
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 on Windows XP Pro Sp3 doesn't work

2012-09-15 Thread Jarmo Pertman
I can see that you've uninstalled win32-process too, but didn't touch ffi 
gem. If you're using win32-process -v 0.6.6 with watir-classic -v 3.1.0 
what happens?

What version of ffi are you using?

Jarmo

On Thursday, September 13, 2012 10:01:24 PM UTC+3, smile-on wrote:

 I have got exactly same error after upgrade watir (watir-classic) from 
 3.0.0 to latest and grates 3.1.0 :)
 After downgrade this problem has gone.

 downgrade steps:

 gem uninstall watir-classic -v 3.1.0
 gem install watir-classic -v 3.0.0
 gem uninstall win32-process -v 0.7.0
 gem install win32-process -v 0.6.6


 On Friday, 7 September 2012 17:49:04 UTC-4, Željko Filipin wrote:

 On Fri, Sep 7, 2012 at 5:15 PM, Emanuele Mandaglio e.gi...@gmail.com 
 wrote:
  ffi (1.1.5)
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/*watir-classic-3.1.0/*lib/watir-classic/browser.rb:89:in
   
 `eval': Function '_get_errno' not found in [msvcrt.dll] (FFI::NotFoundError)

 This looks like a problem with ffi gem. We had problems with that gem 
 before. Try upgrading or downgrading the gem. Let us know if you do not 
 know how to do that.

 Željko
 --
 filipin.eu 
  


-- 
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 on Windows XP Pro Sp3 doesn't work

2012-09-15 Thread Jarmo Pertman
Also, what is the error message when you use the following code:
browser = Watir::IE.new

Jarmo

On Saturday, September 15, 2012 9:48:38 PM UTC+3, Jarmo Pertman wrote:

 I can see that you've uninstalled win32-process too, but didn't touch ffi 
 gem. If you're using win32-process -v 0.6.6 with watir-classic -v 3.1.0 
 what happens?

 What version of ffi are you using?

 Jarmo

 On Thursday, September 13, 2012 10:01:24 PM UTC+3, smile-on wrote:

 I have got exactly same error after upgrade watir (watir-classic) from 
 3.0.0 to latest and grates 3.1.0 :)
 After downgrade this problem has gone.

 downgrade steps:

 gem uninstall watir-classic -v 3.1.0
 gem install watir-classic -v 3.0.0
 gem uninstall win32-process -v 0.7.0
 gem install win32-process -v 0.6.6


 On Friday, 7 September 2012 17:49:04 UTC-4, Željko Filipin wrote:

 On Fri, Sep 7, 2012 at 5:15 PM, Emanuele Mandaglio e.gi...@gmail.com 
 wrote:
  ffi (1.1.5)
  C:/Ruby193/lib/ruby/gems/1.9.1/gems/*watir-classic-3.1.0/*lib/watir-classic/browser.rb:89:in
   
 `eval': Function '_get_errno' not found in [msvcrt.dll] (FFI::NotFoundError)

 This looks like a problem with ffi gem. We had problems with that gem 
 before. Try upgrading or downgrading the gem. Let us know if you do not 
 know how to do that.

 Željko
 --
 filipin.eu 
  


-- 
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: IE click button issue on watir-webdriver

2012-09-01 Thread Jarmo Pertman
If you're not getting any errors and browser is closed after click then 
what's the problem? You're saying in your code to explicitly close the 
browser after click. Or am i misunderstanding anything?

Jarmo

On Thursday, August 30, 2012 6:21:20 AM UTC+3, Ernesto Cadario wrote:

 Hello, I have the same problem. Same config for all zones, explorer 9, 
 selenium-webdriver-2.25.0, watir-webdriver-0.6.1, Ruby 1.8.7. Chrome and FF 
 works well, but IE doesn,t.

 This is my test:

 require 'rubygems'
 require 'watir-webdriver'

 b = Watir::Browser.new :ie
 b.goto 'www.facebook.com'
 b.text_field(:id = 'email').set 'user'
 b.text_field(:id = 'pass').set 'pass'
 b.button(:type = 'submit').click
 b.text.include? 'some text'
 b.close

 and this is the log from ruby:

 ruby TestRuby2.rb
 Started InternetExplorerDriver server (32-bit)
 2.25.3.0
 Listening on port 
 [WARNING] MultiJson is using the default adapter (ok_json). We recommend 
 loading a different JSON library to improve performance.
 Exit code: 0

 When IE makes the click on the button, the server and browser close and 
 there are no errors.

 Somebody can help?

 Thanks!

 El martes, 17 de mayo de 2011 09:57:47 UTC-3, the_zonker escribió:

 Hi guys, 

 My working environment is watir-webdriver 0.2.3 and watir-selenium 
 0.2.0. 

 Working on automation of Web application I've faced with weird IE 
 behavior - in one particular case IE doesn't click on button. Indeed I 
 can see that browser moves focus on the button and press it but then 
 nothing happens. I can't see that application in any way reacts on 
 this pressing. 

 To press button I use: 
 browser.button(:value,XXX).click 


 I get no any errors, and I can found in RubyMine debugger that 
 element is properly located and can flash it. 
 And in the same case Firefox 3.6 works well. Also IE clicks well any 
 other buttons on my page. 

 The same issue is reproduced on the machine of my co-worker. 

 I appreciate any help. 

 Regards, Vadim 



-- 
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] No Assertion and testcase in watir-classic 3.1.0

2012-08-30 Thread Jarmo Pertman
It seems to me that you mean this commit:
https://github.com/watir/watir-classic/commit/aed96dc56d2def942142e07323c6f2b65d1e9920
 

I have to admit that i deleted these file half-accidentally since i thought 
that they were used by old watir's own unit tests. I have now reviewed 
contents of both of these files and still can't undelete those since they 
seem to be unnecessary in today's world where all Ruby test frameworks 
(test-unit, RSpec, minitest etc) have all the features and even more given 
by these files. I'd rather keep them deleted for avoiding newcomers to 
start using them instead of a proper test framework.

If you still need these then i can suggest you to get these files from the 
Git history and put them explicitly next to your tests and make them part 
of your test files so it would work for you like it did before. If you need 
any help with that then please ask.

Sorry if this causes any unconveniences to you.

On Tuesday, August 28, 2012 4:24:30 PM UTC+3, Željko Filipin wrote:

 On Tue, Aug 28, 2012 at 11:05 AM, AQUA manavk...@gmail.com javascript: 
 wrote:
  Whin I checked the change logs in GitHub, it mentions that 
 Watir::Assertion  is moved to assertion.rb file.

 And what is the problem? You can not find the file?

 Also, send us the link to the commit you are talking about.

 Željko
 --
 filipin.eu 
  

-- 
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 on Win7 x64 IE 9 - problems going to Yahoo

2012-08-24 Thread Jarmo Pertman
Works for me too with Ruby 1.9.3 win7 64bit using IE9:
C:\Users\jarmoirb
irb(main):001:0 require watir
= true
irb(main):002:0 Watir::VERSION
= 3.1.0
irb(main):003:0 b = Watir::Browser.new
= #Watir::IE:0x..f95e5d08e url=about:blank title=
irb(main):004:0 b.goto yahoo.com
= 3.320189
irb(main):005:0 b.goto facebook.com
= 1.739099

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


On Friday, August 24, 2012 2:10:29 PM UTC+3, Željko Filipin wrote:

 On Thu, Aug 23, 2012 at 11:22 PM, Chad Larkin 
 chadj...@gmail.comjavascript: 
 wrote:
  I do not have a Win7 32-bit machine with IE9 to test this on.  Wonder if 
 anyone else is able to reproduce this in a similar environment or can test 
 on Win7 32-bit with IE9.

 I have just booted into windows 7 32-bit with IE9.

 ruby 1.9.3p194 (2012-04-20) [i386-mingw32]

 commonwatir (3.0.0)
 watir (3.0.0)
 watir-classic (3.1.0)

 irb(main):001:0 require watir
 = true

 irb(main):002:0 browser = Watir::Browser.new
 = #Watir::IE:0x..fcd1d4bee url=about:blank title=

 irb(main):003:0 browser.goto yahoo.com
 = 3.822006

 There were no errors, yahoo page opened just fine.

 Željko
 --
 filipin.eu 
  

-- 
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 on Win7 x64 IE 9 - problems going to Yahoo

2012-08-22 Thread Jarmo Pertman
For some reason you're getting back a Fixnum with value of 4 from 
document.readyState call although it should be string. I'm using Ruby 1.9.3 
(you're on 1.9.2, maybe that makes that difference) and can get the correct 
readystate:
(rdb:1) doc.readyState
complete

complete means 4. Don't have any ideas why you're getting fixnum there.

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


On Wednesday, August 22, 2012 1:48:53 AM UTC+3, Chad Larkin wrote:

 I'm running into an interesting issue setting up a Watir env on Win7 x64 
 with IE9.  When using the goto statement in IRB to goto yahoo.com I am 
 getting an undefined method error.

 the steps in IRB are:
 require 'rubygems'
 require 'watir'
 $b=Watir::Browser.new
 $b.goto('http://www.yahoo.com')

 the error returned is:
 NoMethodError: undefined method `to_sym' for 4:Fixnum
 from 
 F:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
 lassic/ie-class.rb:542:in `block in wait'
 from F:/Ruby192/lib/ruby/1.9.1/timeout.rb:58:in `timeout'
 from 
 F:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
 lassic/ie-class.rb:520:in `wait'
 from 
 F:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
 lassic/ie-class.rb:365:in `goto'
 from (irb):4
 from F:/Ruby192/bin/irb:12:in `main'

 Any ideas?

 Thanks


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


  1   2   3   4   >