Don't wanna be here? Send us removal request.
Photo

Teaching the dog to drive a car.. (Source: http://ift.tt/2mxNtb9)
164 notes
·
View notes
Photo

Experience: Learning the right way to connect the dots.
189K notes
·
View notes
Text
The Role of Test Automation in CI-CD
In this competitive market with rapidly changing requirements and evolving products, continuous delivery, continuous integration and continuous testing are all intertwined. This extremely fast adoption of business evolution, puts a serious pressure on software development. Conceptualization, design, implementation, and deployment, all needs to be done within a span of a few months or someone else will come up with it before you do. Also, after the product is deployed, be it a web or a mobile application, constant improvements and enhancements are expected.
Continuous Integration and Continuous Deployment are most often used together and are referred to as CI-CD. Individually, they represent two different processes. CI refers to running integration tests at every code change, while CD refers to deploying every change that are validated by the tests. However, now-a-days CI-CD is used to refer to the automation of processes from development to deployment. Hence, CI-CD can be said to consist of the following steps:
- Change of Code or Commit
- Building the software based on the code developed.
- Automated testing
- Deployment of the changed code
In the above process, Automated Tests can be said to be the most important part of the CI-CD process. There can be no Continuous Integration or Continuous Delivery without automated tests that run fast, have a good coverage and no errors.
Test automation can be divided into multiple suites, each having its own objective.
- Unit Tests: This test is run first before any changes are made to the code repository. Normally, individual classes and functions are tested here. This test is most often performed by the developers themselves.
- Integration Tests: This test makes sure that the different modules of an application work properly with each other. Generally, integration tests need to be performed in environments that represent production environment.
- System Tests: This tests the entire system in an environment that closely resembles the production environment.
Through Continuous testing, developers are able to perform a live test of the functionality and behavior of their code with test automation tools. Regression Testing, User Acceptance Testing and Performance Testing, all need to be executed in order to ensure the quality of the application in various customized environments. When the test module configuration is correct, tests can be automated until the alert systems notify a build failure.
Without proper execution of Continuous Testing, CI-CD will only remain an unfulfilled requirement. Continuous testing or Automated testing, helps saving in terms of production costs, as bugs reported after deployment in the production environment is a costly matter.
Conclusion
On the road to achieving continuous delivery, the main requirement is to minimize the cycle times and keep the costs low at the same time. Automated testing helps to achieve this and build an effective system. The best approach on the way to CI-CD would be to invest in a robust and scalable test automation suite.
7 notes
·
View notes
Text
Selenium Quick Start
You want to use test automation on a web application. You have heard of Selenium. You want to get started quickly and you want to make sure you are headed in the right direction. I would like to share with you some code snippets that will help you dive into web test automation. You should be able to get your own automated Selenium testcases up and running very quickly and easily. This will work perfectly if you have never before used Eclipse but it will be easier if you know it. If you want to do test automation, basic knowledge of scripting / programming will be required. Anybody who tells you otherwise is a liar.
The best way to use Selenium is to use it in Java. I personally love the combo Eclipse, Java, Junit for testcase design, test execution and also reporting. Using the Java language allows you to easily integrate database queries into your automated tests. Using Junit even allows you to integrate your tests in a continuous integration framework like Hudson that you can use for test reporting and analysis.
When i started out with Selenium i had to find a way to use it properly since i did not want to use it as a capture-replay tool. After doing some research on design patterns and trying out a couple of different ways to get a certain amount of abstraction between the testcase code and the technical selenium code i settled on a pretty simple structure that will be used for all new web projects.
The idea of separation of the test design and the technical layer is reflected by both the Facade pattern and the Page Objects pattern. Why would those patterns be important?
Let us assume that you have created some automated tests of a web application. Some day, one element of the webpage under test is changed. If you used the technical layer directly to describe your test cases you now have a problem because you will have to change each individual test case that uses that element.
By using a facade/page object to represent a certain web page you only have to change the element once, in the facade. Your test cases remain untouched.
Here are the basic ideas on how to get going with Selenium in Java using the patterns mentioned above:
In your Java project, create two packages: facade and test
The facade package holds all the facades belonging to a web application. A facade is the technical abstraction of a web page or a certain logical region of a web page (e.g. a navigation bar)
The test package holds all your Junit test classes. Each test case is represented by one Junit test method. In a test case you always use the facade to do something on a web page. You do not use Selenium/Webdriver directly in your tests.
A parent test class holds tasks that should be common for all tests. Each test class inherits from this class.
Selenium Server is started automatically at startup of each Junit test class. For this, the @BeforeClass and @AfterClassSaves annotations of Junit come in handy. Saves you lots of headaches if you dont have to start the server manually.
Lets get started: Installing the dummy project:
Download Eclipse. I recommend the version “Eclipse IDE for Java EE Developers”.
When starting Eclipse for the first time it will prompt you for a workspace directory, this is the directory where your files will be stored.
In Eclipse, create a new Java project called selenium_quickstart and copy the selenium quickstart files into the new project directory.
Download the latest versions of Junit and Selenium RC.
IMPORTANT: You need these jars: junit-4.8.1.jar, selenium-java-client-driver.jar, selenium-server.jar. Copy them to your projects lib/ directory.
done
Start your first automated test:
In your eclipse project, navigate to src/test/java then to com/example/webtest/appname/test.
In this directory your testcases will be stored.
Right click on StandardSearchTest.java and select Run As => JUnit Test
The automated test is now being carried out and you can watch it proceed.
If it goes too fast you can debug the test case to be able to walk through the test step by step. You can find info on how to debug in eclipse here: http://eclipsetutorial.sourceforge.net/debugger.html.
How you should go about writing your own tests:
All you need to do is adjust the files in src/test/java.
Replace the app name / domain.
Create your facades in the facade directory.
Create your tests in the facade directory.
Edit your basic test parameters like the base URL of your application in Base.java.
3 notes
·
View notes
Photo

One of these is not like the others (Source: http://ift.tt/2mt6JTV)
1K notes
·
View notes