blob: 37f506f5211b085d62a762e230ed5857c5b8387f [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 >
<a href="https://www.eclipse.org/rcptt/documentation/userguide/getstarted">User Guide</a>
</li>
<li class="active" >
<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/faq/pass-value/">How to pass a value to a test during its execution?</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/faq/install-as-plugin/">Can RCPTT be installed as an Eclipse plugin?</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/faq/resize-window/">How to resize a window?</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/faq/extract-widget/">How to extract an SWT widget from ECL command?</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/faq/verify-control-size/">How to verify changing control sizes?</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/faq/suite-order/">Is it possible to order tests in a Test Suite?</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/faq/runtime-features/">What does each runtime feature stand for?</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/faq/get-property-raw/">What is the difference between Assert and Verify commands or how to get raw property values?</a>
</li>
<li ><a href="https://www.eclipse.org/rcptt/documentation/faq/assert-native-message-box">How to assert native message boxes?</a>
</li>
</ul>
</div>
</div>
<div class="col-sm-9">
<h1>How to assert native message boxes?</h1>
<p></p>
<div class="panel panel-default">
<div class="panel-body">
<i> I want to record the "Information" message box which pops up in my tool.
<br> How to use assert in this automation?
</i>
</div>
</div>
<p>Dealing with native message boxes, RCPTT might not show them during replay,
but instead remember its return value during recording (by adding a command 'set-dialog-result' to a script)
and automatically 'substitute' its value to your application's caller code (we have to do that, because RCPTT
does not work on an operating system level, hence if it would open this dialog, there won't be a way to automatically close it).</p>
<p>But sometimes it may be needed to verify some properties of native message box like 'title' or 'message text'.</p>
<p>Now you can do it using <a href="https://ci.eclipse.org/rcptt/job/master/lastSuccessfulBuild/artifact/releng/doc/target/doc/ecl/index.html#get-last-message-box">get-last-message-box</a> ECL command.</p>
<p>Please note that this command can't be automatically recorded (you still can't select message box in assertion mode), instead, you should manually insert it into your test script:</p>
<p></p>
<pre ><code class="language-ecl">&#x200b;set-dialog-result MessageBox 128
get-view "Q7 Quality Mockups" | get-group "MessageBox Test" | get-button "Message Box with YES/NO Buttons" | click
get-last-message-box | get-property title | equals "Warning" | verify-true
get-last-message-box | get-property message | equals "This MessageBox with warning" | verify-true
</code></pre>
</div>
</div>
</div>
</section>
<script src="https://www.eclipse.org/rcptt/shared/js/main.js"></script>
</body>