My initial tests have shown that Robot won't work without an active, visible desktop. For example, while a scheduled task (or executed command from the continuous integration server) may be able to start robot as a command-line process, Robot will actually fail to execute the recorded script.
Logging into the build machine to allow it an "active desktop" is not an acceptable solution.
Am I missing something? Is it possible to run a pre-recorded Rational Robot script on a continuous integration server in a manner that doesn't require the machine to be physically logged into?
Unfortunately, Robot does require that you are logged on to the machine and that the desktop is not locked.
So, no, you are not missing something.
Depending on your situation, though, you may be able to work around the issue. Can you clarify what type of application you are trying to test? If it is a web app, or a client app that is easily installed/copied, you might be able to have Robot run on a vmware image, rather than directly on the build server itself.
You can run Rational Robot from the command line, so you should be able to set up a scheduled task to run a .BAT file to do this for you. The command is something like:
[path to Rational Robot]\rtrobo [script file] /user "user name" /project [project file] /play /build "build name" /nolog /close
The Robot documentation will have other arguments you can pass in, depending on your situation.
If a simple scheduled task doesn't work, then you can try setting up a STAF (http://staf.sourceforge.net/index.php) environment and create a job to run this.
Good luck :)
Related
I have reportportal installation running on Windows box. I am planning to use it as dashboard to look at unit test and other automated test results. I understand reportportal integration with unit test frameworks is done at the logger level so that the test app itself can send results back to dashboard.
I have a scenario where the test application is an exe that I want to launch by sending a command from dashboard to system under test.
Are there any provisions for doing it?
Do I have to build an agent that talks to reportportal using its api for this?
Thanks
No, nothing similar at the moment.
It is pretty popular request, so we have it in backlog, but still focus on test reports aggregations first. And the other types of functionality will come later.
I am working with Robot Framework using RED editor on Eclipse IDE. When i ran a Robot test case an error as shown in the screenshot has occurred
Upon tracing back my actions, I have noticed that RobotTempDir... got deleted from Temp folder. I restored that folder and ran the test case. Then it executed successfully.
In future there are chances that while cleaning temp folder contents, RobotTempDir... may get deleted unknowingly. Is there a way to redirect this RobotTempDir... contents to save in a different location?
I looked into the C:\Python36\Lib\site-packages\robot path and didn't find any files where i can change/update Robot temp folder details.
The TestRunnerAgent.py is not part of the Robot Framework application but instead comes with the RED plugin. It is part of their Robot Run functionality which allows it to retrieve information from Robot Framework while it is running.
This information is then displayed in the Eclipse Message Log panel or used when using the RED debugger functionality.
In my view this file is generated every time Eclipse is started and I think the only time this error would occur is when that file/folder is deleted while Eclipse is running. Restarting Eclipse should fix this.
TestRunnerAgent.py is custom listener which is attached to Robot process to report back to RED what is happening during test execution. For normal test runs,this is Execution View information,also Message Log stuff printed there. For Debug run, TestRunnerAgent.py allows to control execution process (breakpoint stop,stepping) and changing internals of Robot (state of variables).
It is embedded in RED package,and as you said, it is temporary placed in Temp dir for execution. If you would like to check source,either check jar file: org.robotframework.ide.core-functions-0.0.1-SNAPSHOT.jar or on GitHub: https://github.com/nokia/RED/tree/master/src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/python/scripts
Back to your issue:
RED starts Robot execution with following command:
<selected python interpreter> -m robot.run --listener <path to TestRunnerAgent.py> <details what to run and other miscs>
There is no indication of error such error in TestRunnerAgent.py although there is in RobotLaunchConfigurationDelegate.java which tries to start Robot using interpreter in current Project configuration. I assume that there is something wrong in your env setup (either in RED or in OS)
I would suggest to check following:
check if you selected proper python interpreter with installed Robot (from Windows->Preferences-> RobotFramework ->Interpreters
check if your project looks similar as here: http://nokia.github.io/RED/help/user_guide/quick_start.html
you can try to use custom script to catch robot execution command and remove --listener part to validate if this is the culprit: http://nokia.github.io/RED/help/user_guide/launching/local_launch_scripting.html
there should be command in Console View - try to run it by yourself
I am trying to run my Automated test cases deployed on a virtual machine and trying to trigger it with the help of Octopus Deployment tool. I installed test agent and Octopus Tentacle on my machine. Octopus is triggering the DLL's for Automated test cases very well.But while Octopus trying to run the test cases it's giving me an Error as below:-
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: To run tests that interact with the desktop, you must set up the test agent to run as an interactive process. For more information, see "How to: Set Up Your Test Agent to Run Tests That Interact with the Desktop" (http://go.microsoft.com/fwlink/?LinkId=255012)
Error 01:59:38
If you are running the tests as part of your team build, you must also set up the build agent to run as an interactive process. For more information, see "How to: Configure and Run Scheduled Tests After Building Your Application" (http://go.microsoft.com/fwlink/?LinkId=254735)
I setup my password in test agent and set it as intractive process but still i am facing the same issue.
I am triggering my DLL's as below through Octopus.
& "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "C:\MyWebaPP\Automated_test\Automated_test.dll"
I tried each and every way i found.Please help me out in this.
Thanks in advance!!
We recently encountered the same problem.
During our research, we found this post on the Octopus support forum:
http://help.octopusdeploy.com/discussions/questions/5080-tentacle-running-interactive-tests
We also contacted Octopus Deploy by mail, and they essentially gave us the same response.
While we had no luck with the "scheduled task for test run" approach, we eventually managed to get it working by running the Octopus Tentacle as a process rather than a service.
The challenge here was making sure the Tentacle would start when our test machine started. We wanted this to happen automatically, so RDPing in and starting the process every time was out of the question (this also caused some additional problems for the UI test run...).
The final working solution was to schedule a task that would start the Octopus Tentacle as an interactive process whenever the machine booted (i.e. run Tentacle.exe directly), and then make sure we never RDP to this machine. Make sure the task has sufficient privileges, and that it "Runs whether the user is logged in or not". Also, remember to disable automatic startup of the Octopus Tentacle Service.
Edit: We had some trouble making this solution work across all our environments. It seems that for security reasons, newer versions of Windows are quite skeptical about allowing scheduled tasks to start interactive processes when there is no user logged on.
We did another search for possible solutions, and came across FireDaemon Pro (commercial software), which allows us to register interactive Windows services that run under a domain user. Not quite sure how it works, but they seem to be able to run a UI from a Windows service in session0 (the UI is also isolated). The Octopus Tentacle starts without complain, and the UI tests run the way we want them to.
I've moved my grunt job into Bamboo and everything works great except for the dust compiler. All of my other tasks in my gruntfile can be targeted from the bamboo task and they work. The dustc task gives this error when run: Fatal error: Error: not found: dustc.
I've manually run the dustc task on the build machine's command prompt every way I know how and it works. I even copied the command from the Bamboo build log - the one it uses to execute the grunt task - and it works just fine.
I just can't get it to work when I run the build from within Bamboo.
Any ideas would be greatly appreciated.
Thanks
This turned out to be a permissions/visibility issue.
Evidently system users (or at least the one which was running my build service) don't have access to the system environment variables in Windows. Learn something new every day!
I created a user to run the service (which I probably should have done in the first place) and that non-system user was able to see the correct PATH settings.
This took care of the problem.
I have some scripts I'd like to run each morning at 6am. These scripts produce some pdfs of graphical output into a file: foo.pdf
I'd like my system (let's say Win 7, >= R 2.13) to email me these pdf's once the system has finished running the scripts.
Which is the best package - and most robust way of setting it up - to have these reports emailed to me directly via attachment from R?
Are there any 'cool' extensions to this (like sink() -ing report text output into the body of the email)?
Thanks in advance for any advice.
You can harness the power of a package that can handle emails coupled with a chron job. On Windows 7, I've achieved something akin to this using Windows Task Scheduler. Basically, you set it to run a particular script at a specified time.
I have a script running daily, and had lots of problems to get it to run. Take a look at Roman's link for the attachment and R code first. This is about the non-R part in Windows 7.
I had problems running the R script directly from Windows Task Scheduler, so I scheduled a batch file to run every day as follows:
#echo on
"C:\Rpath\R-2.15.1\bin\i386\Rcmd.exe" BATCH "C:\filepath\filetorun.R"
That's about the simplest you can get, but Quick R was a starting point.
Depending on your computer's settings, you might have to fiddle with the task scheduler. If it's a server type that's always on, then you shouldn't have too many issues (and you know what you're doing). If you have to log off and use a password to login or access a shared drive, you'll have to do some of the following. Also, I don't know if admin rights is a necessity or not.
Open Task Scheduler, make a new task, and open its properties window.
Under General, check the user account and select "Run whether user is logged on or not" and UNcheck "Do not store password." This will allow your script to run if you're logged off (I don't think it works when Locked). When you click Ok, it will ask for your password.
Basic setup: The Trigger is "On a schedule" and Advanced is Enabled. Under Actions, select "Start a program" with the Program/script as the .bat file.
Under Conditions, uncheck "Start the task only if comp is idle" and check "Wake the computer to run this task." Under Settings, check "Allow task to be run on demand," check "If the running task does not end..," and at the bottom, select "Stop the existing instance." These options might be necessary, though I'm not as sure about these.
Another trick is if your company has you switch passwords every once in a while. Open and close the task after changing so that it asks for your password again. Enter the new one or else it can't log in and won't run your script.