Skip to main content
blob: 89ca4de1603d30d9928868acb06a2c4fec0f3eb3 (plain) (blame)
Often, there are errors that occasionally occur at specific points in the test. A good example of this is a prompt dialog that sometimes occurs when saving, for example. For errors that can be expected in some way, you can add \gdehandlers{} to the \gdcases{} that cause the error to deal with the error and carry on with the test without activating the global \gdehandlers{}.

You can use local \gdehandlers{} to specify a particular response to an error at this point -- e.g. if you have a check for the existence of a project in the \gddb{} and it fails, you may not want to continue with this test. 

You can also use local \gdehandlers{} to wait for, or create a state in the \gdaut{} that you require before the test can continue. In this case, you should structure your \gdcase{} so that it checks for the status you require. If this isn't the case, the \gdehandler{} is activated and takes the necessary steps to produce the status. Using the \bxname{retry} reentry type \bxpref{reentrytype}, you can specify that the failed \gdstep{} (the check) is retried after the \gdehandler{} has been executed. An example of this is below. 

\subsubsection{Dealing with occasional dialogs}
In the case of occasional dialogs, your \gdcase{} in the test should contain an action which checks that the dialog does \textbf{not} exist  (e.g.\bxname{Check Existence of Window} with the parameter \bxname{false}). If the dialog is not visible, the test will continue normally. 

If the dialog is present, an error occurs. Add an \gdehandler{} to the \bxname{Check Existence of Window} \gdcase{} that clicks e.g. the cancel button in the window and waits for the window to close. The \gdehandler{} should react to a \bxname{check failed} event, and should use \bxname{retry} as the reentry property. Once the window has closed, the failed \gdstep{} (check existence) will be carried out again. This time, the check will succeed, and the test will continue. The \gdstep{} will be marked as successful on retry. 

Back to the top