[wtr-general] Re: WatirLogger can't work in watir1.6.2
I suggest to use log4r. On Wed, Nov 12, 2008 at 3:15 PM, Gavin Jefferies [EMAIL PROTECTED] wrote: Hi Drew, require 'logger' require 'watir/logger' will get it working for you but I think the first requirement is a bug. Gavin On Tue, Nov 11, 2008 at 10:54 PM, drew [EMAIL PROTECTED] wrote: when debug lib/watir/logger.rb file prompt Uninitialized constant Watir::Logger NameError On Nov 12, 2:38 pm, drew [EMAIL PROTECTED] wrote: Hi all, When install watir1.6.2 when use WatirLogger. always prompt Uninitialized constant WatirLogger NameError it can work in 1.5.6 the code is below: class CoreLogger WatirLogger def initialize(fileName, logsToKeep, maxLogSize) super(fileName , logsToKeep, maxLogSize) self.level = Logger::INFO self.datetime_format = %d-%b-%Y %H:%M:%S self.info(Core Logger starting...) end end -- VMBed - http://vmbed.com/ - Machines when you want them. Test Automation - http://vmbed.com/?page/automate -- Regards, Edward Deng --~--~-~--~~~---~--~~ 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 copy text from modal window
The text is An allotment request with id IND50 has been created I want to take IND50please helpurgent --~--~-~--~~~---~--~~ 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] Firefox 2 : WATIR 1.6.2 and table operations
Hi All, I am using Watir 1.6.2 and was running my test on Firefox 2 for the first time. I found that the following code is not getting executed on Firefox: I have been able to execute it successfully on IE. Is it not supported? == $ie.table(:index,1).body(:index, 1).each do | row | row.each do | cell | if found == 1 if cell.text() =~ /edit/ puts 'Editting starts ' puts ' ' found=2 cell.link(:index,1).click break end end if cell.text() =~ /#{ono}/ # puts 'Found Row for order number : ' + cell.text() found = 1 break end end if found == 2 break 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] Re: how to copy text from modal window
Try to use ie.modal_dialog(:title, 'Title of your modal window') On 12 нояб, 12:55, meaculpa [EMAIL PROTECTED] wrote: The text is An allotmentrequest with id IND50 has been created I want to take IND50please helpurgent --~--~-~--~~~---~--~~ 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] Button click doesn't work
Hi, I have a button I need to click on with the following code: div style=float:left; padding-top:4px; padding-left:4px; table cellspacing=0 onclick=submitSearch('GB','en') class=p- button-special tr td div id=search-button align=centerSearch/div /td /tr /table /div I tried both ie.div(:id, 'search-button').click and ie.table(:class, 'p-button-special').click, but no succes. Any suggestions? --~--~-~--~~~---~--~~ 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: Help needed documenting Watir 1.6 roll out
Thanks so much for your help. I'm not sure what to do about the Logger. At heart, I would want to remove it from Watir. It is neither IE-specific, nor Watir specific. It is just sample code on how to create a Watir, and as such is really example code rather than something that should be included in a library for a browser driver. Bret Gavin Jefferies wrote: On Mon, Nov 10, 2008 at 7:24 AM, Bret Pettichord [EMAIL PROTECTED] wrote: First of all, I need help from some one who will read everything I post to this list. We are already getting several questions on this list which I have already answered in previous emails, or in wiki pages that I have posted references to. My longstanding policy has been that I answer a question about twice and then I expect that others will help users with the issue going forward, perhaps updating the FAQ. We may need a special FAQ for upgrading to 1.6, as it has a few more complications than previous releases. I'll try to back you up on this. Second, the tutorial and examples need to be reviewed and updated. I'm not sure if they work with 1.6 or not and someone needs to check them. Two things specifically: we need to make sure they don't have include Watir at toplevel and they should now have Browser.new instead of IE.new. From a site search on the include Watir issue I found, updated and checked: http://wiki.openqa.org/display/WTR/How+to+wait+with+Watir http://wiki.openqa.org/display/WTR/Simple+Ajax+examples On the IE.xxx that could be Browser.xxx I updated and checked: http://wiki.openqa.org/display/WTR/Yahoo+Print+Assertions http://wiki.openqa.org/display/WTR/Yahoo+Checkbox+Test http://wiki.openqa.org/display/WTR/Simple+Example http://wiki.openqa.org/display/WTR/Google+Test+Suite http://wiki.openqa.org/display/WTR/Google+Search http://wiki.openqa.org/display/WTR/Google+Maps+Example Then I got bogged down in firefox's lack of a logger. This documentation is now quite out of date. http://wiki.openqa.org/display/WTR/Methods+Supported+by+Element This needs to be updated by reading the release notes, unit tests, and perhaps by inspecting Watir code. Thanks for your help. Bret Gavin Jefferies wrote: Hi Bret, If you are still looking for helpers let me know. Gavin On Fri, Nov 7, 2008 at 12:17 PM, Bret Pettichord [EMAIL PROTECTED] wrote: I need help documenting and supporting the Watir 1.6 release. So far we have run into two small problems that some people will have with upgrading to the new release. I've posted this information to this list, but we need to find a better way to document this. I am also busy right now upgrading the install docs for Watir to include information about FireWatir. Now that FireWatir is part of Watir, we can't treat it as a separate thing. I plan to spend the rest of today working on the Watir website and install docs and then I need to move on to the new Framework. Are you interested in helping out? Bret --~--~-~--~~~---~--~~ 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: Button click doesn't work
You have a javascript event on the table. How about this: ie.table(:class,'p-button-special').fire_event('onclick') If that doesn't work, make sure the table is recognized by flashing it. -Charley On Wed, Nov 12, 2008 at 8:21 AM, JArkelen [EMAIL PROTECTED] wrote: Hi, I have a button I need to click on with the following code: div style=float:left; padding-top:4px; padding-left:4px; table cellspacing=0 onclick=submitSearch('GB','en') class=p- button-special tr td div id=search-button align=centerSearch/div /td /tr /table /div I tried both ie.div(:id, 'search-button').click and ie.table(:class, 'p-button-special').click, but no succes. Any suggestions? --~--~-~--~~~---~--~~ 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: Firefox 2 : WATIR 1.6.2 and table operations
We were not able to get table body support for firefox into this release. I have updated the compatibility matrix. Bret Natasha wrote: Hi All, I am using Watir 1.6.2 and was running my test on Firefox 2 for the first time. I found that the following code is not getting executed on Firefox: I have been able to execute it successfully on IE. Is it not supported? == $ie.table(:index,1).body(:index, 1).each do | row | row.each do | cell | if found == 1 if cell.text() =~ /edit/ puts 'Editting starts ' puts ' ' found=2 cell.link(:index,1).click break end end if cell.text() =~ /#{ono}/ # puts 'Found Row for order number : ' + cell.text() found = 1 break end end if found == 2 break 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] Re: Very slow typing speed for firefox 2 : watir 1.6.2
I'm seeing this happen with one of the people I'm working with, slow meaning almost 1sec/character in this case. He's running firefox on linux. My guess is that it's due to jssh, but it's hard to tell, I'll poke around and see if I can find out more. What OS/FireFox version and jssh addon are you using? Thanks, Charley On Wed, Nov 12, 2008 at 8:43 AM, Bret Pettichord [EMAIL PROTECTED]wrote: Natasha wrote: I was able to install and run my test against IE using latest Watir. But I found that the typing speed is very slow for firefox. For e.g. following command executed very slowly: $ie.text_field(:id,txtLine2).set(this is text field 2) Is this a known issue? Is there anyway we can speep this up somehow? Many of us have seen this problem, but it seems to show up intermittently and we don't really know the cause. Bret --~--~-~--~~~---~--~~ 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: Very slow typing speed for firefox 2 : watir 1.6.2
Hi Aidy, I am running my tests from windows command prompt. test.rb -- www.test.com param1 param2 I am using options.yml file, with following settings: # 'ie' (Watir::IE) or 'firefox' (FireWatir::Firefox) browser: firefox # These options only affect IE. # speed options are fast, slow, and zippy speed: fast visible: true - In my test script, I am initializing Browser object, as shown below: require 'watir' # the controller require 'test/unit' Watir.options_file = 'C:/natasha/RubyScripts/FinalAutomatedTests/options.yml' $ie = Watir::Browser.new --- Please let me know, if you need more information. Thanks, Natasha aidy lewis [EMAIL PROTECTED] wrote: On 12/11/2008, Natasha Ranney wrote: Hi Charley, I found the same behavior. It was typing at 1 character per second. Firefox version: 2.0.0.17 OS: Windows XP JSSH: 0.9 It would be great if you can sort this out. Thanks, Natasha How are you running your tests? 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] get all values of a radio Button
How could I get all the possible values of a radio button? For example if I have something like: input type=radio name=email_frequency value=dailyDaily Email/ input input type=radio name=email_frequency value=weeklyWeekly Email/input input type=radio name=email_frequency value=monthlyMonthly Email/input How could I get all the possible values: daily, weekly and monthly thanks. --~--~-~--~~~---~--~~ 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: getAllContents selectList
and what's the value of @o?? On 11 nov, 18:10, marekj [EMAIL PROTECTED] wrote: On Tue, Nov 11, 2008 at 5:22 AM, TCBlues [EMAIL PROTECTED] wrote: when you call getAllContents in a select list field you get all the captions but I would like to get the possible values, is it possible? Thank you. Here is a method from Watirloo I use # return array of option values invisible to the user # similar to items (getAllContents) but returns values attribute text # instead of visible text items def options assert_exists @container.log There are [EMAIL PROTECTED] items options = [] @o.each { |thisItem| options thisItem.value } return options end this is for SelectList.#options it's not yet in the latest push but you can check out some info herehttp://www.bitbucket.org/marekj/watirloo/src/tip/lib/watirloo.rb -- marekj www.testr.us| semantic test objects modeling in watir --~--~-~--~~~---~--~~ 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: getAllContents selectList
Ok, I got it. @ie.select_list(:name,myField).o.each {...} It's working for watir but not for firewatir. Any idea?? On 12 nov, 10:23, TCBlues [EMAIL PROTECTED] wrote: and what's the value of @o?? On 11 nov, 18:10, marekj [EMAIL PROTECTED] wrote: On Tue, Nov 11, 2008 at 5:22 AM, TCBlues [EMAIL PROTECTED] wrote: when you call getAllContents in a select list field you get all the captions but I would like to get the possible values, is it possible? Thank you. Here is a method from Watirloo I use # return array of option values invisible to the user # similar to items (getAllContents) but returns values attribute text # instead of visible text items def options assert_exists @container.log There are [EMAIL PROTECTED] items options = [] @o.each { |thisItem| options thisItem.value } return options end this is for SelectList.#options it's not yet in the latest push but you can check out some info herehttp://www.bitbucket.org/marekj/watirloo/src/tip/lib/watirloo.rb -- marekj www.testr.us|semantic test objects modeling in watir --~--~-~--~~~---~--~~ 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: Issue with IE7's certificate page
Thanks. Weirdly, issue was resolved when I cleared my cache and restarted browser. On Nov 6, 1:55 am, Tony [EMAIL PROTECTED] wrote: HiMaven, This is just a suggestion ... and others might have better ones When testing a website (usually test env) certificates might expire and get renewed. Hence putting the code to click on the continue button on certificate Window into the testcase is not usually a good idea. Cause when the certificate is renewed .. your testcode might break or would have to have a better way to manage the warnings. Certificate being always valid is an assumption that we can make .. since we are not testing this but the functionality of the website. Certificates in the production env would be different. Make the autoit code to run separately(different process) and click on any certificate windows that popup automatically. Hence your test code will run when popups exist or dont. Also when you have valid certificates and run them through a proxy like fiddler .. you will definitely get the certificate warning messages. Iam not sure on the problem that when you run it manually, you got the warning and when running it through the script you didnt get it. Maybe you clicked on some some checkbox to disable the warning. - Tony --~--~-~--~~~---~--~~ 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] wait_until gives undefined method error
Hi all, I am trying to write some code to log into an app via a pop-up window and then click some tabs inside it. However, when I try to encapsulate the login logic into a method, I get an error on console. I am pasting my code below followed by the console error. Any suggestions as to what I'm doing wrong? (I am using wait_until because my text verification fails as page has not loaded yet). require 'watir' require 'watir/WindowHelper' require 'watir/testcase' include Watir class TC_MTests Watir::TestCase #Variables @url = 'https://1.2.3.4/' @login_title = 'Connect to' @username = 'abc' @password = '123' #Start browser @ie = Watir::IE.start(test_site = @url) #If prompted about the security certificate, click to bypass certification if @ie.contains_text(Continue to this website (not recommended).) @ie.link(:text, 'Continue to this website (not recommended).').click_no_wait puts Bypasses the security certificate warning for now. end def test_Login #Use autoit to work with the authentication popup #Pauses execution of the script until the requested window exists Watir.autoit.WinWait(@login_title) Watir.autoit.Send(@username) Watir.autoit.Send('{tab}') Watir.autoit.Send(@password) Watir.autoit.Send('{enter}') puts Login window pop-up appears and credentials passed. #Wait until landing page has loaded completely wait_until [EMAIL PROTECTED]@username} #Check if correct user has logged in if @ie.contains_text(Logged in as: [EMAIL PROTECTED]) puts Test passed. User ' [EMAIL PROTECTED] +' has logged in. else puts Test failed. Login fails or incorrect user has logged in end #End of method end #End of class end -- I get the following error on console: P:\ruby c:\ruby\tests\IanTests_temp.rb Bypasses the security certificate warning for now. Loaded suite c:/ruby/tests/IanTests_temp Started Login window pop-up appears and credentials passed. E Finished in 0.297 seconds. 1) Error: test_Login(TC_MTests): NoMethodError: undefined method `text' for nil:NilClass c:/ruby/tests/IanTests_temp.rb:37:in `test_Login' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir.rb:110:in `wait_until' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/waiter.rb:76:in `wait_unt il' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/waiter.rb:53:in `wait_unt il' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/waiter.rb:76:in `wait_unt il' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir.rb:110:in `wait_until' c:/ruby/tests/IanTests_temp.rb:37:in `test_Login' 1 tests, 0 assertions, 0 failures, 1 errors ___ Thanks! --~--~-~--~~~---~--~~ 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: wait_until gives undefined method error
Hi, Try using Watir::Waiter.wait_until instead. Also you might want to consider removing include Watir from your code to avoid problems when you upgrade to 1.6.2. See http://wiki.openqa.org/display/WTR/include+Watir for that. hth, Gavin On Nov 12, 12:10 pm, maven999 [EMAIL PROTECTED] wrote: Hi all, I am trying to write some code to log into an app via a pop-up window and then click some tabs inside it. However, when I try to encapsulate the login logic into a method, I get an error on console. I am pasting my code below followed by the console error. Any suggestions as to what I'm doing wrong? (I am using wait_until because my text verification fails as page has not loaded yet). require 'watir' require 'watir/WindowHelper' require 'watir/testcase' include Watir class TC_MTests Watir::TestCase #Variables @url = 'https://1.2.3.4/' @login_title = 'Connect to' @username = 'abc' @password = '123' #Start browser @ie = Watir::IE.start(test_site = @url) #If prompted about the security certificate, click to bypass certification if @ie.contains_text(Continue to this website (not recommended).) @ie.link(:text, 'Continue to this website (not recommended).').click_no_wait puts Bypasses the security certificate warning for now. end def test_Login #Use autoit to work with the authentication popup #Pauses execution of the script until the requested window exists Watir.autoit.WinWait(@login_title) Watir.autoit.Send(@username) Watir.autoit.Send('{tab}') Watir.autoit.Send(@password) Watir.autoit.Send('{enter}') puts Login window pop-up appears and credentials passed. #Wait until landing page has loaded completely wait_until [EMAIL PROTECTED]@username} #Check if correct user has logged in if @ie.contains_text(Logged in as: [EMAIL PROTECTED]) puts Test passed. User ' [EMAIL PROTECTED] +' has logged in. else puts Test failed. Login fails or incorrect user has logged in end #End of method end #End of class end -- I get the following error on console: P:\ruby c:\ruby\tests\IanTests_temp.rb Bypasses the security certificate warning for now. Loaded suite c:/ruby/tests/IanTests_temp Started Login window pop-up appears and credentials passed. E Finished in 0.297 seconds. 1) Error: test_Login(TC_MTests): NoMethodError: undefined method `text' for nil:NilClass c:/ruby/tests/IanTests_temp.rb:37:in `test_Login' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir.rb:110:in `wait_until' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/waiter.rb:76:in `wait_unt il' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/waiter.rb:53:in `wait_unt il' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/waiter.rb:76:in `wait_unt il' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir.rb:110:in `wait_until' c:/ruby/tests/IanTests_temp.rb:37:in `test_Login' 1 tests, 0 assertions, 0 failures, 1 errors ___ Thanks! --~--~-~--~~~---~--~~ 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: wait_until gives undefined method error
I think the subject line is incorrect. Your problem is that your code to initialize the browser needs to be in a startup method. The error message you are getting is telling you that @ie is nil (because it has not been initialized). Bret maven999 wrote: Hi all, I am trying to write some code to log into an app via a pop-up window and then click some tabs inside it. However, when I try to encapsulate the login logic into a method, I get an error on console. I am pasting my code below followed by the console error. Any suggestions as to what I'm doing wrong? (I am using wait_until because my text verification fails as page has not loaded yet). require 'watir' require 'watir/WindowHelper' require 'watir/testcase' include Watir class TC_MTests Watir::TestCase #Variables @url = 'https://1.2.3.4/' @login_title = 'Connect to' @username = 'abc' @password = '123' #Start browser @ie = Watir::IE.start(test_site = @url) #If prompted about the security certificate, click to bypass certification if @ie.contains_text(Continue to this website (not recommended).) @ie.link(:text, 'Continue to this website (not recommended).').click_no_wait puts Bypasses the security certificate warning for now. end def test_Login #Use autoit to work with the authentication popup #Pauses execution of the script until the requested window exists Watir.autoit.WinWait(@login_title) Watir.autoit.Send(@username) Watir.autoit.Send('{tab}') Watir.autoit.Send(@password) Watir.autoit.Send('{enter}') puts Login window pop-up appears and credentials passed. #Wait until landing page has loaded completely wait_until [EMAIL PROTECTED]@username} #Check if correct user has logged in if @ie.contains_text(Logged in as: [EMAIL PROTECTED]) puts Test passed. User ' [EMAIL PROTECTED] +' has logged in. else puts Test failed. Login fails or incorrect user has logged in end #End of method end #End of class end -- I get the following error on console: P:\ruby c:\ruby\tests\IanTests_temp.rb Bypasses the security certificate warning for now. Loaded suite c:/ruby/tests/IanTests_temp Started Login window pop-up appears and credentials passed. E Finished in 0.297 seconds. 1) Error: test_Login(TC_MTests): NoMethodError: undefined method `text' for nil:NilClass c:/ruby/tests/IanTests_temp.rb:37:in `test_Login' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir.rb:110:in `wait_until' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/waiter.rb:76:in `wait_unt il' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/waiter.rb:53:in `wait_unt il' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/waiter.rb:76:in `wait_unt il' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir.rb:110:in `wait_until' c:/ruby/tests/IanTests_temp.rb:37:in `test_Login' 1 tests, 0 assertions, 0 failures, 1 errors ___ Thanks! --~--~-~--~~~---~--~~ 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: Very slow typing speed for firefox 2 : watir 1.6.2
Hi Charley, I found the same behavior. It was typing at 1 character per second. Firefox version: 2.0.0.17 OS: Windows XP JSSH: 0.9 It would be great if you can sort this out. Thanks, Natasha Charley Baker [EMAIL PROTECTED] wrote: I'm seeing this happen with one of the people I'm working with, slow meaning almost 1sec/character in this case. He's running firefox on linux. My guess is that it's due to jssh, but it's hard to tell, I'll poke around and see if I can find out more. What OS/FireFox version and jssh addon are you using? Thanks, Charley On Wed, Nov 12, 2008 at 8:43 AM, Bret Pettichord [EMAIL PROTECTED] wrote: Natasha wrote: I was able to install and run my test against IE using latest Watir. But I found that the typing speed is very slow for firefox. For e.g. following command executed very slowly: $ie.text_field(:id,txtLine2).set(this is text field 2) Is this a known issue? Is there anyway we can speep this up somehow? Many of us have seen this problem, but it seems to show up intermittently and we don't really know the cause. Bret --~--~-~--~~~---~--~~ 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 save a cookie and reload it?
It is really a shame I cannot understant the cookie setting, maybe I need more time. But I know the gem of Mechanize can deal with the cookie quite well, such as the code: agent.cookie_jar.save_as('cookie.txt',:cookiestxt) -- agent.cookie_jar.load('cookie.txt',:cookiestxt) Is there a way to pass the cookie or the browser instance between Watir and Mechanize? Many thanks. On 11月12日, 上午7时28分, jnxgn [EMAIL PROTECTED] wrote: Tony, Thank you very much for your suggestion. On 11月12日, 上午2时35分, Tony [EMAIL PROTECTED] wrote: Like Alex had said, its not that simple to add a cookie and get the cookie details by using ie77.document.cookie = tmpcookie. A cookie is set by the server and has 3 main identifiers - (name, domain, path) if any of these 3 identifiers are different, a new cookie is created. There are a few limits when you try to access a cookie using document. Will explain it to you using an example - clear all cookies and start ie and go to google.com. After this run javascript: alert(document.cookie); in the url field. You would see something like - PREF=ID=80fb690664c20f44:TM=1226473461:LM... What this actually means is there is a cookie with name: PREF and value: ID=80fb690664c20f44:TM=1226473461:LM... This shows only one cookie is set. But actually 2 cookies were set, one is for google.com domain and the other google.co.in (cause iam in India and google does a redirect to google.co.in). We can't access the cookie for google.com unless iam at the google.com. document.cookie will only display cookies that are accessible by the domain that served the current page. If iam at google.co.in only cookies of this site are shown and not from msn or yahoo or aol. So now you have got the name and value, what about the domain and path ... path most of time by default is /. Domain would be for which domains this cookie would be sent out to. in this case its .google.co.in Now there is also an expiry date which mentions if the cookie is a session cookie or not. ie77.document.cookie will return n number of cookies with a ; as delimiter. But this may not be returning you everything you need. For example the path of a cookie in mail.google.com is /mail You need to set this too. Suggestion is login to your application and check all the cookies that being set for each domain etc using firefox or a proxy. And then try setting your cookie with specific details not just the name and value. Here is a good read to read and set cookies -http://www.htmlgoodies.com/beyond/javascript/article.php/3470821 -Tony --~--~-~--~~~---~--~~ 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
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: Issue with IE7's certificate page
BTW, Tony thanks for good description of dealing with ssl and certificates with watir! I have just wondered about possible solutions.. about any better ideas. And does watir support easy work with https, certificates and same origin policy than Selenium. Accidentally I found this post :) We're actually using the same or similar solutions you described. Do we have such info somewhere in wiki? I would suggest we should definitly have it :) Thank you, Alex. On Nov 6, 8:55 am, Tony [EMAIL PROTECTED] wrote: Hi Maven, This is just a suggestion ... and others might have better ones When testing a website (usually test env) certificates might expire and get renewed. Hence putting the code to click on the continue button on certificate Window into the testcase is not usually a good idea. Cause when the certificate is renewed .. your testcode might break or would have to have a better way to manage the warnings. Certificate being always valid is an assumption that we can make .. since we are not testing this but the functionality of the website. Certificates in the production env would be different. Make the autoit code to run separately(different process) and click on any certificate windows that popup automatically. Hence your test code will run when popups exist or dont. Also when you have valid certificates and run them through a proxy like fiddler .. you will definitely get the certificate warning messages. Iam not sure on the problem that when you run it manually, you got the warning and when running it through the script you didnt get it. Maybe you clicked on some some checkbox to disable the warning. - Tony --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---