[wtr-general] Assigning Div content a Text Value
I need to assign a text value as the content of a Div, very similar to Watir gmail example except, I don't have an iframe, just a Div, here is the gmail example: # a body element. So, save the iframe in a var, then set the innerText # property of the iframe's body element. mail_body_frame = canvas_frame.frame(:index, 1) # TODO: there must be a friendlier way to do this, while still avoiding # hardcoding of any unfriendly identifiers. Does Watir need a body method? mail_body_frame.document.body.setproperty('innerText', mail_body_text) How do I accomplish the last part for a Div? body_div = ie.div(:id, 'EditorBody') body_div.setproperty('innerText', edit_content) -- this of course doesn't work ie.div(:id, 'EditorBody').set(edit_content) -- nor does this. I would appreciate any suggestions, I just got started with watir, what a great tool! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: there's something strange going on with a checkbox and radio on firewatir
I am still wondering, what is happening with this problem. No-one cares or is not able to verify this problem with my provided code? Is FireWatir broken or not? Anyway, I'd hope more activity on this issue, since that is one of the problems we're not running our tests on FireWatir and only on Watir. Thank you in advance, juuser. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: indexes with watir and firewatir
Hi, An example of the problem below ['watir', 'firewatir'].each { | g | require g } ie = Watir::IE.new ff = FireWatir::Firefox.new [ie, ff].each { |b| b.goto(http://www.google.com;) } ff.table(:index, 1).rows[0].html ie.table(:index, 1).rows[0].html Aidy On 28/11/2008, aidy lewis [EMAIL PROTECTED] wrote: Hi, Has anyone experienced index variations in Watir and FireWatir? This in FireWatir row.cell(:index, 0) Will be this in Watir row.cell(:index, 1) We think this is because Watir uses win32ole and FireWatir uses JavaScript. If this is a known and common bug, we will fix it. Aidy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] indexes with watir and firewatir
Hi, Has anyone experienced index variations in Watir and FireWatir? This in FireWatir row.cell(:index, 0) Will be this in Watir row.cell(:index, 1) We think this is because Watir uses win32ole and FireWatir uses JavaScript. If this is a known and common bug, we will fix it. Aidy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: how to handle javascript popups problem with firewatir
On Nov 26, 6:42 pm, Dave McNulla [EMAIL PROTECTED] wrote: On Nov 26, 1:00 am, Jarod Zhu [EMAIL PROTECTED] wrote: I am using firewatir-1.6.2 to make a web automation tool in my project. I come to the problem that I can't click the javascript popup OK button successfully. I use the code like this: *** *** browser.startClicker('ok', 20) browser.button(:id, 'confirm').click # pop the javascript window *** *** Actually, the code above make the javascript popup nerver appear, but the popup OK button is not clicked. So it just make the the javascript popup disabled. Anyone here know how to handle javascript popups with The general answer is don't use the javascript popups. I'd like to hear Paul Rodgers discuss alternatives to them in the podcast on Friday. Thanks in advance Dave oops. I meant Paul Rogers, the one that isn't in 'bad company'. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Click_no_wait for firewatir
Hi all, Does click_no_wait method exists in firewatir? I didn't found it in firewatir sorce files and it does not work in my tests. I use firewatir - 1.2.1 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Click_no_wait for firewatir
On 28/11/2008, al3kc [EMAIL PROTECTED] wrote: Hi all, Does click_no_wait method exists in firewatir? I didn't found it in firewatir sorce files and it does not work in my tests. I use firewatir - 1.2.1 Try something like this: def click_no_wait(object_name) $jssh_socket.send(browser.contentWindow.setTimeout(function() {document.forms[0].#{object_name}.click()},0);\n, 0) self.read_socket() end Aidy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Unable to execute assert method through Module
Thanks Aidy. Somehow its started working again. I took a old version of my working test scripts and merged them. So far so good :) Regards, Natasha aidy lewis [EMAIL PROTECTED] wrote: Natasha, Try putting this include in your module include Test::Unit::Assertions Bret wrote around this topic some time ago http://www.io.com/~wazmo/blog/archives/2006_05.html#000238 Aidy On 28/11/2008, Natasha wrote: Hello All, I am unable to call the assert method through a Module. I am able to execute the same statement through test function. I am going to paste the code of Test function and Module. The assert statement executes successfully when called through the test function. But fails when its part of a module function. I am invoking the module function through the test case function. I tried reinstalling ruby and watir. But its still failing. I tried various changes, but nothing worked. I tried invoking the assert method from Module function using 'Test::Unit::Assertions.assert()' I need help here. I have loads of assert statements in my module and somehow want to get this working. Test Function code: --- require 'watir' require 'test/unit' module NewTest def asserttest puts \n Hello testing assert through module assert(1==1, false) puts 'assert succeeded' end end --- Module: --- require 'watir' require 'test/unit' require 'NewTest' include NewTest class Moduletest Test::Unit::TestCase def test_a_orderPlacement puts \nCalling assert from test function assert(1 ==1,failed assertion) puts Assert call succeeded\n\n puts Calling assert method from module method NewTest.asserttest() puts \n Called module method successfully\n\n end end --- Thanks, Natasha --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Need to check for existence of value in select_list based on regular expression
Hi All, I want to check for existence of value in select_list based on regular expression. I tried the following, but it didn't work out. Probably its not an acceptable input. assert($ie.select_list(:id,ddlQuantity).includes?(/#{qty} pack/),No option for #{qty} + $ie.url) There are values like '1 pack (90 Stickers) - £4.99', '2 packs (180 Stickers) - £9.98' and so on. So I thought of adding a regular expression /#{qty} pack/ for searching. The function which selects quantity, takes an integer as input, into variable 'qty'. I tried to see if I can assert its existence using a single line of code. Do I need to loop through the values by getting the values populated into an array using getSelectedItems( ) method, for validation test? Thanks, Natasha --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: Need to check for existence of value in select_list based on regular expression
There's a getAllContents method for select_lists in 1.4.1 that returns an array of all of the drop-down list options. In later versions I think it's get_all_contents. So something like this maybe (includes? should actually be include?): assert($ie.select_list(:id,ddlQuantity)getAllContents.include?(/#{qty} pack/),No option for #{qty} + $ie.url) --- On Fri, 11/28/08, Natasha [EMAIL PROTECTED] wrote: From: Natasha [EMAIL PROTECTED] Subject: [wtr-general] Need to check for existence of value in select_list based on regular expression To: Watir General watir-general@googlegroups.com Date: Friday, November 28, 2008, 9:05 AM Hi All, I want to check for existence of value in select_list based on regular expression. I tried the following, but it didn't work out. Probably its not an acceptable input. assert($ie.select_list(:id,ddlQuantity).includes?(/#{qty} pack/),No option for #{qty} + $ie.url) There are values like '1 pack (90 Stickers) - £4.99', '2 packs (180 Stickers) - £9.98' and so on. So I thought of adding a regular expression /#{qty} pack/ for searching. The function which selects quantity, takes an integer as input, into variable 'qty'. I tried to see if I can assert its existence using a single line of code. Do I need to loop through the values by getting the values populated into an array using getSelectedItems( ) method, for validation test? Thanks, Natasha --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] uninitialized constant Watir::IE (NameError)
Hello, I am new using Watir. I am trying to implement a Concurrent Search test but every time I run the example below I am getting the error: ruby google.rb c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:52:in `assert_exists': Unable to locate element, using :value, Google Search (Watir::Exception::UnknownObjectException) from google.rb:18:in `join' from google.rb:18 from google.rb:18:in `each' from google.rb:18 Exit code: 1 Does anyone know why I am getting this error? How can I fixed? Thank you very much! Regards, Gigi. # Example == require 'thread' require 'watir' def test_google ie = Watir::IE.start('http://www.google.com') ie.text_field(:name, q).set(pickaxe) ie.button(:value, Google Search).click ie.close end # run the same test three times concurrently in separate browsers threads = [] 3.times do threads Thread.new {test_google} end threads.each {|x| x.join} --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: 1.6.2: Issue with enabled_popup.rb
Hi Bret, Just to clarify - So for now we have to use require 'watir\ie' in order to require 'watir\contrib\enabled_popup', but in the next version, we won't have to use require 'watir\ie', correct? My next question may be ignorant - if we want to be able to run our scripts in firewatir as well as watir, does that mean we can't use this enabled_popup thing to deal with modal dialogs? In that case, how DO we deal with modal dialogs? thanks, Lisa On Thu, Nov 13, 2008 at 11:06 AM, Bret Pettichord [EMAIL PROTECTED]wrote: i've added the require statement to the enabled popup script itself, so this workaround will not be required with the next version of watir jpweston wrote: Thanks for this and your explanation in the Uninitialzied Constant post. j. On Nov 12, 9:17 pm, Bret Pettichord [EMAIL PROTECTED] wrote: the solution is to add require 'watir/ie' to your script jpweston wrote: After installing WATIR 1.6.2, scripts that have the following line: require 'watir/contrib/enabled_popup' are causing the following error: c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/contrib/ enabled_popup.rb:5: uninitialized constant Watir::PageContainer::Win32 (NameError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' Here is what I have at the top of my scripts: require 'test/unit' require 'ci/reporter/rake/test_unit_loader.rb' require 'watir' require 'watir/testcase' require 'watir/contrib/enabled_popup' class TC_sales_tests Watir::TestCase include Watir code end Can someone point me toward what I am doing wrong here? These scripts worked with the version of 1.5 that I had installed. Thanks. Johnathan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] 1.6.2 - browser.attach question
Another question - on the development site you say: Watir 1.6.2 does not support Browser.attach. This will be supported in a future version. We use Browser.attach when we run our tests in a suite. What are we supposed to do instead, since Browser.attach isn't supported in 1.6.2? Or does this mean we can't use 1.6.2 at all? It seems weird that you couldn't run suites, there must be a way to do it that I just don't know about. Thanks, Lisa On Thu, Nov 13, 2008 at 11:06 AM, Bret Pettichord [EMAIL PROTECTED]wrote: i've added the require statement to the enabled popup script itself, so this workaround will not be required with the next version of watir jpweston wrote: Thanks for this and your explanation in the Uninitialzied Constant post. j. On Nov 12, 9:17 pm, Bret Pettichord [EMAIL PROTECTED] wrote: the solution is to add require 'watir/ie' to your script jpweston wrote: After installing WATIR 1.6.2, scripts that have the following line: require 'watir/contrib/enabled_popup' are causing the following error: c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/contrib/ enabled_popup.rb:5: uninitialized constant Watir::PageContainer::Win32 (NameError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' Here is what I have at the top of my scripts: require 'test/unit' require 'ci/reporter/rake/test_unit_loader.rb' require 'watir' require 'watir/testcase' require 'watir/contrib/enabled_popup' class TC_sales_tests Watir::TestCase include Watir code end Can someone point me toward what I am doing wrong here? These scripts worked with the version of 1.5 that I had installed. Thanks. Johnathan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: how to handle javascript popups problem with firewatir
;-) we did talk about it a little bit. Heres some suggestions: overwrite the javascript alert method, so it displays a 'modal' div in a light box, like google calendars. ( selenium does something like this) get your web designers/developers to stop using alerts - they are a really unpleasant user experience Paul On Fri, Nov 28, 2008 at 7:48 AM, Dave McNulla [EMAIL PROTECTED] wrote: On Nov 26, 6:42 pm, Dave McNulla [EMAIL PROTECTED] wrote: On Nov 26, 1:00 am, Jarod Zhu [EMAIL PROTECTED] wrote: I am using firewatir-1.6.2 to make a web automation tool in my project. I come to the problem that I can't click the javascript popup OK button successfully. I use the code like this: *** *** browser.startClicker('ok', 20) browser.button(:id, 'confirm').click # pop the javascript window *** *** Actually, the code above make the javascript popup nerver appear, but the popup OK button is not clicked. So it just make the the javascript popup disabled. Anyone here know how to handle javascript popups with The general answer is don't use the javascript popups. I'd like to hear Paul Rodgers discuss alternatives to them in the podcast on Friday. Thanks in advance Dave oops. I meant Paul Rogers, the one that isn't in 'bad company'. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: 1.6.2 - browser.attach question
Hi Lisa, If you want to have one browser shared among all your tests in the suite then a global variable set up in a mixin class may be what you are looking for: module MySetup def setup if $br == nil $br = Watir::Browser.new end @br = $br end end Then use this module in your test cases with include MySetup. Your tests will be able to use the instance variable @br if you don't want them to use globals. hth, Gavin On Fri, Nov 28, 2008 at 2:58 PM, Lisa Crispin [EMAIL PROTECTED] wrote: Another question - on the development site you say: Watir 1.6.2 does not support Browser.attach. This will be supported in a future version. We use Browser.attach when we run our tests in a suite. What are we supposed to do instead, since Browser.attach isn't supported in 1.6.2? Or does this mean we can't use 1.6.2 at all? It seems weird that you couldn't run suites, there must be a way to do it that I just don't know about. Thanks, Lisa On Thu, Nov 13, 2008 at 11:06 AM, Bret Pettichord [EMAIL PROTECTED] wrote: i've added the require statement to the enabled popup script itself, so this workaround will not be required with the next version of watir jpweston wrote: Thanks for this and your explanation in the Uninitialzied Constant post. j. On Nov 12, 9:17 pm, Bret Pettichord [EMAIL PROTECTED] wrote: the solution is to add require 'watir/ie' to your script jpweston wrote: After installing WATIR 1.6.2, scripts that have the following line: require 'watir/contrib/enabled_popup' are causing the following error: c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/contrib/ enabled_popup.rb:5: uninitialized constant Watir::PageContainer::Win32 (NameError) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' Here is what I have at the top of my scripts: require 'test/unit' require 'ci/reporter/rake/test_unit_loader.rb' require 'watir' require 'watir/testcase' require 'watir/contrib/enabled_popup' class TC_sales_tests Watir::TestCase include Watir code end Can someone point me toward what I am doing wrong here? These scripts worked with the version of 1.5 that I had installed. Thanks. Johnathan -- VMBed - http://vmbed.com/ - Machines when you want them. Test Automation - http://vmbed.com/?page/automate --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Error on just_add_watir?
Timeout::timeout(10)do begin @b.goto(url) rescue Timeout::Error puts 'Page took longer than 10 seconds to load' end end The proceeding code still throws the Timeout::Error exception. At least in FireWatir, this doesn't work. Rather, one must begin Timeout::timeout(10)do ff.link(:url, javascript:KWSearchSubmit()).click end rescue Timeout::Error puts 'Page took longer than 10 seconds to load' end Not sure about Watir. Keep up the good work, though! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Watir General group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---