logo资料库

ranorex使用教程.pdf

第1页 / 共486页
第2页 / 共486页
第3页 / 共486页
第4页 / 共486页
第5页 / 共486页
第6页 / 共486页
第7页 / 共486页
第8页 / 共486页
资料共486页,剩余部分请下载后查看
Ranorex Studio - The Layout
Studio Start Page
Working Environment
#1 - Projects View
#2 - Module Browser
#3 - File View
Lesson 1: Getting Started
Preparing to Record User Actions
System Under Test: KeePass Password Safe
Recording a Test
Analyzing Recorded Steps
Executing the Test
Lesson 2: Ranorex Modules - Test Actions
Lesson 3: Data-Driven Testing
Using Variables within Recordings
Using Variables within the Repository
Creating Test Data
Combining Variables with Test Data
Combining Variables with Parameters
Invoking Actions: Selection
Executing Data Driven Tests
Lesson 4: Ranorex Test Suite
Test Suite Editor
Module Group Editor
General Structure of a Test Suite and its Test Cases
Running a Test Suite - Run Configurations
Running Tests without Ranorex Studio
Test Suite Settings
Test Case Settings
Using Data in Test Suites
Lesson 5: Ranorex Recorder
Before Starting to Record
During Recording
After Recording
Replay and Debug Actions
Recorder Variables
User Code Actions
Additional Editing Options
Image-Based Automation
Lesson 6: UI Mapping with Ranorex Repository
Adapting an Existing Repository
Adding Repository Items
Waiting for UI Elements - Repository Timeouts
Editing RanoreXPath
Repository Separation
Repository Settings Dialog
Repository Item Properties
Lesson 7: Code Modules
Creating Code Modules
Using Repository within Code Module
Accessing Screen Shots within Code Modules
Using Variables with Code Modules
Using Code Modules within Test Cases
Lesson 8: Reporting
Reading Ranorex Reports
Report Levels
Logging Individual Information
Updating the Custom Report Format
Create a Custom Report Template
Lesson 9: Ranorex Spy
Short Introduction to the Structure of RanoreXPath
Capture Screenshot Files for Image-Based Search
Tracking UI Elements
RanoreXPath Edit Mode
The Path Editor
Creating Ranorex Snapshot Files
General Ranorex Settings
General settings
Advanced Settings
Recorder Settings
Repository Settings
Imaging Settings
Plug-In Specific Settings
Code Examples
Using Repository in Code
Wait for UI Elements Using Repository
Create Adapters to Access More Properties and Methods
Create a List of Adapters From a Repository Element
Using Validate Class
Forcing a Test Case to Fail
Set Up Automation Speed
Accessing Test Case & Test Suite Context
Advanced Code Examples
How to do image based automation
How to find and compare images
Handling unexpected Dialogs
Advanced Validation - Clipboard
Advanced Validation - Whole Table
Advanced Validation - File (text-based)
Advanced Validation - File (non text-based, binary)
Advanced Validation - Database (Single Field)
Advanced Validation - Database (Whole Table)
Advanced Validation - XML code
Data Connectors
Manage Data Sources
Kind of Data Connectors
Simple Data Table
CSV File
SQL Connector
Excel File
Instrumentation Wizard
Running Instrumentation Wizard from the Command Line
Java AWT/Swing
Adobe Flash/Flex
Mozilla Firefox
Google Chrome
Apple Safari
Android
iOS
Working with 2.X Projects in Ranorex Test Suites
Adding 2.X Projects
Using 2.X Recording Modules
Adapting 2.X Data-Driven Recording Modules
Using 2.X Code Modules
Breaking Changes
Technology Instrumentation
Flash/Flex Testing
Testing of Java Applications
Qt Testing
Testing of Legacy Applications
Testing of SAP Applications
General Troubleshooting
RanoreXPath
RanoreXPath Syntax Examples
Advanced RanoreXPath Example
RanoreXPath with Regular Expressions
RanoreXPath Weight Rule Library
Why RanoreXPath Weight Rules
How to Add Your Own RanoreXPath Weight Rule
How to Add Shared RanoreXPath Weight Rules
Rule Library
Ranorex UI Adapter
Multiple Adapters for one GUI element
Mobile Testing
Introduction
Getting Started
Versioning
Mobile Download Archive
Android Testing
Infrastructure
Getting Started
Record and Run an Android Test
Manage Devices
Non-UI Testing on Android
Run Your Test on Any Android Device
Testing of Mobile Websites on Android
Troubleshooting
Instrumentation with Source Code
iOS Testing
Infrastructure
Getting Started
Record and Run an iOS Test
Instrumentation and Preparation
Non-UI Testing on iOS
Run a Test on Any iOS Device
Testing of Mobile Websites on iOS
Web Testing
Architecture of Websites in the Ranorex Framework
Find or filter Web Elements
Cross-Browser Testing
Recordings & Repositories
Samples
Source Control
Add a Solution to Source Control
Check Out a Solution from Source Control
Open an existing Ranorex TFS Solution with Visual Studio
Open existing Visual Studio TFS Solution with Ranorex
Integration
Introduction
Continuous Integration
Test Management and Application Lifecycle tools
Source Control / Revision Control
Ranorex Studio IDE
Create
Build
Run
Adding New Items
Solution Explorer
Debugging
Code Completion
Code Conversion
Code Navigation
Code Generation
Refactoring
Visual Studio Integration
Create a new Visual Studio project
Add Ranorex core assemblies as references
Write some Ranorex automation code
System Requirements
64-bit Platforms
Remotely Working with Ranorex
Do not Automate via Remote Desktop Window
Do not Close or Minimize the RDP Window
Disable Mouse/Keyboard Activities
Use same Color and Resolution Settings
Increase Timeouts on Virtual Machines
Silent Installation of Ranorex
Installation Packages
Installation Command Line Arguments
Install Ranorex License
Licensing
License Registration
Installing a Node Locked License
Installing a Floating License
Uninstall License
Transfer Licenses
FAQ
How does Ranorex identify UI elements?
Is it possible to run the same Ranorex test code on Vista and XP?
Is it required to use RanoreXPath for test automation?
Does Ranorex support data driven testing?
What to do when items can't be found during Ranorex test execution?
Is it possible to extend recordings with user specified code actions?
What is the difference between Adapter and Element?
Is it possible to trigger Ranorex tests from an existing test or build environment?
Can I use Ranorex libraries within Visual Studio?
What shall I do with unexpected dialogs and popup windows during test automation?
Is it possible to test Silverlight applications with Ranorex?
Is it possible to automate a webpage without moving the mouse pointer?
What are the system requirements for developing and running Ranorex tests?
Are there known incompatibilities with other software?
®RanorexTest Automation Guide
Ranorex Test Automation Guide © Copyright 2014 Ranorex GmbH Created on: November 25, 2014 Ranorex Version: 5.2 Authors: Roland Enzinger, Christoph Preschern, Tobias Walter Special Thanks to: Michael Gissing, Alexander Hoisl
Contents Ranorex Studio - The Layout Studio Start Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Working Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #1 - Projects View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #2 - Module Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . #3 - File View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 4 5 5 6 Lesson 1: Getting Started 9 Preparing to Record User Actions 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . System Under Test: KeePass Password Safe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Recording a Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Analyzing Recorded Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Executing the Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Lesson 2: Ranorex Modules - Test Actions 23 Lesson 3: Data-Driven Testing 26 Using Variables within Recordings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Using Variables within the Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Creating Test Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Combining Variables with Test Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Combining Variables with Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Invoking Actions: Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Executing Data Driven Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Lesson 4: Ranorex Test Suite 44 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Test Suite Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Module Group Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 General Structure of a Test Suite and its Test Cases Running a Test Suite - Run Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Running Tests without Ranorex Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Test Suite Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Test Case Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Using Data in Test Suites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Lesson 5: Ranorex Recorder 72 Before Starting to Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 During Recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 After Recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Replay and Debug Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Recorder Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 User Code Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Additional Editing Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 Image-Based Automation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Lesson 6: UI Mapping with Ranorex Repository 124 Adapting an Existing Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 Adding Repository Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 Waiting for UI Elements - Repository Timeouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 Editing RanoreXPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 Repository Separation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 Repository Settings Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 Repository Item Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 Lesson 7: Code Modules 154 Creating Code Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 I
Using Repository within Code Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 Accessing Screen Shots within Code Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 Using Variables with Code Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Using Code Modules within Test Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 Lesson 8: Reporting 165 Reading Ranorex Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 Report Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 Logging Individual Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 Updating the Custom Report Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Create a Custom Report Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 Lesson 9: Ranorex Spy 179 Short Introduction to the Structure of RanoreXPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 Capture Screenshot Files for Image-Based Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 Tracking UI Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 RanoreXPath Edit Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 The Path Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 Creating Ranorex Snapshot Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212 General Ranorex Settings 215 General settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 Advanced Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 Recorder Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 Repository Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 Imaging Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 Plug-In Specific Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 Code Examples 225 Using Repository in Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 Wait for UI Elements Using Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 Create Adapters to Access More Properties and Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 Create a List of Adapters From a Repository Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 Using Validate Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 Forcing a Test Case to Fail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 Set Up Automation Speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 Accessing Test Case & Test Suite Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 Advanced Code Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 How to do image based automation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 How to find and compare images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 Handling unexpected Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 Advanced Validation - Clipboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 Advanced Validation - Whole Table Advanced Validation - File (text-based) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 Advanced Validation - File (non text-based, binary) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241 Advanced Validation - Database (Single Field) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 Advanced Validation - Database (Whole Table) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 Advanced Validation - XML code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 Data Connectors 250 Manage Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 Kind of Data Connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 Simple Data Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 CSV File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 SQL Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 Excel File Instrumentation Wizard 261 II
Running Instrumentation Wizard from the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . 263 Java AWT/Swing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 Adobe Flash/Flex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 Mozilla Firefox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 Google Chrome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 Apple Safari . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 Android . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 iOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 Working with 2.X Projects in Ranorex Test Suites 288 Adding 2.X Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 Using 2.X Recording Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 Adapting 2.X Data-Driven Recording Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 Using 2.X Code Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 Breaking Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 Technology Instrumentation 293 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 Flash/Flex Testing Testing of Java Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 Qt Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 Testing of Legacy Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 Testing of SAP Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 General Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 RanoreXPath 312 RanoreXPath Syntax Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 Advanced RanoreXPath Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 RanoreXPath with Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 RanoreXPath Weight Rule Library 318 Why RanoreXPath Weight Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 How to Add Your Own RanoreXPath Weight Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 How to Add Shared RanoreXPath Weight Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 Rule Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 Ranorex UI Adapter 323 Multiple Adapters for one GUI element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 Mobile Testing 329 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 Versioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 Mobile Download Archive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 331 Android Testing Infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 Record and Run an Android Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340 Manage Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347 Non-UI Testing on Android . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357 Run Your Test on Any Android Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 Testing of Mobile Websites on Android . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367 Instrumentation with Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 iOS Testing 370 Infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371 III
Record and Run an iOS Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372 Instrumentation and Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 Non-UI Testing on iOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398 Run a Test on Any iOS Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400 Testing of Mobile Websites on iOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404 Web Testing 406 Architecture of Websites in the Ranorex Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406 Find or filter Web Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408 Cross-Browser Testing Recordings & Repositories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411 Samples Source Control 415 Add a Solution to Source Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 Check Out a Solution from Source Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426 Open an existing Ranorex TFS Solution with Visual Studio . . . . . . . . . . . . . . . . . . . . . . . . . . 429 Open existing Visual Studio TFS Solution with Ranorex . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 Integration 433 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 Continuous Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 Test Management and Application Lifecycle tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 Source Control / Revision Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 Ranorex Studio IDE 435 Create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438 Run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441 Adding New Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442 Solution Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448 Code Completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453 Code Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454 Code Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455 Code Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456 Refactoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457 Visual Studio Integration 458 Create a new Visual Studio project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458 Add Ranorex core assemblies as references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458 Write some Ranorex automation code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459 System Requirements 64-bit Platforms 461 463 Remotely Working with Ranorex 464 Do not Automate via Remote Desktop Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464 Do not Close or Minimize the RDP Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464 Disable Mouse/Keyboard Activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464 Use same Color and Resolution Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465 Increase Timeouts on Virtual Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465 Silent Installation of Ranorex 466 Installation Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466 Installation Command Line Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466 Install Ranorex License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467 IV
Licensing 468 License Registration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468 Installing a Node Locked License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468 Installing a Floating License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470 Uninstall License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472 Transfer Licenses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474 FAQ 477 How does Ranorex identify UI elements? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477 Is it possible to run the same Ranorex test code on Vista and XP? . . . . . . . . . . . . . . . . . . . . . . 477 Is it required to use RanoreXPath for test automation? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477 Does Ranorex support data driven testing? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478 What to do when items can’t be found during Ranorex test execution? . . . . . . . . . . . . . . . . . . . . 478 Is it possible to extend recordings with user specified code actions? . . . . . . . . . . . . . . . . . . . . . . 478 What is the difference between Adapter and Element? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478 Is it possible to trigger Ranorex tests from an existing test or build environment? . . . . . . . . . . . . . . 478 Can I use Ranorex libraries within Visual Studio? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479 What shall I do with unexpected dialogs and popup windows during test automation? . . . . . . . . . . . . 479 Is it possible to test Silverlight applications with Ranorex? . . . . . . . . . . . . . . . . . . . . . . . . . . 479 Is it possible to automate a webpage without moving the mouse pointer? . . . . . . . . . . . . . . . . . . 479 What are the system requirements for developing and running Ranorex tests? . . . . . . . . . . . . . . . . 479 Are there known incompatibilities with other software? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479 V
Ranorex Studio - The Layout Ranorex Studio - The Layout This initial lesson will introduce the main components of the Ranorex Studio environment. Studio Start Page When Ranorex Studio opens up, the start page provides the following possibilities: ˆ Accessing recently opened projects ˆ Directly creating new test solutions ˆ Accessing product samples (see below) ˆ Directly opening existing solutions ˆ Performing a search in documentation and forums ˆ Downloading the latest version of Ranorex ˆ Reading latest news posts ˆ Seeing latest blog posts Figure 1: Ranorex Studio Startpage 1
分享到:
收藏