Knowledge Base Article

Home Page > Knowledge Base > Rapise

Home Page > Knowledge Base > Rapise > Rapise Desktop

Home Page > Knowledge Base > Rapise > Rapise Mobile

Home Page > Knowledge Base > Rapise > Rapise Web

Article Calling Rapise DoX functions without reporting result

by Adam S on Monday, July 6, 2015

When you use a DoX command in Rapise to perform a specific command (e.g. DoDOMChildrenCount() to get a number of object's DOM children), in the report an extra step -- assert -- is created during test execution. Sometimes you want to be able to call a function 'quietly' without it affecting the report.

For example when using the DoDOMChildrenCount() function, If there are any DOM children, the assert passes, whereas if the count is zero, it fails. This affects whole test execution result, and in this example you might want to get the number of DOM children of an object and call a different set of functions in each case.

For Example:

function Test()
{
  Tester.Message(SeS('Sponsors').DoDOMChildrenCount());
}


<log type="Session" name="RL-QWSD-08:username" at="2015-07-06 06:40:42.392"/>
<log type="Test" name="MyTest 1" status="Info"  at="2015-07-06 06:40:42.623"><data type="text" caption="undefined">Test Started: C:\Users\username\AppData\Local\Temp\Temp\MyTest 1\MyTest 1.js</data>
</log>
<log type="Message" name="Starting scenario: Test" status="Info"  at="2015-07-06 06:40:42.626"/>
<log type="Assert" name="Sponsors.DoDOMChildrenCount([])" status="Fail" Iteration="0"  at="2015-07-06 06:40:49.074" comment="Returned Value: 0" />
<log type="Message" name="0" status="Info" Iteration="0"  at="2015-07-06 06:40:49.084"/>
<log type="Test" name="MyTest 1" status="Fail" closed="MyTest 1"  at="2015-07-06 06:40:49.088" comment="Passed:0 Failed:1" />

The Solution
Each API function starting with Do has an assertion as a side-effect. However each of those functions has a shadow version starting with _ that is silent, i.e.:

SeS('Sponsors')._DoDOMChildrenCount();

instead of:

SeS('Sponsors').DoDOMChildrenCount();

Attachments
Article Info
Last Updated: 7/6/2015
Article ID: KB164
# Views: 705
Tags
Powered by KronoDesk v1.1.0.15 | © Copyright Inflectra Corporation 2011-2016 | Licensed to Inflectra Corporation.