Hi,
I have started using watir for the last few weeks and understanding the
scripting.

now it's time for me to define framework using watir with sql server or
oracle

I have to login the application with login id, password variables which
their values are stored in db.

my watir login scripts works fine and also the script which connects sql
server 2005 from watir too works fine individually (login/ password
hardcoded). but if i want every field or data should be accessed from
database.

I need to initialize and get/set the instance variables as the following but
i am unable to understand here.

def test(aAtxt)
strAppName=aAtxt.instance_variable_get(:@appName)
      strLocation=aAtxt.instance_variable_get(:@locCode)
      strUserName=aAtxt.instance_variable_get(:@login)
      strPassword=aAtxt.instance_variable_get(:@password)
      strURL=aAtxt.instance_variable_get(:@url)
      strApplId=aAtxt.instance_variable_get(:@applId)
      strLocId=aAtxt.instance_variable_get(:@locId)


could any of you please help me out by providng the script sample.

Following is my script:
require 'rubygems'
require 'watir'
require 'test/unit'
require 'watir/screen_capture'
module login
class Ejslogin < Test::Unit::TestCase
include Watir
include Watir::ScreenCapture
  def setup
    test_site = "url"
    @ie = Watir::IE.new
    @ie.set_fast_speed
    @ie.maximize()
    @ie.goto test_site
  end
  def test_login(userName="venky", password="Tester12345")

    #assert_equal(@ie.title, "AppLogin")
    @ie.text_field(:name, "userName").set "#{userName}"
    @ie.text_field(:name, "password").set "#{password}"
    @ie.button(:value, "Log in").click

    @ie = Watir::IE.attach(:title, 'AppJris')

    #assert(@ie.select_list(:name,"jurisdiction").exists?)
    @ie.select_list( :name , "jris").select("Development")

    @ie.button(:name, "btn1").click
    puts ' '
  end

   def teardown
    @ie.close()
  end
end
========================================
require 'oci8'

conn = OCI8.new('id', 'pwd', '//IP Address/orcl')
    num_rows = conn.exec("SELECT LOGIN_ID, LOGIN_PASSWORD FROM Aj_USERS
WHERE LOGIN_ID='venky'") do |r|
   puts r.join(',')
 end
 puts num_rows.to_s + ' rows were processed.'
 conn.logoff


Please help me out ...it is urgent for me to update on this...


thanks in advance,
venky

--~--~---------~--~----~------------~-------~--~----~
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 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to