Browsers not visible when running Selenium2/Webdriver tests with Hudson - browser

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.

Related

How to see the test executions UI actually happening in azure pipeline?

My test case is: Opening an windows application and closing the same.
I am able to trigger automation in azure pipeline successfully. The test execution is happening successfully. But I am not able to see the UI of execution.
Right now its kind of headless execution.
I want to see where the actual execution happens.
Where can I see the execution(want to see the UI)?
Not sure which kind of UI test you were running. Azure DevOps support both Headless mode or visible UI mode.
Headless mode. In this mode, the browser runs as normal but without any UI components being visible. While this mode is obviously
not useful for browsing the web, it is useful for running automated
tests in an unattended manner in a CI/CD pipeline. Chrome and Firefox
browsers can be run in headless mode.
Visible UI mode. In this mode, the browser runs normally and the UI components are visible. When running tests in this mode on
Windows, special configuration of the agents is required.
More details please take a look at official tutorial here-- UI testing considerations

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

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/

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

Setting up CruiseControl.Net to always check for modifications

So I imagine this is a pretty simple problem, but I can't find anything about it.
I've set up CruiseControl.Net to check my svn repository for any changes every 30 seconds, and if there are any changes, build them using NAnt.
Everything works great - but only if I have the CruiseControl.Net console running at all time on the server. If I close the console, it won't check for changes and build them. I've checked the wiki for a way to set up continuous monitoring, but I can't find anything
Does the console always need to be running in order to detect changes, or is there another way to do this?
There are two ways to run CCNET: As console application or as windows service. You're looking for windows service mode.
Here is a tutorial on "Installing CCService". Be aware that this documentation is outdated. But it should give you an impression.
Installing CCNET as a windows service is an option during CCNET installation so this is the easiest way to get it up and running.

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.

Resources