Natasha -
Not sure if you solved this yet or not but you need to move the "include
Login" statement inside the SB class in testbug.rb. The below worked for
me. I had to change Watir::Browser to Watir::IE since I don't have 1.6
installed yet. The below code gets me as far as clicking the login button.
Alan
testbug.rb
*****************************
require 'watir' # the controller
require 'test/unit'
require 'Login'
#~ Watir.options_file =
'C:/natasha/RubyScripts/FinalAutomatedTests/options.yml'
$ie = Watir::IE.new
class SB < Test::Unit::TestCase
include Login
def test_a_orderPlacement
test_site = "www.moo.com"
user = $ARGV[0]
pwd = $ARGV[1]
$ie.goto(test_site)
$ie.link(:text,"Manage your orders").click
assert($ie.text_field(:id,"txtLogin").exists?)
signin('test','test')
end
end
***************************************
Login.rb
***************************************
#~ require 'watir' # the controller
#~ require 'test/unit'
module Login
def signin(user,password)
begin
# assert
assert($ie.text_field(:id,"txtLogin").exists?)
assert($ie.text_field(:id,"txtPassword").exists?)
assert($ie.button(:index,"1").exists?)
puts 'Login:: signin - Assertion passed'
rescue StandardError => ex
print "\n\nLogin:: signin => " + ex + "\n\n"
raise
$ie.close
end
# execute
$ie.text_field(:id,"txtLogin").set(user)
$ie.text_field(:id,"txtPassword").set(password)
$ie.button(:index,"1").click
puts 'Login:: signin - login successful on Sign In Page'
sleep 10
end
def signout
# assert
assert($ie.link(:title,"Sign out of MOO").exists?)
puts 'Login:: signout - Assertion passed'
# execute
$ie.link(:title,"Sign out of MOO").click
puts 'Login:: signout - Logout link clicked'
end
end
*************************************
On Thu, Nov 27, 2008 at 10:45 AM, Natasha Ranney <[EMAIL PROTECTED]>wrote:
> Hi Aidy,
>
> Thanks for sharing the list of editors. I have just installed NetBeans and
> it looks good.
>
> Also I had posted one more query in my last email. Please could you help me
> with that, whenever you get a chance.
>
> Regards,
> Natasha
>
> *aidy lewis <[EMAIL PROTECTED]>* wrote:
>
>
> Hi Natasha,
>
> Below is a list of editors
>
> On 27/11/2008, Natasha Ranney wrote:
> > Hi Aidy/Charley/John,
> >
> > I am using Notepad to write my scripts and at times I use SciTE.
>
> Open-Source\Free Software
>
> * Netbeans Ruby: http://www.netbeans.org/downloads/index.html
>
> * Aptana Radrails: http://www.aptana.com/rails
>
> * Vim: http://www.vim.org/download.php#pc
>
> * Emacs: http://www.gnu.org/software/emacs/windows/Getting-Emacs.html
>
> Proprietary
>
> * Ruby in Steel for Visual Studio: http://www.sapphiresteel.com/
>
> * Jetbrains Rubymine: http://www.jetbrains.com/ruby/index.html
>
> TEXT EDITORS (with out-of-the-box Ruby Syntax highlighting)
>
> Open-Source
>
> * Notepad++:
> http://sourceforge.net/project/showfiles.php?group_id=95717&package_id=102072
>
> * Komodo Edit:
> http://www.activestate.com/store/productdetail.aspx?prdGuid=20f4ed15-6684-4118-a78b-d37ff4058c5f
>
> Proprietary
>
> * E text editor: http://www.e-texteditor.com/
> Not logged in. Log in
>
> Aidy
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---