SlideShare a Scribd company logo
Power-Up Your
Test Suite With
OLE Automation
Joshua Russell
• Application Architect
• Huntington Bank
About Me
2
Web Desktop Mobile
Mainframe Database Services
Test Automation
3
How Do You “Power-Up” A Test Suite?
4
5
6
Test Suite Toolbox
7
Useful Tool: OLE Automation
8
Desktop
Mainframe
Desktop Applications
9
10
Mainframe Applications
11
Task
Automation
Test
Automation
12
Automate Windows applications
Possible solution when popular options are
unavailable
Several names
OLE Automation
13
• Created by Microsoft
• Based on a subset of COM
• Still included in “OLE”
• Intended for use by scripting languages
What is OLE Automation?
14
C C++ C#
Visual
Basic
Java
VBScript Perl PHP Python Ruby
Clients and Servers
15
Automation
Server
Automation
Client
Automation Server
16
Automation Client
17
The Object Model
18
Ruby Stuff
19
Ruby and WIN32OLE
20
require ‘win32ole’
WIN32OLE.new ‘Program.ID’
WIN32OLE Basics
21
The Program ID
22
Program ID
• Object::methods
• Not helpful
Ruby
Methods
• WIN32OLE::ole_methods
• WIN32OLE::ole_put_methods
• Very informative
OLE
Methods
Ruby Methods vs OLE Methods
23
Mainframe Automation
24
OLE Automation and Mainframe
Quick3270 Extra! Passport
25
• Control the terminal emulator application
Application
• Open, close, and manage sessions
Sessions
• Read, write, and find text
• Send key strokes
Screens
Mainframe Application Functionality
26
TE3270
x3270
Quick
3270
Extra!
Virtel
Web
Access
Passport
TE3270
27
TE3270: Page Object Pattern
28
TE3270 Example
29
Cucumber Steps
30
TE3270 and Cucumber Scenarios
31
Mainframe
32
Enrollment
33
Excel Automation
34
Launch Excel
35
require ‘win32ole’
excel = WIN32OLE.new ‘Excel.Application’
excel.Visible = true
Workbooks
36
excel.Workbooks.Add
excel.Workbooks.Open(‘c:qa_highwayrecords.xlsx’)
Worksheets
37
workbook.Worksheets(1)workbook.Worksheets(‘Customers’)workbook.Worksheets(2)workbook.Worksheets(‘Orders’)workbook.Worksheets.Add
Data (rows)
38
worksheet.Rows(2)
worksheet.Rows(6)
Data (columns)
39
worksheet.Columns(2)
worksheet.Columns(1)
Data (cells)
40
worksheet.Cells(4, 1)
worksheet.Cells(8, 2)
worksheet.Cells(11, 3)
cell.Value
cell.Value = ‘$50.49’
Shut It Down
41
workbook.Close
excel.Workbooks.Close
Shut It Down
42
excel.Quit
More Cool Stuff
43
Further Reading
Distributed
COM
Event Handling
iOS
implementation
44
Resources (Background)
• Microsoft – “Automation”:
– https://docs.microsoft.com/en-us/cpp/mfc/automation
• Microsoft – “Component Object Model (COM)”:
– https://msdn.microsoft.com/en-
us/library/windows/desktop/ms680573(v=vs.85).aspx
• Microsoft – “OLE in MFC”:
– https://docs.microsoft.com/en-us/cpp/mfc/ole-in-mfc
• Wikipedia – “OLE Automation”:
– https://en.wikipedia.org/wiki/OLE_Automation
• Wikipedia – “Component Object Model”:
– https://en.wikipedia.org/wiki/Component_Object_Model
45
Resources (Microsoft)
• Excel Object Model:
– https://msdn.microsoft.com/en-us/library/wss56bz7.aspx
• PowerPoint Object Model:
– https://msdn.microsoft.com/en-us/vba/powerpoint-
vba/articles/object-model-powerpoint-vba-reference
• Internet Explorer Object Model:
– https://msdn.microsoft.com/en-us/library/ms970456.aspx
46
Resources (Mainframe)
• Mainframe OLE Automation (EXTRA!/PASSPORT):
– http://docs.attachmate.com/extra/x-treme/apis/com/
• TE3270 gem:
– https://github.com/cheezy/te3270
• TE3270 gem (modified for PASSPORT):
– https://github.com/RussellJoshuaA/te3270
47
Resources
• Joshua Russell on GitHub:
– https://github.com/RussellJoshuaA
• This presentation on GitHub:
– https://github.com/RussellJoshuaA/ruby_win32ole_presentation/
48
Consider using OLE
• Task Automation
• Acceptance Testing
Applications on Windows
• Microsoft Office
• Mainframe Terminal Emulators
Ruby and WIN32OLE
Conclusion
49
Power-Up Your Test Suite with OLE Automation by Joshua Russell
Appendix
• COM is used to create software components that can interact
• COM is a standard which specifies an object model and
programming requirements that enable COM objects to
interact with other objects
• COM is the foundation for OLE, ActiveX, and other
technologies
Component Object Model
52
• A COM object is one which provides access to its data
exclusively through one or more sets of interfaces
• COM objects can be created with a variety of programming
languages
COM Object
53
• COM makes a fundamental distinction between interface
definitions and their implementations
• An interface is a group of related function prototypes whose
usage is defined but whose implementation is not
• An interface implementation is the code that carries out the
actions specified in an interface definition
COM Interfaces
54
• “OLE” was originally an acronym for Object Linking and
Embedding. Now it’s just “OLE”.
• OLE is a mechanism for manipulating documents created by
multiple applications
What is OLE?
55
• OLE incorporates many concepts:
– Linking and Embedding
– In-Place Activation (Visual Editing)
– Automation
– Compound Files
– Uniform Data Transfer
– Drag and Drop
– Component Object Model
OLE is made of stuff
56
• Power-Up Your Test Suite with OLE Automation
– For test automation, every platform is a challenge that requires a
unique solution. For many native applications in a Windows
environment, the appropriate automation solution is OLE
Automation. From testing desktop applications & stored
procedures to data management & metrics, the combination of
Ruby and WIN32OLE can automate tests on native Windows
apps. The audience will learn the capabilities and limitations of
automation using Microsoft’s Automation interface, with
examples in Excel, Internet Explorer, and PASSPORT terminal
emulator. For those staying through the End Credits, we’ll have a
special bonus scene!
Abstract
57
Change History
Author Date Comment
Joshua Russell 2018-02-26 Updated for QA or the Highway
58

More Related Content

PPTX
Automate Your Data, Free Your Mind by Aaron Swerlein
PPTX
Improving the Quality of Existing Software
PPTX
Improving the Quality of Existing Software
PPTX
Beginners overview of automated testing with Rspec
PPTX
Breaking Dependencies to Allow Unit Testing
PPTX
Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016
PPTX
Improving the Quality of Existing Software
PPTX
Improving The Quality of Existing Software
Automate Your Data, Free Your Mind by Aaron Swerlein
Improving the Quality of Existing Software
Improving the Quality of Existing Software
Beginners overview of automated testing with Rspec
Breaking Dependencies to Allow Unit Testing
Breaking Dependencies to Allow Unit Testing - DevIntersection Spring 2016
Improving the Quality of Existing Software
Improving The Quality of Existing Software

What's hot (20)

PPTX
Improving the Quality of Existing Software - DevIntersection April 2016
PDF
Breaking Dependencies to Allow Unit Testing
PPTX
Test Driven Development - a Practitioner’s Perspective
PPTX
Selenium + Specflow
PPTX
DSL in test automation
PPTX
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
PDF
Laws of test automation framework
PDF
Test and Behaviour Driven Development (TDD/BDD)
PPTX
La vita nella corsia di sorpasso; A tutta velocità, XPages!
PDF
Object-oriented Analysis, Design & Programming
PPTX
Selenium training eduxfactor
PDF
May: Automated Developer Testing: Achievements and Challenges
PPTX
01 introduction to entity framework
PPTX
Automated Acceptance Tests in .NET
PPSX
Advanced Web Development in PHP - Understanding REST API
PPTX
Unit Testing in Swift
PPTX
Visual studio 2012 - What's in it for me?
PPTX
Presentation delex
PDF
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
PDF
Agile methodologies
Improving the Quality of Existing Software - DevIntersection April 2016
Breaking Dependencies to Allow Unit Testing
Test Driven Development - a Practitioner’s Perspective
Selenium + Specflow
DSL in test automation
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
Laws of test automation framework
Test and Behaviour Driven Development (TDD/BDD)
La vita nella corsia di sorpasso; A tutta velocità, XPages!
Object-oriented Analysis, Design & Programming
Selenium training eduxfactor
May: Automated Developer Testing: Achievements and Challenges
01 introduction to entity framework
Automated Acceptance Tests in .NET
Advanced Web Development in PHP - Understanding REST API
Unit Testing in Swift
Visual studio 2012 - What's in it for me?
Presentation delex
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Agile methodologies
Ad

Similar to Power-Up Your Test Suite with OLE Automation by Joshua Russell (20)

PPTX
An Open Source Workbench for Prototyping Multimodal Interactions Based on Off...
PPTX
Intro to Microsoft.NET
PPT
Rajnish singh(presentation on oracle )
PDF
Asp.NETZERO - A Workshop Presentation by Citytech Software
PPTX
Entity Framework Core 1.0
PPT
Dot net Online Training | .Net Training and Placement online
PPTX
.Net programming with C#
PPTX
.net Based Component Technologies
PPTX
Power shell basics day1
PPTX
Flexible delivery options
PPTX
AIR - Framework ( Cairngorm and Parsley )
PPTX
PDF
2.3 (Architecture) Moving to Managed Code
PPT
Native App Development for iOS, Android, and Windows with Visual Studio
PPTX
SOLID Programming with Portable Class Libraries
PPTX
Object-Relational Mapping and Dependency Injection
PDF
Eclipse Testing Day 2010. Xored Q7
PDF
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
PPTX
Selenium web driver_2.0_presentation
PPT
.Net overviewrajnish
An Open Source Workbench for Prototyping Multimodal Interactions Based on Off...
Intro to Microsoft.NET
Rajnish singh(presentation on oracle )
Asp.NETZERO - A Workshop Presentation by Citytech Software
Entity Framework Core 1.0
Dot net Online Training | .Net Training and Placement online
.Net programming with C#
.net Based Component Technologies
Power shell basics day1
Flexible delivery options
AIR - Framework ( Cairngorm and Parsley )
2.3 (Architecture) Moving to Managed Code
Native App Development for iOS, Android, and Windows with Visual Studio
SOLID Programming with Portable Class Libraries
Object-Relational Mapping and Dependency Injection
Eclipse Testing Day 2010. Xored Q7
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Selenium web driver_2.0_presentation
.Net overviewrajnish
Ad

More from QA or the Highway (20)

PDF
KrishnaToolComparisionPPT.pdf
PPTX
Ravi Lakkavalli - World Quality Report.pptx
PPTX
Caleb Crandall - Testing Between the Buckets.pptx
PDF
Thomas Haver - Mobile Testing.pdf
PDF
Thomas Haver - Example Mapping.pdf
PDF
Joe Colantonio - Actionable Automation Awesomeness in Testing Farm.pdf
PDF
Sarah Geisinger - Continious Testing Metrics That Matter.pdf
PDF
Jeff Sing - Quarterly Service Delivery Reviews.pdf
PDF
Leandro Melendez - Chihuahua Load Tests.pdf
PDF
Rick Clymer - Incident Management.pdf
PPTX
Robert Fornal - ChatGPT as a Testing Tool.pptx
PDF
Federico Toledo - Extra-functional testing.pdf
PPTX
Andrew Knight - Managing the Test Data Nightmare.pptx
PDF
Melissa Tondi - Automation We_re Doing it Wrong.pdf
PDF
Jeff Van Fleet and John Townsend - Transition from Testing to Leadership.pdf
PPTX
DesiradhaRam Gadde - Testers _ Testing in ChatGPT-AI world.pptx
PDF
Damian Synadinos - Word Smatter.pdf
PDF
Lee Barnes - What Successful Test Automation is.pdf
PPTX
Jordan Powell - API Testing with Cypress.pptx
PPTX
Carlos Kidman - Exploring AI Applications in Testing.pptx
KrishnaToolComparisionPPT.pdf
Ravi Lakkavalli - World Quality Report.pptx
Caleb Crandall - Testing Between the Buckets.pptx
Thomas Haver - Mobile Testing.pdf
Thomas Haver - Example Mapping.pdf
Joe Colantonio - Actionable Automation Awesomeness in Testing Farm.pdf
Sarah Geisinger - Continious Testing Metrics That Matter.pdf
Jeff Sing - Quarterly Service Delivery Reviews.pdf
Leandro Melendez - Chihuahua Load Tests.pdf
Rick Clymer - Incident Management.pdf
Robert Fornal - ChatGPT as a Testing Tool.pptx
Federico Toledo - Extra-functional testing.pdf
Andrew Knight - Managing the Test Data Nightmare.pptx
Melissa Tondi - Automation We_re Doing it Wrong.pdf
Jeff Van Fleet and John Townsend - Transition from Testing to Leadership.pdf
DesiradhaRam Gadde - Testers _ Testing in ChatGPT-AI world.pptx
Damian Synadinos - Word Smatter.pdf
Lee Barnes - What Successful Test Automation is.pdf
Jordan Powell - API Testing with Cypress.pptx
Carlos Kidman - Exploring AI Applications in Testing.pptx

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PDF
Encapsulation theory and applications.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
A Presentation on Artificial Intelligence
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
cuic standard and advanced reporting.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
Teaching material agriculture food technology
Encapsulation theory and applications.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Diabetes mellitus diagnosis method based random forest with bat algorithm
A Presentation on Artificial Intelligence
Mobile App Security Testing_ A Comprehensive Guide.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
cuic standard and advanced reporting.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Network Security Unit 5.pdf for BCA BBA.
Reach Out and Touch Someone: Haptics and Empathic Computing
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
20250228 LYD VKU AI Blended-Learning.pptx
Review of recent advances in non-invasive hemoglobin estimation
Digital-Transformation-Roadmap-for-Companies.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectral efficient network and resource selection model in 5G networks
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Per capita expenditure prediction using model stacking based on satellite ima...

Power-Up Your Test Suite with OLE Automation by Joshua Russell

Editor's Notes

  • #10: Microsoft applications, implementation robust. Internet Explorer, IBM Notes, HP ALM/QC
  • #11: Excel is an especially good target for OLE Automation. Ruby gems that manipulate Excel file formats have limitations
  • #12: Mainframe applications for both task automation (test data) and acceptance testing. Rocket Passport, DN-Computing Quick3270, Micro Focus Attachmate Extra! X-treme
  • #13: Automate repetitive tasks and test setup. OLE Automation does not exercise the user interface.
  • #14: OLE Automation = means of manipulating applications directly by accessing objects that they expose || Popular options >> Selenium-webdriver, RAutomation || Several names: COM automation, subset of COM; Previously “OLE Automation”, now “Automation” …Too vague to be helpful. “The Application Interface Formerly Known As OLE Automation”.
  • #15: Created by Microsoft >> Based on a subset of COM, standard for creating software which can communicate >> OLE, grab bag of semi-related functionalities, scripting languages, bunch of languages >> list (Java 3rd party)
  • #16: Client and server model: Automation clients, automation servers
  • #17: An application (a type of COM server) which exposes its functionality through COM interfaces to other applications is an automation server
  • #18: An application which accesses the objects exposed by an automation server is called an automation client
  • #19: Application implements object model. Objects exposed have properties and methods that can be accessed and manipulated. Dictates how automation can interact.
  • #21: ATA!!! How many Ruby devs? The Ruby implementation of OLE Automation is called WIN32OLE. WIN32OLE is not a Ruby gem, it is a part of the Ruby standard library since 1.8
  • #22: WIN32OLE does not need to be installed, just required. Access an OLE object by creating an instance of the WIN32OLE class and providing the program ID of the automation server
  • #23: The program ID is located in the Windows registry
  • #24: Ruby Object methods. Not helpful. OLE methods. Everything you need to know. Use OLE methods to get access to other OLE objects
  • #25: Mainframe automation for data concerns. Cattle, not pets. Selfish data. Repeatable scenarios.
  • #26: As mentioned before, several mainframe terminal emulators support OLE Automation. Quick3270 from DN-Computing, Extra! From Micro Focus, and Passport from Rocket all have published interfaces.
  • #28: TE3270 is a Ruby gem for mainframe automation. Supports a handful of terminal emulators, some using OLE Automation. Except Passport. It doesn’t support Passport, unless you make some creative changes. I’ll link it.
  • #29: TE3270Create classes to represent mainframe screens. Identify fields by row, column, and length. Define custom methods for screen classes
  • #30: Example using Ruby, Cucumber, and the TE3270 gem for data management
  • #31: TE3270 factory methods and simple interactions with screen classes make clean, readable step definitions for Cucumber scenarios that interact with mainframe screens.
  • #32: First scenario wrapper for Ruby code, ease-of-use, second scenario more readable, actual example
  • #33: Launch mainframe, log in, find user, unenroll, reenroll with temp credentials
  • #35: ATA!!! Who manages daily/weekly/monthly reports with Excel? Collections of data? How much time?
  • #36: Follow Ruby basics. What happened? One more step… manipulate the application object
  • #37: There we go! Application -> Workbooks. Methods are like the File menu. Add new, open existing. In this case, open.
  • #38: Workbook immediately visible. Workbooks collection. Access Customers worksheet by index, name. Same for Orders. Add new worksheet.
  • #39: Rows collection, access rows by index.
  • #40: Columns collection, just like Rows. Access by index.
  • #41: Cells collection, again… the same. Access by row, column or by single index
  • #42: Close one workbook or close them all.
  • #43: Quit the application.
  • #44: Charts. Formulas. Formatting. Version control. You can find more information about the capabilities of Excel OLE Automation by referencing the Microsoft documentation of the Excel Object Model…
  • #45: DCOM: OLE Automation over network, Event handling with “sink interfaces”, A subset of the COM interface is implemented on Apple’s Core Foundation