simpleExample.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. <!DOCTYPE html>
  2. <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
  3. <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Jump-start into worry free production deployments &mdash; baangt 2020.3.0.rc4 documentation</title>
  8. <script type="text/javascript" src="_static/js/modernizr.min.js"></script>
  9. <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
  10. <script type="text/javascript" src="_static/jquery.js"></script>
  11. <script type="text/javascript" src="_static/underscore.js"></script>
  12. <script type="text/javascript" src="_static/doctools.js"></script>
  13. <script type="text/javascript" src="_static/language_data.js"></script>
  14. <script type="text/javascript" src="_static/js/theme.js"></script>
  15. <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  16. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  17. <link rel="index" title="Index" href="genindex.html" />
  18. <link rel="search" title="Search" href="search.html" />
  19. <link rel="next" title="Structure of baangt" href="Structure.html" />
  20. <link rel="prev" title="What is baangt" href="OverviewUsage.html" />
  21. </head>
  22. <body class="wy-body-for-nav">
  23. <div class="wy-grid-for-nav">
  24. <nav data-toggle="wy-nav-shift" class="wy-nav-side">
  25. <div class="wy-side-scroll">
  26. <div class="wy-side-nav-search" >
  27. <a href="index.html" class="icon icon-home"> baangt
  28. </a>
  29. <div role="search">
  30. <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
  31. <input type="text" name="q" placeholder="Search docs" />
  32. <input type="hidden" name="check_keywords" value="yes" />
  33. <input type="hidden" name="area" value="default" />
  34. </form>
  35. </div>
  36. </div>
  37. <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  38. <p class="caption"><span class="caption-text">Contents:</span></p>
  39. <ul class="current">
  40. <li class="toctree-l1"><a class="reference internal" href="Installation.html"> Installation</a></li>
  41. <li class="toctree-l1"><a class="reference internal" href="OverviewUsage.html"> Overview</a></li>
  42. <li class="toctree-l1 current"><a class="current reference internal" href="#"> First Steps</a><ul>
  43. <li class="toctree-l2"><a class="reference internal" href="#prerequisits">Prerequisits</a></li>
  44. <li class="toctree-l2"><a class="reference internal" href="#let-s-dive-right-into-it">Let’s dive right into it</a><ul>
  45. <li class="toctree-l3"><a class="reference internal" href="#extend-the-script">Extend the Script:</a></li>
  46. <li class="toctree-l3"><a class="reference internal" href="#a-bit-further">A bit further</a></li>
  47. <li class="toctree-l3"><a class="reference internal" href="#recording-a-test-case-with-katalon-recorder">Recording a test case with Katalon Recorder</a></li>
  48. </ul>
  49. </li>
  50. <li class="toctree-l2"><a class="reference internal" href="#tweaking-the-result">Tweaking the result</a><ul>
  51. <li class="toctree-l3"><a class="reference internal" href="#more-details-on-activities">More details on Activities</a></li>
  52. </ul>
  53. </li>
  54. </ul>
  55. </li>
  56. <li class="toctree-l1"><a class="reference internal" href="Structure.html"> Structure</a></li>
  57. <li class="toctree-l1"><a class="reference internal" href="ParametersConfigFile.html"> Parameters</a></li>
  58. <li class="toctree-l1"><a class="reference internal" href="DataFile.html"> Data file</a></li>
  59. <li class="toctree-l1"><a class="reference internal" href="SimpleAPI.html"> First API Test</a></li>
  60. <li class="toctree-l1"><a class="reference internal" href="TestTypes.html"> Types of Tests</a></li>
  61. <li class="toctree-l1"><a class="reference internal" href="Developer.html"> For Developers</a></li>
  62. <li class="toctree-l1"><a class="reference internal" href="HistoryAndReasons.html"> History</a></li>
  63. <li class="toctree-l1"><a class="reference internal" href="contributors.html"> Contributions</a></li>
  64. <li class="toctree-l1"><a class="reference internal" href="changelog.html"> Changelog</a></li>
  65. <li class="toctree-l1"><a class="reference internal" href="PlannedFeatures.html"> Planned Features</a></li>
  66. <li class="toctree-l1"><a class="reference internal" href="BrowserDrivers.html"> Browser Drivers</a></li>
  67. <li class="toctree-l1"><a class="reference internal" href="articles/Articles.html"> :subheader: Articles</a></li>
  68. <li class="toctree-l1"><a class="reference external" href="http://www.baangt.org"> Web</a></li>
  69. </ul>
  70. </div>
  71. </div>
  72. </nav>
  73. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
  74. <nav class="wy-nav-top" aria-label="top navigation">
  75. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  76. <a href="index.html">baangt</a>
  77. </nav>
  78. <div class="wy-nav-content">
  79. <div class="rst-content">
  80. <div role="navigation" aria-label="breadcrumbs navigation">
  81. <ul class="wy-breadcrumbs">
  82. <li><a href="index.html">Docs</a> &raquo;</li>
  83. <li>Jump-start into worry free production deployments</li>
  84. <li class="wy-breadcrumbs-aside">
  85. <a href="_sources/simpleExample.rst.txt" rel="nofollow"> View page source</a>
  86. </li>
  87. </ul>
  88. <hr/>
  89. </div>
  90. <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
  91. <div itemprop="articleBody">
  92. <div class="section" id="jump-start-into-worry-free-production-deployments">
  93. <h1>Jump-start into worry free production deployments<a class="headerlink" href="#jump-start-into-worry-free-production-deployments" title="Permalink to this headline">¶</a></h1>
  94. <p>You can try baangt right away and see how it works. It’ll take less than 5 minutes.</p>
  95. <div class="section" id="prerequisits">
  96. <h2>Prerequisits<a class="headerlink" href="#prerequisits" title="Permalink to this headline">¶</a></h2>
  97. <ul class="simple">
  98. <li><p>Chrome installed</p></li>
  99. <li><p>Python3 installed</p></li>
  100. <li><p><code class="docutils literal notranslate"><span class="pre">baangt</span></code> installed (either via PIP or from the GIT-Repository at <a class="reference external" href="https://gogs.earthsquad.global/athos/baangt">https://gogs.earthsquad.global/athos/baangt</a>)</p></li>
  101. </ul>
  102. <p>If you prefer running <code class="docutils literal notranslate"><span class="pre">baangt</span></code> inside Docker, use the Dockerfile from <a class="reference external" href="https://gogs.earthsquad.global/athos/baangt-Docker">https://gogs.earthsquad.global/athos/baangt-Docker</a>.
  103. After downloading the repository, enter <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">build</span></code> and then <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">run</span></code> in the command line.
  104. Once Docker is up, use SVN://localhost:5902 to connect. All features are exactly like you’d install everything on your local machine.</p>
  105. </div>
  106. <div class="section" id="let-s-dive-right-into-it">
  107. <h2>Let’s dive right into it<a class="headerlink" href="#let-s-dive-right-into-it" title="Permalink to this headline">¶</a></h2>
  108. <ul class="simple">
  109. <li><p>Start baangt interactive UI by typing <cite>python baangtIA.py</cite></p></li>
  110. <li><p>In the dropdown “Testrun” chose “SimpleTheInternet.xlsx” and click on “Execute TestRun”</p></li>
  111. <li><dl class="simple">
  112. <dt>What’s happening here is pretty similar to a real world test case:</dt><dd><ul>
  113. <li><p>Browser (in this case Firefox) starts up</p></li>
  114. <li><p>Navigate to a certain web page</p></li>
  115. <li><p>click on a link</p></li>
  116. <li><p>navigate back</p></li>
  117. <li><p>click on other link</p></li>
  118. <li><p>click on several elements of the page (e.g. buttons)</p></li>
  119. <li><p>write a report with summary and details about the test case. You’ll find the report in the root directory of baangt, unless you stated otherwise.</p></li>
  120. </ul>
  121. </dd>
  122. </dl>
  123. </li>
  124. </ul>
  125. <div class="section" id="extend-the-script">
  126. <h3>Extend the Script:<a class="headerlink" href="#extend-the-script" title="Permalink to this headline">¶</a></h3>
  127. <p>For this to work we recommend an XPATH or CSS-plugin for your browser.</p>
  128. <p>Follow these steps to modify the behaviour of the test script:</p>
  129. <ul class="simple">
  130. <li><p>Open “SimpleTheInternet.xlsx” from the baangt root directory in Excel or OpenOffice</p></li>
  131. <li><p>In your browser with activated XPATH or CSS-Plugin head over to <a class="reference external" href="http://the-internet.com">http://the-internet.com</a></p></li>
  132. <li><p>Choose one of the links, that you want to play around with and find the XPATH or CSS from your tool.</p></li>
  133. <li><dl class="simple">
  134. <dt>Copy and paste this ID in the last line of the XLSX in column C (“Locator”).</dt><dd><ul>
  135. <li><p>Column A (“Activity”) should be “CLICK”</p></li>
  136. <li><p>Column B (“LocatorType”) will be either XPATH or CSS depending on your tool</p></li>
  137. </ul>
  138. </dd>
  139. </dl>
  140. </li>
  141. <li><p>Save the XLSX</p></li>
  142. <li><p>Execute the testrun “SimpleTheInternet.xlsx” in <code class="docutils literal notranslate"><span class="pre">baangt</span></code> again.</p></li>
  143. <li><p>Sit back and enjoy your victory!</p></li>
  144. </ul>
  145. <div class="admonition hint">
  146. <p class="admonition-title">Hint</p>
  147. <p>If you want to be able to watch your browser executing each step, we recommend you set the parameter <code class="docutils literal notranslate"><span class="pre">slowExecution</span></code> with value <code class="docutils literal notranslate"><span class="pre">True</span></code> in Globals and re-run the test</p>
  148. </div>
  149. <div class="admonition hint">
  150. <p class="admonition-title">Hint</p>
  151. <p>If you want the browser window to stay open on errors and/or after execution, you can use parameter <code class="docutils literal notranslate"><span class="pre">dontCloseBrowser</span></code> with value <code class="docutils literal notranslate"><span class="pre">True</span></code>
  152. in global settings and run the test again. The browser will stop on errors or when the test run execution stopped.</p>
  153. </div>
  154. </div>
  155. <div class="section" id="a-bit-further">
  156. <h3>A bit further<a class="headerlink" href="#a-bit-further" title="Permalink to this headline">¶</a></h3>
  157. <p>Go ahead and try it out with your personal real-world example of a web-page, web-app or SPA, which you would like to have
  158. reproducable regression tests for.</p>
  159. <p>Of course you could basically follow the steps above, but depending on the length and complexity of the execution, you’ll
  160. definitely enjoy having more tools in your toolbox:</p>
  161. </div>
  162. <div class="section" id="recording-a-test-case-with-katalon-recorder">
  163. <h3>Recording a test case with Katalon Recorder<a class="headerlink" href="#recording-a-test-case-with-katalon-recorder" title="Permalink to this headline">¶</a></h3>
  164. <p>Katalon Recorder is a free browser Add-on for Chrome and Firefox. Installation is simple, just google
  165. <code class="docutils literal notranslate"><span class="pre">Katalon</span> <span class="pre">plugin</span> <span class="pre">&lt;your-browser&gt;</span></code> and install the plugin. After installation of the Katalon recorder follow these steps:</p>
  166. <ul>
  167. <li><p>Start the plugin</p></li>
  168. <li><p>Hit the “record”-Button</p></li>
  169. <li><dl class="simple">
  170. <dt>Execute the activities you want it to record. Usually following these steps:</dt><dd><ul class="simple">
  171. <li><p>Open a Webpage</p></li>
  172. <li><p>Login (optional)</p></li>
  173. <li><p>Navigate to some sub-page</p></li>
  174. <li><p>Click buttons</p></li>
  175. <li><p>Enter values</p></li>
  176. <li><p>Download documents (optional)</p></li>
  177. </ul>
  178. </dd>
  179. </dl>
  180. </li>
  181. <li><p>Stop recording</p>
  182. <div class="admonition hint">
  183. <p class="admonition-title">Hint</p>
  184. <p>You might want to execute the test case from within Katalon Recorder to make sure everything was recorded properly.</p>
  185. </div>
  186. </li>
  187. <li><p>Hit the export-Button of the recorder, chose format <code class="docutils literal notranslate"><span class="pre">other</span></code></p></li>
  188. <li><p>Click “Export to Clipboard”</p></li>
  189. <li><dl class="simple">
  190. <dt>Switch over to <code class="docutils literal notranslate"><span class="pre">baangt</span></code> and press the button “Import KatalonRecorder”</dt><dd><ul class="simple">
  191. <li><p>The contents from the clipboard should be imported already and translation to <code class="docutils literal notranslate"><span class="pre">baangt</span></code> should be completed. If the clipboard was not inserted automatically, click on the button “Import Clipboard” and please drop a ticket stating your operating system incl. version and which browser you used for recording in Katalon recorder.</p></li>
  192. </ul>
  193. </dd>
  194. </dl>
  195. </li>
  196. <li><p>Press “Save” and choose where you want to store the resulting XLSX-File</p></li>
  197. </ul>
  198. <p><strong>That’s it. You just created you first regression test case including all parameters for it.</strong></p>
  199. <p>If you’re wondering which parameters these are, and how you can influence them, fear not! Open the Testcase-XLSX from
  200. the last step above, click on the “data”-Tab and start to enter values and lines as you please.</p>
  201. <p>You can always re-run Baangt after saving your Testrun-XLSX and see your progress.</p>
  202. <div class="admonition hint">
  203. <p class="admonition-title">Hint</p>
  204. <p>If you want to be able to watch your browser executing each step, set the parameter <code class="docutils literal notranslate"><span class="pre">slowExecution</span></code> with value <code class="docutils literal notranslate"><span class="pre">True</span></code> in Globals and re-run the test</p>
  205. </div>
  206. </div>
  207. </div>
  208. <div class="section" id="tweaking-the-result">
  209. <h2>Tweaking the result<a class="headerlink" href="#tweaking-the-result" title="Permalink to this headline">¶</a></h2>
  210. <p>You managed to have a working recording. Congratulations! Let’s learn a bit more about the structure of the created XLSX</p>
  211. <table class="colwidths-given docutils align-default" id="id1">
  212. <caption><span class="caption-text">Fields in Tab <code class="docutils literal notranslate"><span class="pre">TestStepExecution</span></code></span><a class="headerlink" href="#id1" title="Permalink to this table">¶</a></caption>
  213. <colgroup>
  214. <col style="width: 25%" />
  215. <col style="width: 75%" />
  216. </colgroup>
  217. <thead>
  218. <tr class="row-odd"><th class="head"><p>Column Name</p></th>
  219. <th class="head"><p>Description</p></th>
  220. </tr>
  221. </thead>
  222. <tbody>
  223. <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Activtity</span></code></p></td>
  224. <td><p>Sets the activity of this TestStep. Activities are described in more details in next chapter</p></td>
  225. </tr>
  226. <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">LocatorType</span></code></p></td>
  227. <td><p>Most of the activities need a locator. We are big fans of XPATH as locatorType, due to speed and ease of use. Sooner
  228. or later you’ll anyway end up needing XPATH, so why not use it always when there’s no downside? If you prefer
  229. writing CSS-Paths then use value <code class="docutils literal notranslate"><span class="pre">CSS</span></code> for the locator. And if you are lucky enough to have unique IDs in your
  230. page simply use <code class="docutils literal notranslate"><span class="pre">ID</span></code>.</p></td>
  231. </tr>
  232. <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Locator</span></code></p></td>
  233. <td><p>The locator is the specification on which element <code class="docutils literal notranslate"><span class="pre">Activity</span></code> should happen. As in the value fields, you may
  234. use variable replacement here too, in order to replace Locators with values from the data file. For instance the
  235. following would work fine:
  236. <code class="docutils literal notranslate"><span class="pre">//*[&#64;id($(CUSTOMERNUMBER))]</span></code> - this would create an XPATH-Statement where $(CUSTOMERNUMBER) is replaced by the
  237. actual value of the current test record.</p></td>
  238. </tr>
  239. <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Value</span></code></p></td>
  240. <td><p>For instance activity <code class="docutils literal notranslate"><span class="pre">SetText</span></code> requires a value (The text to send to a Web-element). You may use fixed values
  241. (which will rarely happen) or values from your test data source, in the simple cases the sheet <code class="docutils literal notranslate"><span class="pre">Data</span></code> .
  242. The column names in the sheet <code class="docutils literal notranslate"><span class="pre">data</span></code> can be used as variable names (e.g. if you created a column “Quantity” in
  243. your data tab, you can use <code class="docutils literal notranslate"><span class="pre">$(Quantity)</span></code> in the field value.</p></td>
  244. </tr>
  245. <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Comparison</span></code> and <code class="docutils literal notranslate"><span class="pre">Value2</span></code></p></td>
  246. <td><p>For some activities (e.g. IF) you not only need the Value-Field but also a comparison operator and a
  247. second field or value to compare to. Values for <code class="docutils literal notranslate"><span class="pre">comparison</span></code> are <code class="docutils literal notranslate"><span class="pre">eq</span></code> and <code class="docutils literal notranslate"><span class="pre">=</span></code>. The field <code class="docutils literal notranslate"><span class="pre">value2</span></code>
  248. follows the same logic as <code class="docutils literal notranslate"><span class="pre">value</span></code>.</p></td>
  249. </tr>
  250. <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Timeout</span></code></p></td>
  251. <td><p>Sometimes you might to overwrite the default timeout settings of <code class="docutils literal notranslate"><span class="pre">baangt</span></code>. Here’s your chance. Values in seconds,
  252. decimals are OK (<code class="docutils literal notranslate"><span class="pre">0.5</span></code> is a valid value, so is <code class="docutils literal notranslate"><span class="pre">90</span></code>).</p></td>
  253. </tr>
  254. <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Optional</span></code></p></td>
  255. <td><p>Usually when <code class="docutils literal notranslate"><span class="pre">baangt</span></code> tries to execute an activity and can’t (after timeout), it will throw an exception,
  256. report in the Logs and stop the current test case. If you set <code class="docutils literal notranslate"><span class="pre">optional</span></code> to <code class="docutils literal notranslate"><span class="pre">True</span></code> or <code class="docutils literal notranslate"><span class="pre">X</span></code>, <code class="docutils literal notranslate"><span class="pre">baangt</span></code>
  257. will continue execution of the test case, even if the activity wasn’t possible.</p></td>
  258. </tr>
  259. <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Release</span></code></p></td>
  260. <td><p>Often you’ll face situations, where you want to run a test case in several stages (e.g. DEV, Pre-Quality, Quality,
  261. Migration, Pre-Production, etc.) and the software version on each stage is different. A test case, that works on
  262. Pre-Production will not pass on Dev-System as Dev is already further developed. If you change the test case to work
  263. on Dev-System and you need to test a Hotfix deployment on Pre-Production, what will you do? In other test solutions
  264. you would “simply” copy your test case, have one version for DEV, one for Pre-Production. Do that with hundreds of
  265. different test cases and watch yourself drown in chaos. OR you could use <code class="docutils literal notranslate"><span class="pre">baangt</span></code> where this problem is solved.
  266. Software moves through the stages of your system landscape as it evolves. Use this field to conditionally execute
  267. different “branches” of your test cases, depending on the version on the current stage. <code class="docutils literal notranslate"><span class="pre">Release</span></code> can be any
  268. string value. You can add “&gt; ” “&lt; ” and “= ” as the first 2 characters to signal to <code class="docutils literal notranslate"><span class="pre">baangt</span></code> to only execute
  269. the step when current release is greater than, lower than or exactly equal to the value afterwards, for instance</p>
  270. <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&gt;</span> <span class="mf">2019.05</span>
  271. </pre></div>
  272. </div>
  273. <p>will run the line only, if the Version is <code class="docutils literal notranslate"><span class="pre">2019.05a</span></code> or <code class="docutils literal notranslate"><span class="pre">2019.06</span></code>. We are aware, that your version numbers might
  274. follow different nomenclature, so we made it very easy to subclass the corresponding logic.</p>
  275. </td>
  276. </tr>
  277. </tbody>
  278. </table>
  279. <div class="section" id="more-details-on-activities">
  280. <h3>More details on Activities<a class="headerlink" href="#more-details-on-activities" title="Permalink to this headline">¶</a></h3>
  281. <blockquote>
  282. <div><ul class="simple">
  283. <li><p>GoToURL</p></li>
  284. <li><p>click</p></li>
  285. <li><p>setText</p></li>
  286. <li><p>SetTextIF</p></li>
  287. <li><p>clickIF</p></li>
  288. <li><p>goBack</p></li>
  289. <li><p>If</p></li>
  290. <li><p>EndIf</p></li>
  291. <li><p>Pause</p></li>
  292. <li><p>Assert</p></li>
  293. <li><p>address_create</p></li>
  294. </ul>
  295. </div></blockquote>
  296. <table class="colwidths-given docutils align-default" id="id2">
  297. <caption><span class="caption-text">Details of activities</span><a class="headerlink" href="#id2" title="Permalink to this table">¶</a></caption>
  298. <colgroup>
  299. <col style="width: 25%" />
  300. <col style="width: 75%" />
  301. </colgroup>
  302. <thead>
  303. <tr class="row-odd"><th class="head"><p>Activity</p></th>
  304. <th class="head"><p>Description</p></th>
  305. </tr>
  306. </thead>
  307. <tbody>
  308. <tr class="row-even"><td><p>GoToURL</p></td>
  309. <td><p>Navigate to the given URL. Column <code class="docutils literal notranslate"><span class="pre">Value</span></code> must provide the URL. You might want to use variables in your URL-String,
  310. for instance your URL might look like this <code class="docutils literal notranslate"><span class="pre">https://$(STAGE).earthsquad.global/</span></code>. It will be replaced
  311. during runtime of the test data with the value of <code class="docutils literal notranslate"><span class="pre">STAGE</span></code> from either Global settings or settings in the
  312. <code class="docutils literal notranslate"><span class="pre">testCaseSequence</span></code>.</p></td>
  313. </tr>
  314. <tr class="row-odd"><td><p>click</p></td>
  315. <td><p>Will click on the object specified by the <code class="docutils literal notranslate"><span class="pre">locator</span></code>.</p></td>
  316. </tr>
  317. <tr class="row-even"><td><p>clickIF</p></td>
  318. <td><p>Will click on the object specified by the locator IF the field in testDataDict, that you enter in Column <code class="docutils literal notranslate"><span class="pre">value</span></code>
  319. has a value. This small and simple extension can save you hours and hours of work in maintenance of testcases.
  320. Imagine you have 10 checkboxes, that in various combinations provide different test results, and you have to test
  321. all possible combinations. Using one column in your datafile for each checkbox and the <code class="docutils literal notranslate"><span class="pre">clickif</span></code>, you can create
  322. your testCases in minutes instead of hours or days. Imagine 50 checkboxes - with <code class="docutils literal notranslate"><span class="pre">baangt</span></code> your effort is still
  323. just minutes.</p></td>
  324. </tr>
  325. <tr class="row-odd"><td><p>setText</p></td>
  326. <td><p>Write the text given in column <code class="docutils literal notranslate"><span class="pre">value</span></code> to the element specified by <code class="docutils literal notranslate"><span class="pre">locator</span></code>. Only rarely will you have fixed
  327. values. Usually you’ll assign columns of the test data using variable replacement (e.g. <code class="docutils literal notranslate"><span class="pre">$(POSTCODE)</span></code> to set the
  328. text from column <code class="docutils literal notranslate"><span class="pre">POSTCODE</span></code> from the datafile into the destination element.</p></td>
  329. </tr>
  330. <tr class="row-even"><td><p>setTextIF</p></td>
  331. <td><p>Same as SetText, but will only do something in cases where there is a value in the datafile. Similarly to clickIF
  332. this little helper functionality can help you save hours and hours in creation and maintenance of rocksolid and
  333. bulletproof test cases.</p></td>
  334. </tr>
  335. <tr class="row-odd"><td><p>goBack</p></td>
  336. <td><p>Trigger the “back”-Button of the browser.</p></td>
  337. </tr>
  338. <tr class="row-even"><td><p>If/Endif</p></td>
  339. <td><p>The block between IF and ENDIF is only executed when the condition evaluated by <code class="docutils literal notranslate"><span class="pre">value|comparator|value2</span></code> is
  340. true, for instance:</p>
  341. <blockquote>
  342. <div><p>$(POSTCODE) = 7040</p>
  343. <p>$(YEAR2DATE) &gt; $(YEARTOMONTH)</p>
  344. </div></blockquote>
  345. <p>Another use of the If-Statement is with <code class="docutils literal notranslate"><span class="pre">LocatorType</span></code> and <code class="docutils literal notranslate"><span class="pre">Locator</span></code> and comparison. This can be used when you
  346. want conditional execution of a larger block of statements depending on an element present or not present.</p>
  347. </td>
  348. </tr>
  349. <tr class="row-odd"><td><p>assert</p></td>
  350. <td><p>Will retrieve value of element specified by <code class="docutils literal notranslate"><span class="pre">locator</span></code> and compare with reference value from <code class="docutils literal notranslate"><span class="pre">value</span></code>.</p></td>
  351. </tr>
  352. <tr class="row-even"><td><p>pause</p></td>
  353. <td><p>Will pause for the number of secons in <code class="docutils literal notranslate"><span class="pre">value</span></code>. Valid numbers are float, e.g. 2, 0.2, 0.1, 25</p></td>
  354. </tr>
  355. <tr class="row-odd"><td><p>iban</p></td>
  356. <td><p>Will create a random IBAN account number. <code class="docutils literal notranslate"><span class="pre">value</span> <span class="pre">2</span></code> is the destination field of the test case structure. If you
  357. don’t provide a field name (not necessarily one that exists in the input file. Can be any field name!) nothing will
  358. happen. If you provide input parameters in column <code class="docutils literal notranslate"><span class="pre">value</span></code> (<code class="docutils literal notranslate"><span class="pre">SWIFT</span></code> and/or <code class="docutils literal notranslate"><span class="pre">COUNTRY</span></code>) the IBAN will be created for that bank-code
  359. and/or country.</p></td>
  360. </tr>
  361. <tr class="row-even"><td><p>address_create</p></td>
  362. <td><p>provide an easy and easily extendable way to generate address data for a test case
  363. The following fields variable are stored in testcaseDataDict:</p>
  364. <p>CountryCode
  365. PostalCode
  366. CityName
  367. StreetName
  368. HouseNumber
  369. AdditionalData1
  370. AdditionalData2</p>
  371. <dl class="simple">
  372. <dt><cite>value</cite> optional</dt><dd><p>Default field-value: {‘HouseNumber’: ‘6’, ‘AdditionalData1’: ‘Near MahavirChowk’, ‘AdditionalData2’: ‘Opposite St. Marish Church’, ‘StreetName’: ‘GoreGaon’, ‘CityName’: ‘Ambala’, ‘PostalCode’: ‘160055’, ‘CountryCode’: ‘India’}</p>
  373. </dd>
  374. </dl>
  375. <p>These fields can be used as filter criteria in field value.
  376. Example value= <cite>{CountryCode:CY, PostlCode: 7}</cite>.</p>
  377. <p>Resulted field-value :{‘HouseNumber’: ‘6’, ‘AdditionalData1’: ‘Near MahavirChowk’, ‘AdditionalData2’: ‘Opposite St. Marish Church’, ‘StreetName’: ‘GoreGaon’, ‘CityName’: ‘Ambala’, ‘PostalCode’: ‘7’, ‘CountryCode’: ‘CY’}</p>
  378. <p><cite>value2</cite> optional
  379. If a prefix was povided in field Value2, the fieldnames will be concatenated with this prefix,
  380. e.g.if value2=`PremiumPayer_`, then the resulting field for CountryCode in testDataDict would become PremiumPayer_CountryCode.</p>
  381. </td>
  382. </tr>
  383. </tbody>
  384. </table>
  385. </div>
  386. </div>
  387. </div>
  388. </div>
  389. </div>
  390. <footer>
  391. <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
  392. <a href="Structure.html" class="btn btn-neutral float-right" title="Structure of baangt" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
  393. <a href="OverviewUsage.html" class="btn btn-neutral float-left" title="What is baangt" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
  394. </div>
  395. <hr/>
  396. <div role="contentinfo">
  397. <p>
  398. &copy; Copyright 2020, Bernhard Buhl
  399. </p>
  400. </div>
  401. Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
  402. </footer>
  403. </div>
  404. </div>
  405. </section>
  406. </div>
  407. <script type="text/javascript">
  408. jQuery(function () {
  409. SphinxRtdTheme.Navigation.enable(true);
  410. });
  411. </script>
  412. </body>
  413. </html>