Currently Browsing

Posts Tagged ‘ website testing ’

Cucumber in Web testing (part 7 of 8)

7. Hooks


Cucumber provides a methodology called Hooks which is analogue to traditional before and after methods. The hooks must be annotated with @Before and @After in step classes. Make sure to use and annotations and not the JUnit ones. By default each before method will be executed before all scenarios and each after method will be executed after all scenarios. If a hook needs to be executed only for a particular scenario, then we need to use tags. To tag a before method, we need to insert a string parameter to the annotation. To bind the tagged hook to a particular scenario we need to “annotate” the scenario with the same string tag. Here is an example:

	public void login() throws Throwable{
	public void close_driver() throws Throwable {

@login @close
 Scenario: Successful LogOut
    When User LogOut from the Application
    Then Message displayed LogOut Successfully

Creating a Website Testing Plan

After the front-end design of a website has been created it’s time to test it. There are many things to consider, such as cross browser and device testing, bug tracking, team management, etc.
As the scale of the projects grows larger, a more efficient way of testing is required. This efficiency is best achieved by putting together a thorough plan.

Benefits Of Planning

Establishing the project’s specification and which browsers and devices are used will reduce development time and costs, and help to keep focus. By showing detailed reports of completed test plans, based on the project specification, a better understanding is achieved with clients and friction is reduced. Knowing that you have thoroughly tested the project you can have confidence that the deployed product will perform to specification.