blob: 6c801436d14d05de482f07aa0594c763401a8083 [file] [log] [blame]
<!DOCTYPE html>
<head>
<title>RCPTT Documentation Center</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://www.eclipse.org/rcptt/shared/css/bootstrap.min.css">
<link rel="stylesheet" href="https://www.eclipse.org/rcptt/shared/css/main.css">
<link rel="stylesheet" href="https://www.eclipse.org/rcptt/shared/css/prism.css">
<link rel="icon" href="https://www.eclipse.org/rcptt/shared/img/favicon.ico">
<script src="https://www.eclipse.org/rcptt/shared/js/jquery.min.js"></script>
<script src="https://www.eclipse.org/rcptt/shared/js/bootstrap.min.js"></script>
<script src="https://www.eclipse.org/rcptt/shared/js/prism.js"></script>
<script src="https://www.eclipse.org/rcptt/shared/js/ecl.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-39589807-5', 'eclipse.org');
ga('send', 'pageview');
</script>
</head>
<body>
<div id="before-footer">
<header>
<nav class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">RCPTT Documentation Center</span>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active" >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/getstarted">User Guide</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/faq/">FAQ</a>
</li>
<li>
<a href="http://eclipse.org/rcptt">Back to RCPTT Main Site</a>
</li>
<li>
<a href="http://eclipse.org">Eclipse.org</a>
</li>
</ul>
</div>
</nav>
</header>
<section class="content">
<div class="container">
<div class="row">
<div class="col-sm-3">
<div class="rcptt-sidebar">
<ul class="nav">
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/getstarted/">Get Started</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/testeditor/">Test Case Editor</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/controlpanel">Control Panel</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/assertions/">Assertions</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/ecl/">Eclipse Command Language</a>
<ul class="nav">
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/ecl/new-command-guide/">New ECL Command Guide</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/ecl/excel-import-export/">ECL commands for Excel import and export</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/ecl/xml-import-export/">ECL commands for XML import and export</a>
</li>
</ul>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/">Contexts</a>
<ul class="nav">
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/workspace/">Workspace</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/workbench/">Workbench</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/launch/">Launch</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/preferences/">Preferences</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/parameters/">Parameters</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/group/">Group</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/folder/">Folder</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/default/">Default</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/super/">Super</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/contexts/ecl/">ECL Script</a>
</li>
</ul>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/verifications/">Verifications</a>
<ul class="nav">
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/verifications/text/">Text</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/verifications/treetable/">Table/Tree</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/verifications/errorlog/">Error Log</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/verifications/time/">Time</a>
</li>
</ul>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/procedures/">Procedures and Variables</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/runner/">Test Runner</a>
<ul class="nav">
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/runner/arguments/">Arguments</a>
</li>
</ul>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/maven/">Maven plugin</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/rap/">RAP</a>
<ul class="nav">
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/rap/install/">Install instructions</a>
</li>
<li class="active" >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/rap/recordReplay/">Record and Replay</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/rap/capability/">Capability Contexts</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/rap/rap-commands/">ECL commands</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/rap/rap-maven/">Maven plugin</a>
</li>
</ul>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/userguide/integration/">Integration</a>
<ul class="nav">
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/integration/test-rail-integration/">TestRail</a>
</li>
<li >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/integration/zephyr-integration/">Zephyr</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="col-sm-9">
<h1>Recording and Replay</h1>
<p></p>
<p>Recording &amp; Replay are performed same way as in RCPTT.</p>
<h3>Long UI operation:</h3>
<p>RCPTT execute ECL commands when command execution is allowed by set of criteria. For RAP applications we also added a round-robin criteria with request from UI to the server. Some UI operations can be executed in several requests.</p>
<p>Some long running operations are could not be tracked automatically, example of such operation is Login. So at replay we need to add a <b>“wait -ms”</b> instruction manually.</p>
<p><b><i>Login example snippet:</i></b></p>
<p></p>
<pre ><code class="language-ecl">&#x200b;//wait is is long operation
with [get-window Login] {
get-editbox -after [get-label "Username:"] | set-text admin
get-editbox -after [get-label "Password:"] |
set-text [decrypt "/CLWiEOG/UO3teVLLK29Pg=="]
get-button Login | click
}
wait 1000
</code></pre>
<p><b># Now we can work as expected.</b></p>
<h3>ECL Commands for Download testing.</h3>
<p>To test file downloading, it is necessary to contact Product engineers and ask for a list of Identifiers of RAP handler implemented for downloading. The ids of a handlers. It is necessary as in RAP there are no strict mechanism for downloading and everything occurs through data recording in HttpResponse.</p>
<p>To set identifier for handler we provide a ECL command:
</p>
<pre ><code class="language-ecl">&#x200b;mark-download-handler "handler.id"
</code></pre>
<p>Execution of this command is required to perform in context before recording a new download test scenario.</p>
<p>During downloading of files the majority of browsers open special download dialog.
It results access to which it is impossible to get through a code in need to interfere the user. 
In case of reproduction of tests it isn't admissible.

Therefore when the test replaying for file downloading is used special ECL command:
</p>
<pre ><code class="language-ecl">&#x200b;download-file
</code></pre>
<p>The command executes download handler with URL. 
This command is wrapped in <pre ><code class="language-ecl">&#x200b;exec-without-js
</code></pre>
ECL command which skip execution of JavaScript via RAP. It is necessary for prevention of opening the browser download file dialog. If Download is implemented by HTML this step is not necesesary.</p>
<p>A download handler should support a special parameters to allow verification via RCPTT of downloadable content.</p>
<p><b><i>Download example:</i></b></p>
<p></p>
<pre ><code class="language-ecl">&#x200b;exec-without-js {
// this command move inside to exec-without-js because call
// window.location = download_url for download file
get-window "Transformation complete" | get-button OK | click
download-file -handlerId "xclinical.common.eclipse.util.RapFileDownload" -url "/?servicehandler=xclinical.common.eclipse.util.RapFileDownload&amp;cid=6b612c18&amp;filename=23f3b14e-4f74-48c6-a0d4-da6aa7af161c&amp;output=Default.Study.OID%20-%20Default.MDV.OID.html"
| match-binary -base64 "PGh0bWwgeG1sbnM6ZGF0ZT0iaHR0"
+ "cDovL2V4c2x0Lm9yZy9kYXRlcy1hb"
+ "mQtdGltZXMiIHhtbG5zOnhjPSJodHRwOi…" | verify-true
}
</code></pre>
<p>For validation the contents of downloading file, you should to transform file to a string (use command <b>to-string</b>). Then it is possible to use any command which process strings (as example <b>contains</b>).</p>
<p><b><i>Example:</i></b></p>
<p></p>
<pre ><code class="language-ecl">&#x200b;download-file -handlerId "id" -url "/?servicehandler=download.handler" | to-string "UTF-8" | contains "foo string" | verify-true
</code></pre>
<p><b><i>or:</i></b></p>
<p></p>
<pre ><code class="language-ecl">&#x200b;download-file -handlerId "id" -url "/?servicehandler=download.handler" | to-string "UTF-8" | mathing "regexp string" | verify-true
</code></pre>
<h3>Upload file:</h3>
<ol>
<li>Start a test record. Login. In the RAP application select <b>File->Import</b> menu item.</li>
</ol>
<p><img src="https://www.eclipse.org/rcptt/shared/img/rap/pasted-image-76.png"></img>
<br><br></p>
<ol start="2">
<li>Choose files for uploading on your computer, and press Ok button.</li>
</ol>
<p><img src="https://www.eclipse.org/rcptt/shared/img/rap/pasted-image-79.png"></img>
<br><br></p>
<ol start="3">
<li>RCPTT automatically create an ECL command for uploading file - <b>upload-result</b>. (Important: the upload command register before click to the Ok button command, such sequence is necessary for replay).</li>
</ol>
<p><img src="https://www.eclipse.org/rcptt/shared/img/rap/pasted-image-67.png" width="800"></img>
<br><br></p>
<ol start="4">
<li>When test will replay, The file upload dialog won't be open, this upload behaviour will emulate programmatically.</li>
</ol>
</div>
</div>
</div>
</section>
<script src="https://www.eclipse.org/rcptt/shared/js/main.js"></script>
</body>