ruby/com testing 2, november 11. admin grades for mid-term & hw 2 posted homeworks 3 & 4...

11
Ruby/COM Ruby/COM Testing 2, November 11 Testing 2, November 11

Upload: berniece-floyd

Post on 28-Dec-2015

214 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Ruby/COM Testing 2, November 11. Admin Grades for mid-term & hw 2 posted Homeworks 3 & 4 posted Project 2 People doing presentations – stay after class

Ruby/COMRuby/COM

Testing 2, November 11Testing 2, November 11

Page 2: Ruby/COM Testing 2, November 11. Admin Grades for mid-term & hw 2 posted Homeworks 3 & 4 posted Project 2 People doing presentations – stay after class

AdminAdmin

Grades for mid-term & hw 2 postedGrades for mid-term & hw 2 posted

Homeworks 3 & 4 postedHomeworks 3 & 4 posted

Project 2Project 2

People doing presentations – stay after People doing presentations – stay after class today to plan whenclass today to plan when

Page 3: Ruby/COM Testing 2, November 11. Admin Grades for mid-term & hw 2 posted Homeworks 3 & 4 posted Project 2 People doing presentations – stay after class

What Is COM?What Is COM?

Technology for allowing interactions Technology for allowing interactions between programsbetween programsInterface to allow applications to share Interface to allow applications to share functionalityfunctionalityComponent Object ModelComponent Object ModelTechnically COM AutomationTechnically COM AutomationPowerful capability for automated test Powerful capability for automated test development!development!

Page 4: Ruby/COM Testing 2, November 11. Admin Grades for mid-term & hw 2 posted Homeworks 3 & 4 posted Project 2 People doing presentations – stay after class

Main Elements Of COMMain Elements Of COM

ObjectsObjects

MethodsMethods

PropertiesProperties

EventsEvents

Page 5: Ruby/COM Testing 2, November 11. Admin Grades for mid-term & hw 2 posted Homeworks 3 & 4 posted Project 2 People doing presentations – stay after class

ObjectsObjects

Things that can be interacted withThings that can be interacted with FilesFiles Ranges of DataRanges of Data ParagraphsParagraphs

““Nouns”Nouns”

Objects can contain other objects and Objects can contain other objects and collections (groups of objects)collections (groups of objects)

Page 6: Ruby/COM Testing 2, November 11. Admin Grades for mid-term & hw 2 posted Homeworks 3 & 4 posted Project 2 People doing presentations – stay after class

MethodsMethods

Ways in which objects can be interacted Ways in which objects can be interacted withwith SaveSave Check SpellingCheck Spelling PrintPrint

““Verbs”Verbs”

Page 7: Ruby/COM Testing 2, November 11. Admin Grades for mid-term & hw 2 posted Homeworks 3 & 4 posted Project 2 People doing presentations – stay after class

PropertiesProperties

Descriptions of the objects and their stateDescriptions of the objects and their state Whether a file is savedWhether a file is saved File nameFile name Text FormattingText Formatting

““Adjectives”Adjectives”

Page 8: Ruby/COM Testing 2, November 11. Admin Grades for mid-term & hw 2 posted Homeworks 3 & 4 posted Project 2 People doing presentations – stay after class

EventsEvents

Outside things that an object can react toOutside things that an object can react to Mouse ClickMouse Click File being savedFile being saved Text being enteredText being entered

““Triggers”Triggers”

Page 9: Ruby/COM Testing 2, November 11. Admin Grades for mid-term & hw 2 posted Homeworks 3 & 4 posted Project 2 People doing presentations – stay after class

Using COM from RubyUsing COM from Ruby

require ‘win32ole’require ‘win32ole’<variable> = WIN32OLE.new(<COM <variable> = WIN32OLE.new(<COM identifier>)identifier>)

COM identifier = ‘Word.Application’ or COM identifier = ‘Word.Application’ or ‘InternetExplorer.Application’‘InternetExplorer.Application’Use <variable>.<property> or Use <variable>.<property> or <variable>.<method> to access the <variable>.<method> to access the properties and methodsproperties and methods

Page 10: Ruby/COM Testing 2, November 11. Admin Grades for mid-term & hw 2 posted Homeworks 3 & 4 posted Project 2 People doing presentations – stay after class

IE ControllerIE Controller

Wraps interaction with IEWraps interaction with IE

Download from wtr project at rubyforge.orgDownload from wtr project at rubyforge.org

Unzip and run install scriptUnzip and run install script

DemoDemo

Page 11: Ruby/COM Testing 2, November 11. Admin Grades for mid-term & hw 2 posted Homeworks 3 & 4 posted Project 2 People doing presentations – stay after class

Sources of COM InfoSources of COM Info

Office apps: Office apps: VB Language References at VB Language References at

msdn.microsoft.com/library/default.aspmsdn.microsoft.com/library/default.asp

IEIE http://msdn.microsoft.com/library/default.asp?http://msdn.microsoft.com/library/default.asp?

url=/workshop/browser/webbrowser/url=/workshop/browser/webbrowser/reference/Objects/InternetExplorer.aspreference/Objects/InternetExplorer.asp