Steps failed when execute tests in docker

Hi,
When I’m execute my tests on my local machine in ChromeHeadless (latest version) mode: all steps is pass successfully.
But when trying execute tests in docker(official katalon studio image), some steps with robot is failed. In logs as you can see this steps marked as “NOT_RUN”. What’s wrong? Why some steps can have status “NOT_RUN”?

TestOPS Katalon TestOps

Part of script:

WebUI.click(findTestObject(‘TestDomainPage/Video/vast_playbutton’))
WebUI.takeScreenshot()
Robot robot = new Robot()
robot.delay(1000)
robot.keyPress(KeyEvent.VK_TAB)
robot.keyRelease(KeyEvent.VK_TAB)
robot.keyPress(KeyEvent.VK_ENTER)
robot.keyRelease(KeyEvent.VK_ENTER)
WebUI.takeScreenshot()
WebUI.switchToWindowIndex(1)
WebUI.waitForElementPresent(findTestObject(‘TestDomainPage/Zaglushka/zaglushka_title’), 5)

TestOps Logs:

2020-11-24 12:29:42 - [TEST_STEP][PASSED] - click(findTestObject(“TestDomainPage/Video/vast_playbutton”)): Object: ‘Object Repository/TestDomainPage/Video/vast_playbutton’ is clicked on
2020-11-24 12:29:42 - [MESSAGE][PASSED] - Object: ‘Object Repository/TestDomainPage/Video/vast_playbutton’ is clicked on
2020-11-24 12:29:42 - [TEST_STEP][PASSED] - takeScreenshot(): Taking screenshot successfully
2020-11-24 12:29:42 - [MESSAGE][PASSED] - Taking screenshot successfully
[[ATTACHMENT|/home/jenkins/agent/workspace/tests_katalon-ad-formats_master/Reports/20201124_122908/BasicFormatsTestSuite/20201124_122921/1606220982668.png]]
2020-11-24 12:29:42 - [TEST_STEP][NOT_RUN] - robot = new java.awt.Robot(): null
2020-11-24 12:29:42 - [TEST_STEP][NOT_RUN] - robot.delay(1000): null
2020-11-24 12:29:43 - [TEST_STEP][NOT_RUN] - robot.keyPress(VK_TAB): null
2020-11-24 12:29:43 - [TEST_STEP][NOT_RUN] - robot.keyRelease(VK_TAB): null
2020-11-24 12:29:43 - [TEST_STEP][NOT_RUN] - robot.keyPress(VK_ENTER): null
2020-11-24 12:29:43 - [TEST_STEP][NOT_RUN] - robot.keyRelease(VK_ENTER): null
2020-11-24 12:29:43 - [TEST_STEP][PASSED] - takeScreenshot(): Taking screenshot successfully
2020-11-24 12:29:44 - [MESSAGE][PASSED] - Taking screenshot successfully
[[ATTACHMENT|/home/jenkins/agent/workspace/tests_katalon-ad-formats_master/Reports/20201124_122908/BasicFormatsTestSuite/20201124_122921/1606220983893.png]]
2020-11-24 12:29:44 - [TEST_STEP][FAILED] - switchToWindowIndex(1): Unable to switch to window with index: ‘1’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to switch to window with index: '1’

Hi @a.polovinkin,

To understand why the Robot keywords didn’t run, we recommend you see the console log or try catch the robot steps:

try {
Robot robot = new Robot()
robot.delay(1000)
robot.keyPress(KeyEvent.VK_TAB)
robot.keyRelease(KeyEvent.VK_TAB)
robot.keyPress(KeyEvent.VK_ENTER)
robot.keyRelease(KeyEvent.VK_ENTER)
} catch (Exception e) {
println e
}

You might see AWTException here because the docker VM is a headless environment. the To use Robot or Java AWT, you need to setup: Display configuration for your docker image.