My tests are failing because none of applications (Chrome browser, .txt file and Windows app) is opened when running via Gitlab-CI, while when I run locally in VDI, the script works fine and execute all tasks.
*** Tasks***
Open Chrome Browser ${URL}
Open File ${pathFile}
RPA.Desktop.Open application ${pathApplication}
Sleep 300s
Get Opened Windows Applications
${windows}= List Windows
FOR ${window} IN @{windows}
Log Window title:${window}[title]
Log Window process name:${window}[name]
Log Window process id:${window}[pid]
Log Window process handle:${window}[handle]
END
Log To Console ${windows}
Print Tree of control elements
${structure} = Print Tree return_structure=${True}
Log To Console ${structure}
As you can see there is no windows app in the list and it prints only Desktop control. I guess it should be some user permissions issues, but could not find any solution. Any idea?
You run your test case on the VDI (at your workplace?) and the test executes successfully
You run your test case on a Gitlab Runner and the test fails because the applications are not there
If I’m correct, this is not a robot framework issue, Gitlab Runners are bare bones absolutely minimal OS machines, they have no applications installed (except some Core OS applications)
As an example a windows Gitlab Runner:
will not have Chrome installed
will not have Office installed
will not have Flash installed
will not have Java installed
will not have Minesweeper installed (this is part of windows full install but not part of the minimal install)
will not have Solitaire installed (this is part of windows full install but not part of the minimal install)
Depending on windows version might have Internet Explorer installed
Depending on windows version might have Edge installed
might have Paint installed
should have Notepad installed
Also Gitlab Runners are a disposable machine meaning once they have run your test the runner virtual machine is deleted, next time you run your runner you get a brand new completely empty machine with no memory or knowledge of anything that was on the runner the previous time you ran.
So you need to setup your Gitlab Runner workflow file to ensure the applications you need are installed, and the files you need are copied to the runner each time and make sure files you need are copied off before you end.
The test you have there that proves the things you need are missing is a great starting point, as it will help you learn how to configure your Gitlab Runner workflow and confirm when you have it configured correctly.