Skip to main content
Skip table of contents

setAllowOnlyMockedVariables

Versionshinweise

25.1

Code

CODE
void setAllowOnlyMockedVariables(boolean mockedVariablesOnly)

Beschreibung

Gibt an, ob Zugriffe (VariableUtils.getGlobalVariable) auf nicht überschriebene globale Variablen bei der Testausführung zu einem Fehler führen sollen.

Parameter

  • mockedVariablesOnly - true, falls ein Zugriff auf eine nicht überschriebene globale Variable Aufruf zu einem Fehler führen soll.

Beispiele

CODE
VariableMockUtils.setAllowOnlyMockedVariables(true);  
Object value = VariableUtils.getGlobalVariable("MyGlobalVariable"); // leads to an error because the global variable is not mocked
JavaScript errors detected

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

If this problem persists, please contact our support.