CodedUI - Can build-deploy-test workflow close IE browser instance on test agent machine? - coded-ui-tests

I am using build deploy test workflow to execute testcases on Lab environment-CodedUI. Browser IE instance remains open after test execution is over.
I am thinking if I can add something to my build workflow, which send instructions on test agent machine to close that browser instance. Is that possible?
I execute testcases in bunch. No testcase close the browser instance. They work on same browser instance to save login time. Hence I want to close browser once execution is over
Regards,
Gbhavsar

You can use the inbuilt functionality of settings
browserInstance.CloseOnPlaybackCleanup = true
or use a custom .bat file to close/kill all open IE/Chrome/FireFox processes in your post test script.
See https://blogs.msdn.microsoft.com/visualstudioalm/2012/11/08/coded-ui-test-why-does-application-close-after-each-test-in-visual-studio-2012/

Related

IBM Notes Scheduled agent does not execute

I wrote an agent that runs every 1:00 AM daily, but fails to execute the routine mysteriously. I've checked the agent log and saw that it ran and ends without any error. What I've been thinking about is when I trigger the agent or ran it manually it executes the routine I coded successfully and not when it is scheduled. I really don't know what's the issue there, thanks for help in advance.
there are a few things to try
Check the trigger property on the agent and set it to run on All documents or change it to None. Test both scenarios. There are some issues with this setting.
When you run an agent manually from the notes client or designer you are running it using the credentials from you id file. When running it scheduled you use the credentials from the server.
Make sure your server have enough access to perform what your script does. There is also a setting in the agent for increasing what the script is allowed to perform.
If you have access to the server console you can trigger the agent to run on server using the command: tell amgr run "database.nsf" 'agentname'

Webdriver-Jenkins, browser remains in background

I have a project where I am trying to execute webdriver testcases (keyword driven) from jenkins.
I am using Ant to build and execute the project. My code works fine from eclipse and command-line.
I am trying to use jenkins to run automation test eveynight. ( I have to use jenkins, can not use windows scheduler due to some dependencies.)
I can check out my code from SVN, compile it using ant and run it. But, while running, jenkins opens firefox and keeps it in background. It appears that tests are executing fine (in backgournd) but can not see firefox UI in foreground.
Any one had this problem before? or any solutions ?
I really appreciate your help.
that a feature of jenkins called as the Execution of test cases in Headless browser mode

Browsers not visible when running Selenium2/Webdriver tests with Hudson

I am using Hudson CI to run an ant script which compiles and executes Selenium2/Webdriver tests (written as TestNG tests). These tests are set to run in a Firefox browser, not with headless HTMLUnit. During the Hudson build, I don't see any errors in the console output or the TestNG report, and my custom report seems to indicate that my tests do run normally, but I noticed that no actual Firefox browser is ever launched during the build.
In contrast, whenever I run my Selenium2/WebDriver tests via Eclipse or the command line either as a TestNG test or an Ant build, the tests always launch a browser on which I can see the tests being run. I just can't figure out why the browser does not appear. All of the aforementioned details suggest that the tests are in fact run properly, but the Hudson server is run on my local machine and no additional resources are apparently used to run the tests in their own Firefox instance.
I am not using Selenium Grid at the moment. Also, regardless if I run the tests sequentially or in parallel across multiple threads through Hudson, I am still not able to see any active browsers. I do vaguely remember at one point seeing Hudson launch an actual browser yesterday when I began this work, but I have yet to see once since. This makes me wonder if I possibly configured something incorrectly in my Hudson job.
Any help is greatly appreciated!
Login to test node
Open the window services and locate Jenkins Slave services
Right click and select properties
Go to “Log On” tab
Make sure option “Local System Account” is selected and tick the option “Allow service to interact with desktop”
Click OK to save the setting
Restart the services.

Coded UI Tests automation

I want to automate the process of running coded UI tests.
Do i need to have user logged in to the system?
Or is it possible to run it using XYNT service?
We are able to run our coded ui tests in an automated fashion using windows scheduler and the command line MSTest.exe. Take a look at the following MSDN article on how to accomplish this:
http://msdn.microsoft.com/en-us/library/ms182486.aspx
I believe you can use Microsoft's Test Manager to accomplish this as well but we don't have TFS (yet) so I can't vouch for it.
As far as I know, CodedUI Tests require an active desktop session, so running them under a service account without an open desktop session may work, but not without a session.
I used the mstest to run the coded ui test and use Windows TaskScheduler to schedule the test.
You can find detail in MSTest.exe command-line documentation.
When you want to run it automatically, there are two things you should pay attention:
1. Set auto log on
2. Close the screen saver
You need to take the snapshot of your enviroment with user logged in and then you can run your test through MS Test Manager or TFS (nightly build process)
Write the test's in Visual Studio 2010/2012, this means you can manually edit the test's the code, then you should run them in Test Manager,
BTW you need TFS and Test Manager to be the same year otherwise it won't work.
I've being doing a lot of these recently if you have any questions post it online and send me a message, I'll be happy to help.

Execute a batch script from Firefox

I have written an intranet application from which you can directly connect to a virtual machine by clicking on a RDP-button. The click calls a .bat file, which opens the connection.
With IE, this is no problem, as you can choose to directly execute the batch file. But with Firefox, I can only download the script, and have to start it manually afterwards. Is there a way to trust the intranet domain (about:config?) so Firefox allows it to execute scripts directly? Or is there an even better (easier) way to start an RDP connection from Firefox?
You can easily register a custom protocol handler such as "myrdp://somedata" to run the app that opens the VM (This would probably work with a .bat, it works with a WSH script, better a small exe)
IE/FF support this functionality and allow you to then simply <a href="myrdp://somedata" ..>
You could also try to set up your firefox to automatically open the .rdp files with the default rdp client. This way the files will be downloaded in a temp dir and immediately started up.
You can do this in Firefox's preferences. Hope this helps )

Resources