Skip to main content
Skip table of contents

KeepAlive: maintain dialog windows open

Tag attribute: KeepAlive

The KeepAlive attribute controls how a window behaves. 

By default, all windows close automatically, without human intervention during an automation process.

KeepAlive can be set to maintain on screen a window so that you can interact with the application while the automation process is running.


Detailed Description

The KeepAlive will behave differently depending on the value used and, in certain cases, will affect different dialog actions than that which it is coupled with.
The different values have the following functions/effects within your script:

KeepAlive can be set to:

- "False": Default value (see exception below). Window will automatically be closed. Applies to the current action and all its children until its overridden.

- "True": Window will stay opened until the user closes it. Applies to the current action and all its children until its overridden.

- "This": Window will stay opened until the user closes it. Only applies to the current action, not to its children.

- "ThisAndSuspend": Window will stay opened until the user closes it. The automation process is suspended and resumes after the window is manually closed.

- "ThisAndStop": Window will stay opened until the user closes it. The automation process is stopped.


NOTEThis will not necessarily affect the dialog whose action it is coupled with. See example below.


automation-logic-setScriptToRequireUserInput-1.gif

In the script above, the KeepAlive attribute is used on the Values action. But because it will affect the next dialog encountered in the script, it will affect the Export action dialog—this dialog will be kept open awaiting user input.

KeepAlive="This" will trigger only the dialog corresponding to the action in which the KeepAlive is used to stay open.


automation-logic-setScriptToRequireUserInput-2.gif

In the script above, because of KeepAlive="This", only the Values dialog will be kept open.


KeepAlive can be set as a param of the action.

XML
<Export KeepAlive="true">
	<SetParam field="ExportType" value="text"/>
	<SetParam field="FilePath" value="C:\test.csv"/>
</Export>


You can also set KeepAlive (True or False only) in the main <ytriaAutomation> action so that it applies to the whole script (until overridden). 

It may happen, it some odd situation, that you need to set it using a SetParam action.

XML
<Export>
	<SetParam field="ExportType" value="text"/>
	<SetParam field="FilePath" value="C:\test.csv"/>
	<SetParam KeepAlive="true"/>
</Export>

Exception

sapio365
- When opening a module in a "new frame" (i.e. either a main-module or a sub-module with attribute newFrame="true"), KeepAlive is considered as true by default.
- For sub-modules with "newFrame" not set to "true":
- "Go Back" is called instead of closing the whole module.with no KeepAlive set to True Or This
- Otherwise the frame stays up and the automation stops with a console message: "Automation has stopped: the frame is instructed to stay open (action \"%s\": \"%s\" parameter is not set to \"%s\"), therefore no further action can be processed."

Special Attribute Value: {{SKIP}}

The attribute value {{SKIP}} can be used in place of a SetParam option value, using the default setting.

For example, the following two script blocks are equivalent:

CODE
<Export keepAlive="this">
    <SetParam field="FilePath" value="D:\temp-exports\acl-ExportMainGrid-TextSelectedRows.xlsx"/>
    <SetParam field="OpenFileOnceGenerated" value="{{SKIP}}"/>
</Export>

and

XML
<Export keepAlive="this">
    <SetParam field="FilePath" value="D:\temp-exports\acl-ExportMainGrid-TextSelectedRows.xlsx"/>
</Export>
TIPAs shown above omitting a SetParam option line for a dialog action will result in its option setting being ignored. But, the{{SKIP}}attribute can be useful whensettingIFconditions.

Example Scripts

XML
<Values KeepAlive="True">
	<SetParam Target="SelectDocumentItems" Field="AddItem" value="Subject"/>
	<SetParam Target="SelectDocumentItems" Field="AddItem" value="$Fonts"/>
	<SetParam Target="SelectDocumentItems" Field="AddItem" value="Status"/>
</Values>
XML
<ytriaAutomation>
	<Load Server="Acme01/ACME" database="Mailtest.nsf"/>
	<Focus Target="Tree" Category="Documents" Type="Document"/>
	<Values KeepAlive="True">
		<SetParam Field="AddItem" value="readers"/>
		<SetParam Field="AddItem" value="From"/>
		<ShowTypeColumns value="false"/>
			<Export>
				<SetParam Field="FilePath" value="D:MailTestAudit.html"/>
				<SetParam Field="ExportType" value="HTML"/>
				<SetParam Field="SelectedRowsOnly" value="false"/>
			</Export>
	</Values>
	<Overwrite value="false"/>
</ytriaAutomation>

In the script above, the KeepAlive attribute is used on the Values action. But because it will affect the next dialog encountered in the script, it will affect the Export action dialog—this dialog will be kept open awaiting user input.

KeepAlive="This" will trigger only the dialog corresponding to the action in which the KeepAlive is used to stay open.

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ytriaAutomation Application="ScanEZ ApplicationVersion="16.0.5" Version="1.0">
	<Load Server="Acme01/ACME" database="Mailtest.nsf"/>
	<Focus Target="Tree" Category="Documents" Type="Document"/>
	<Values KeepAlive="This">
		<SetParam Field="AddItem" value="readers"/>
		<SetParam Field="AddItem" value="From"/>
		<ShowTypeColumns value="false"/>
			<Export>
				<SetParam Field="FilePath" value="D:MailTestAudit.html"/>
				<SetParam Field="ExportType" value="HTML"/>
				<SetParam Field="SelectedRowsOnly" value="false"/>
			</Export>
	</Values>
	<Overwrite value="false"/>
</ytriaAutomation>
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<ytriaAutomation Console="False">
    <Load Server="ACME01/ACME">
        <Load Database="dbtestrepl\Helptest.nsf" Select="True"/>
    </Load>
    <ReplicationAudit keepalive="ThisAndStop">
        <Setparam Field="SelectRepServer" Value="ACME02/ACME"/>
        <SetParam Field="ModifiedAfter" Value="2015-07-25T10:00:00"/>
        <RunAudit Select="All"/>
        <Select Lines="All"/>
            <Export>
                <SetParam field="FilePath" value="D:\scanEZ-ReplicaAudit.html"/>
                <SetParam field="ExportType" value="HTML"/>
                <SetParam field="SelectedRowsOnly" value="True"/>
            </Export>
    </ReplicationAudit>
</ytriaAutomation>

In the script above, keepalive="ThisAndStop" prevents the replication auditor window from being closed and stops the automation process so that user interaction is enabled.. 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.