java.lang.NullPointerException at com.kms.katalon.composer.testcase.parts.TestCaseVariablePart.setDi

**OS : **Windows 7

Katalon Studio Version : 5.6.1

## Katalon Studio logs:

Windows (\config\.metadata\.log): attached

## Environment (for Web testing)

Browser : Firefox 61.0.2

## Steps to reproduce -

In a Katalon project, I have a Test Case with 4 variables defined. Among them I had a variable named “debugMode” of type Boolean with default value “false”

I wanted to chage the default value from “false” to “true”. I clicked the field to show a drop down list where I chose “true”. The new value “true” looked chosen once.

I moved the mouse cursor to other position. Then I exepected to see new value “true” stay there. But NOT. The value of “debugMode” was brought back to the previous value “false”. At this timing I noticed that the change I made had not been saved.

I clicked the “Save all” button. Then the value of “debugMode” variable turned to have new value “true”.

## Expected Behavior -

When I moved the mouse cursor to other position, the new value “true” is displayed.

## Actual Behavior -

When I moved the mouse cursor to other position, the new value “true” disappered, the old value “false” came back. Then I cliked the Save button, then the new value " true" appeared back.

## Screenshots / Videos

In the .log file I found the following Java Stack Trace. I believe this was recored when I moved the mouse cursor to other position.

!ENTRY org.eclipse.e4.ui.workbench 4 0 2018-08-28 10:46:20.314
!MESSAGE 
!STACK 0
org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:496)
at com.kms.katalon.composer.components.operation.OperationExecutor.executeOperation(OperationExecutor.java:44)
at com.kms.katalon.composer.parts.CPart.executeOperation(CPart.java:181)
at com.kms.katalon.composer.parts.CPart.executeOperation(CPart.java:185)
at com.kms.katalon.composer.parts.CPart.executeOperation(CPart.java:189)
at com.kms.katalon.composer.testcase.support.VariableDefaultValueEditingSupport.setValue(VariableDefaultValueEditingSupport.java:74)
at org.eclipse.jface.viewers.EditingSupport.saveCellEditorValue(EditingSupport.java:113)
at org.eclipse.jface.viewers.ColumnViewerEditor.saveEditorValue(ColumnViewerEditor.java:453)
at org.eclipse.jface.viewers.ColumnViewerEditor.applyEditorValue(ColumnViewerEditor.java:309)
at org.eclipse.jface.viewers.ColumnViewerEditor$1.applyEditorValue(ColumnViewerEditor.java:152)
at org.eclipse.jface.viewers.CellEditor$1.run(CellEditor.java:336)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
at org.eclipse.jface.viewers.CellEditor.fireApplyEditorValue(CellEditor.java:333)
at org.eclipse.jface.viewers.ComboBoxCellEditor.applyEditorValueAndDeactivate(ComboBoxCellEditor.java:272)
at org.eclipse.jface.viewers.ComboBoxCellEditor.focusLost(ComboBoxCellEditor.java:279)
at org.eclipse.jface.viewers.ComboBoxCellEditor$3.focusLost(ComboBoxCellEditor.java:168)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:144)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1103)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1088)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:802)
at org.eclipse.swt.custom.CCombo.handleFocus(CCombo.java:922)
at org.eclipse.swt.custom.CCombo$2.handleEvent(CCombo.java:150)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1270)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1078)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1103)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1084)
at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:2934)
at org.eclipse.swt.widgets.Widget.wmSetFocus(Widget.java:2437)
at org.eclipse.swt.widgets.Control.WM_SETFOCUS(Control.java:5446)
at org.eclipse.swt.widgets.Table.WM_SETFOCUS(Table.java:6421)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4869)
at org.eclipse.swt.widgets.Table.windowProc(Table.java:6037)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:5110)
at org.eclipse.swt.internal.win32.OS.SetFocus(Native Method)
at org.eclipse.swt.widgets.Table.sendMouseDownEvent(Table.java:3916)
at org.eclipse.swt.widgets.Table.WM_LBUTTONDOWN(Table.java:6271)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4835)
at org.eclipse.swt.widgets.Table.windowProc(Table.java:6037)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:5123)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2552)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3822)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at com.kms.katalon.core.application.Application.internalRunGUI(Application.java:115)
at com.kms.katalon.core.application.Application.runGUI(Application.java:100)
at com.kms.katalon.core.application.Application.start(Application.java:60)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
Caused by: java.lang.NullPointerException
at com.kms.katalon.composer.testcase.parts.TestCaseVariablePart.setDirty(TestCaseVariablePart.java:449)
at com.kms.katalon.composer.testcase.ast.variable.operations.ChangeVariableDefaultValueOperation.changeVariableDefaultValue(ChangeVariableDefaultValueOperation.java:50)
at com.kms.katalon.composer.testcase.ast.variable.operations.ChangeVariableDefaultValueOperation.redo(ChangeVariableDefaultValueOperation.java:44)
at com.kms.katalon.composer.testcase.ast.variable.operations.ChangeVariableDefaultValueOperation.execute(ChangeVariableDefaultValueOperation.java:39)
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:488)
... 70 more

# Discussion

I can not disclose the Katalon project where I encounted this problem, because the project contains companies sensitive information.

I made another project aiming to reproduce the above-described problem, but in vain. I could not reproduce the problem in other project. This problems seems to be dependent on a subtle condition — I do not see what it is.

.log

1_before_change.png

2_trying_change_value_false_to_true.png

3_looked_unchanged.png

4_saved_then_value_change_reflected.png

2 Likes