I have written selenium java code to do the UI automation test in eclipse. Now, I want those code to be runed in VSTS. Problem is that there are lots of components which I am not clear how they are used under the tab "build & release". So I am looking for masters who can share with me the steps to achive my target. Thank you.
If the test need to be run in interactive way, you need to setup a build agent with Interactive mode. (e.g. Deploy an agent on Windows), then run test through this build agent.
There is the Maven task that can run java test.
A related article: Testing Java applications with VSTS
Related
I'm developing a plugin that analyzes source code in a project. Now I need to run it on a great number of projects, so I decided to automate the process. Looking for a way to achieve this I found that I need to implement ApplicationStarter interface and declaring it as extension point in appStart category, as described here:
Intellij - how to make a plugin that can perform IDE actions via a CLI or web service?
Although, I was not able to execute my custom command. When I run
idea64 mycommand
a loading screen of intellij starts and then nothinng happens. I have to kill the process via task manager. My version Is 2020 on Windows 10.
I'm writing here too as on jetbrains I've received no answers yet.
Is there something i'm missing? Thank you in advance.
I'm finding it difficult to phrase this question well, as there are quite a few generic terms (run, configuration, launch, etc.). Here goes:
You can save run configurations in a .launch file. (in the Run Configuration Dialog, under the Common tab, Save as a shared file.
We check these in to SVN. The developers can pass them around, and it helps getting new devs running a working application quicker.
I'd like to check these out as part of our build and use them to programatically run the application, the tests, etc, without spinning up the whole IDE.
What would be the best way to run a .launch file outside of the UI?
Edit: I am trying to unify the tests run on the build server and the IDE. I do not
particularly want to give up integrated debugging, which would be the case with an ant script to run the tests .
This is probably more a problem for integration testing with multiple bundles, or unit testing a whole bundle, where you'd like to mock up extensions.
there is an eclipse plugin built over JUnit, called TPTP. It provides an automation client which can be used to launch the test from eclipse with no gui. maybe it helps
Ant4Eclipse may provide a good starting point on how to do this.
Unfortunately, this is limited to Java Applications and JUnit configurations; I am more interested in PDE applications and Plugin JUnit tests.
I have recently had alot of success building an Eclipse RCP app inside a Hudson CI server using Eclipse Buckminster. It took a bit of doing, but once I setup both features, made my RCP product be based on features, and added the Buckminster query files and the like, it worked. There is a Hudson/Jenkins Buckminster plugin that allowed me to have hudson build the application.
After saving the launch configurations for each test fragment, I created hudson commands to invoke them (yes one line per test fragment unfortunately), but after that I got the automated CI build that I wanted.
You could also use the shell command Eclipse uses. To get it:
Run your program in Eclipse
Go to the "Debug" view
Right-click on the process (probably the second item in the tree) and select "Properties"
Copy shell command and delete the agentlib flag to run in bash
I think you don't need to use the .launch configurations to run the tests. If you build an application using the Eclipse Build System, then you can use the AntRunner application from Eclipse to run your units tests. This doesn't start the whole IDE.
This article describes how to run the tests during your build process. With this process, you use a special "Test" Eclipse and load the plugins you want to test.
Perhaps running the configurations the way you would run your own custom run configurations would help here. It is described in this article.
I have an integrated selenium/sikuili automation project which I would like to run on windows agent here is the scenario: Machine (A) contains the source code Machine (B) is the agent test runner machine that has selenium grid running on it, when machine a run the test, selenium test is successfully triggered on machine B but when sikuili runs it's trying to search elements on machine(A). anyone has any idea how could I fix this issue.
thank you all in advance
You may want to use selenium grid extensions:
https://github.com/sterodium/selenium-grid-extensions
I fixed it using Jenkins, what I have basically done is creating a salve agent and point it to a remote machine(where I actually build and run my project) just made sure that I had sikuili as var in my remote machine.
friends. I try to understand how does selenium work. I written some tests with JUnit 4. These tests works fine when my app is running and I put as URL localhost:8077 where my app is started. All tests pass as I need. But now I want that my war build will depend by these tests. After these I want that the automated release (Jenkins) will also depend by selenium tests.
I don't understand some things:
Should the selenium test be included in my application or they should be assembled in a standalone application? (I read about Selenium Grid but I am not sure that I need it)?
I have one developer machine, one server with jenkins and the production server. What are the needed steps to implement Selenium test? What Url should be used in test? Is it needed to install Tomcat Server on the same server with Jenkins?
Can I invalidate the build and drop the release on Jenkins if selenium tests are not passed?
Should the selenium test be included in my application or they should be assembled in a standalone application? (I read about Selenium Grid but I am not sure that I need it)?
It depends on how you want to run your tests. Best practice is to call the test configuration inside your maven project and tests will run during your build job. You can also call your maven target after the build is completed.
Selenium Grid is useful but only if you have dedicated machines having proper setup to run those tests, else your tests may often fail. You should consider running your tests remotely on cloud using services like Saucelabs, etc.
I have one developer machine, one server with jenkins and the production server. What are the needed steps to implement Selenium test? What Url should be used in test? Is it needed to install Tomcat Server on the same server with Jenkins?
Selenium tests can be implemented with Maven on Jenkins following the step from here, here and here.
Dev or Test URLs should be used for running the test.
I think you would need Tomcat Server if you are hosting your application on the Jenkins machine or else it should not be needed.
Can I invalidate the build and drop the release on Jenkins if selenium tests are not passed?
When you include the test configuration in your project configurations, the build may fail during the build job if your test fails. You can set how you want to proceed with your build when you test fails like failing the build or pass the build with warning. You may want to get notifications for failed build also.
Ex. Jenkins marks good build as failure because of test failed
Jenkins plugins can be used based on the needs.
You may like to read more about How to do Integration tests here.
I'll do my best to answer your questions, and hopefully clear a few things up for you.
From my experience each test should be created as a new item and then configured to run after your app is deployed or periodically. No you dont need Selenium Grid. It is used for parallel execution of tests.
You'll need to configure your machines as nodes on jenkins and install the jenkins agent on the slave machines. Setting up selenium tests differs depending on how you have written the tests, for example i use maven as my build tool. So for each new test i only need to point towards svn and give the maven launch commands. The url is whatever url you use to access your app. There is a very good article on how to setup jenkins on their site, you can find it here
Yes.
I made a java program which runs unit test on my website.
I need the unit test to keep running during the day while I watch the log.
For this, I search a java platform on which I can run my soft. Openshift will be the best because it's easy to install and maintain.
However I will often modify this soft and if the java project could be built whenever I made a commit it will be the best. That's why I think to Jenkins, but I don't know if it is a good way to run a jar from a jenkins server whereas it is made to do build.
I tried JBoss and tomcat by wrapping my programs into an Enterprise Application Client but I can not run and check the log of the program from a web interface.
Currently my project is a Java Application, using MySQL, hibernate, maven and git.
What would be the best option for you ?
Thanks.
Florian C.
Finally, here is my soluce.
I use Jenkins.
When I push on Jenkins, my project is automatically built and ran using a shell script.
If the build or the run fails Jenkins sends me the command output by mail.
Else, every day, the project is run (using the cron of jenkins) and the console output is sent to me by mail, so I can check the result of my test.