Monday, August 8, 2011

Watir Tutorial: AutoIt


This will be a short post:  As this is just a quick primer into what you can do in JD Edwards with AutoIt and Watir.  I will assume you have read this post, so that everything is put together on your computer as it should be.

To be concise, for your reference you will need this page, to reference the different commands and code to get AutoIt to work as you want it to. 

If you want to hit the 'OK' button in the form exit, we use the keyboard shortcut to do so:  'CTRL+ALT+O'

The way you would do this in your script, would be to have the following lines of code:

  1. require 'win32ole'
  2. autoit = WIN32OLE.new('AutoItX3.Control')
  3. autoit.Send("^!o")


The first line is for loading the gem so that you can access AutoIt (I don't know exactly what it does, but I think it is for accessing other programs outside of Ruby, because AutoIt can be used seperately).  A new object called autoit is created, with the specified class.  The third line is where we actually tell the keyboard to click "ctrl+alt+o".

Remember to use this cheatsheet for your reference in using AutoIt!

No comments:

Post a Comment