I have coded UI tests running locally just fine, because I can open up IE and point the window at localhost. When I attempt to run these tests on the build server, they fail because the window isn't open yet. How can I get an instance of IE open on the build server as part of these tests, for these tests to run against?
Try giving interactive logon permission to your account underwhich build is running...
Related
By default, running 'npx cypress open' opens the Cypress window and then I have to manually hit the "Run All Tests" button to run them.
How can I keep the browser open and run all tests in the browser/UI automatically?
Can I keep a scheduler on each test case so that the test runs in a particular time?
How can I push the cypress framework to higher environments?
I need the tests to run automatically everytime. I want to keep a schedular on the test case and make it more customizable and also want to push to another environments.
I'm not sure why you would need to monitor all the tests in headed mode. It can take up resources. Most of your questions can be easily answered in the Cypress Docs
npx cypress run --headed to run all tests in headed mode.
You'll need to use a CI tool for scheduling that(ie. Github actions, CircleCi, etc).
To test other environments you'll have to figure out a configuration to run on each one.
Cypress docs are your friend.
I'm trying to run a set of cucumber selenium tests as part of a build in TFS2015, but it doesn't appear to be running them at all. I only get a timeout error. What I can conclude is that it is having difficulty starting up the browsers. I suspect that it is not running them properly from the script. Any idea how to fix?
We include Selenium tests in our feature test build by wrapping each Selenium test with MSTest and/or CodedUI attributes which works perfectly. You do have to make sure the build/test agent is configured to run in Interactive mode otherwise the test run won't have access to the desktop to automate the browser.
http://donovanbrown.com/post/2015/08/28/auto-start-build-agent-in-interactive-mode
We don't use Cucumber however so that may be the issue for you, not sure.
I'm trying to setup Jenkins to execute our UI automation(Ranorex) tests. When the job runs, the IE browser does NOT launch, thus the tests don't run.
Is there some setting that I'm missing here?
The UI automation code is built into a .exe, which is called from a .bat file.
Thanks for any help.
Have you already read the blog Integrating Ranorex Automation in Jenkins CI Process on the Ranorex website?
I have setup Jenkins with git and Xcode plugins so that I would be able to build an iOS project on CI machine. However - I don't seem to get any unit test output in the console. I see the compilation messages (for implementation files as well as xibs), I see the build of test bundle, but no "test passed" or "test failed" messages. Running unit tests from Xcode produces all the needed output. What am I missing?
Your problem might be caused by several things. To approach the solution there are some things you need to know:
How do you run Jenkins? Did you use the Jenkins Mac installer from http://jenkins-ci.org?
Is Jenkins running under your user account? Or is it running as someone else? Is it running as a launch daemon?
Do your tests require access to WindowServer or are they completely happy only the commandline?
What is going on in your machine?
When Jenkins runs the build and the unit tests do not run, open Activity Monitor, show the process tree, check the sub processes of Xcode and if you find a process that looks like your unit test and then sample it (either with the Sample button in Activity Monitor or the "sample" command line utility). What is the process doing based on the samples?
If your unit tests require access to WindowServer and you are running Jenkins as a launch daemon, you might be interested in https://github.com/stisti/jenkins-app
Normally output like "Test x passed" or "Test x Failed" is due to the testing suite outputting to the console. When I call MSTest, I am calling via the cmd and the output is relayed back through jenkins. It sounds like you need something to read the output xcode is making and display it back to you. Sounds like you may not be able to do this in real time unless there is some sort of output goes to console flag you are not setting.
I have a solution with a web application and test project. The test application has coded ui tests of the web application. How can I get the web application to start up when the tests execute?
I've tried
adding a TestSetup method to start the web server via System.Diagnostics.Process. I don't like this because it seems clunky and the coded ui tests don't lend themselves to inheritance real well
adding a setup script in the testsettings to start the web server (same command line) via a batch file. However the batch file never exits and eventually times out. I've tried starting the web server via the start command, but that didn't work -- it works great when you run it from the command line, but not from the testsettings setup script.
I've thought about maybe just running IIS in the background and pointing it to a specific folder. Then deploy the web application to that folder. And let the test project test against IIS.
This seems like a lot of work though. There's got to be an easier way. I want to do this on several developer's machine and also on the TFS build machine via scheduled or continuous integration.
Any thoughts?
Thanks
I configure the web project (in the project properties) to be hosted on IIS. Its just 3 or 4 clicks away. It will prompt to create a virtual application. After that, build and run your project and it will be permanently hosted on IIS. So you can start Coded UI tests without manually starting the web server.
You could do what Gerardo Grignoli suggested and just host the site in IIS so that it's always on.
You could also just start the web project (Without Debugging if you want to debug your tests) and then run/debug the tests. In your tests, just use BrowserWindow.Launch("localhost:appPort/whateverPageToStartOn"); just fill in the port instead of appPort based on your IIS express settings.
In regards to running it on the TFS build machine, that seems like probably a questionable thing to do. You can test the deployed site (dev, test, prod, whatever) from a testing lab. Microsoft Test Manager (MTM) is one of the products that can do this.