Thursday, August 11, 2011

Watir Tutorial: Logging into EnterpriseOne

Here is a great little example to do so that we can log into EnterpriseOne and thereafter get our testing groove on.  Here's the code, and thereafter I will explain what is going on. 

  1. require 'rubygems'
  2. require 'watir'
  3. b = Watir::Browser.new
  4. b.goto("http://my.e1env.org")
  5. b.text_field(:name => "User").set "myUserID"
  6. b.text_field(:name => "Password").set "myPassword"
  7. b.button(:type => "submit").click
  8. b.wait_until {b.form(:action => "/jde/E1Menu_FastPath.mafService?e1.state=maximized&e1.mode=view&e1.namespace=&e1.service=E1Menu_FastPath&RENDER_MAFLET=E1Menu").exist?}

Lines 1 through 3 are described elsewhere


4.  Tell the browser object to go to your EnterpriseOne login page. 

5.  Set the 'UserID' field to your user name.

6.  Set the 'Password' field to your password.

7.  Click the submit button.

8.  This will wait until the Fastpath button is visible to Watir, it is great for ensuring that enough has loaded for your script to continue and execute the next operation successfully. 


1 comment:

  1. yikes, where is your other site, can't find it...i am lost in math-i-nation!

    ReplyDelete