Introducing Nightwatch.js

 
Nightwatch.js is a testing solution that lets you use JavaScript to write browser-based, end-to-end tests. Nightwatch can also be used for writing Node.js unit tests. Nightwatch is written in Node.js and using the W3C WebDriver API (formerly Selenium WebDriver).

Installation:

Wondershare MirrorGO

 

In my last blog post, I talked about Vysor, a screen mirroring application and the benefits of using similar tools for manual testing. This time I will write about Wondershare MirrorGO, another Android screen mirroring application with rich features and beautiful interface.

MirrorGO Android Recorder is developed by Wondershare. They promote it as an Android mirroring application for gamers to play on bigger screens and record their games. Mirroring works using ABD (Android Debug Bridge). For using MirrorGO, you need to download an application for your Android device and for your PC as well. After running both applications on the devices, the software will guide you through the setup process. After an easy setup, you are ready for testing on your desktop screen. The full version of the application is usable for 30 minutes, after that you have three subscription options.
MirrorGO has a really good looking, modern user interface. I really liked it. The guide was understandable and the features are reachable quickly.

Setting up Allure (Part 1)

What is allure?

 

Allure is a flexible test report framework that not only shows a very concise representation of what have been tested in a neat web report form, but allows everyone participating in the development process to extract maximum of useful information from everyday execution of tests, with the possibility to add screenshots, logs, attachments and so on.

 

In order to get results, you need to:

  • • Add AllureRunListener to Junit
  • • Add AspectJ Weaver and respective properties
  • • Run test

 

Maven installation

Load testing with WAPTpro

Load testing is one of several different kinds of Performance related tests (Load Testing, Stress Testing, Spike testing, Endurance testing, Scalability Testing, Volume testing). In a sense of usage all of them are related to Performance Testing definition, which in one sentence, would be:

“Performance Testing is artificially creating or simulating load and measuring how your environment handles it.”

Load testing provides system monitoring by increasing the load. You can test how the system performs under higher load, but also under base or expected load. During Load Tests you can monitor response times, throughput, server condition and much more.

The goal of Load Testing is not to break the target environment, but to measure performance parameters under high load.

WAPTpro

WAPTpro is one of several Load testing tools that can be used for this purpose. It provides interface for testing performance parameters of a websites and web-based internet applications.

Create Scenario

To perform Load testing for a website with WAPTpro, first you need to create a test Scenario with general parameters for the test: number of virtual users, type of load, test duration or the total number of sessions for all virtual users. This can be obtained in Scenario Wizard that you can open by click on a New button in a upper left corner of the WAPTpro window. Later, these settings can be changed by clicking on a Test Volume menu item in a left section of WAPTpro window.

Cucumber in Web testing (part 8 of 8)

8. Keyword “Examples” and conclusion

 

Gherkin keyword: Examples

Cucumber provides another useful Gherkin keyword which is used scenario parametrization. A scenario with an “Example” keyword will be executed multiple times with different parameters. Here is an instance:

@init @logout
  Scenario Outline: Successful Login with Valid Credentials
    Given User is on Home Page
    When User Navigate to LogIn Page
    And User enters username "<userName>"
    And User enters password "<password>"
    And Click login
    Then Message displayed Login Successfully

 
Examples:
| userName | password |
| username1 | password 1 |
| invalid | invalid |

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 cucumber.api.java.Before and cucumber.api.java.After 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:

@Before("@login")
	public void login() throws Throwable{
		openDriver();
		System.out.println("login()");
		testSteps.user_is_on_Home_Page();
		testSteps.user_Navigate_to_LogIn_Page();
		testSteps.user_enters_UserName("Tester843");
		testSteps.user_enters_Password("x%kzJwbsW1)AIB2k");
		testSteps.click_login();
		testSteps.message_displayed_Login_Successfully();
	}
@After("@close")
	public void close_driver() throws Throwable {
		System.out.println("close_driver()");
		baseObject.driver.close();
	}

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

Cucumber in Web testing (part 6 of 8)

6. Page flow

 

Page flow is a widely used pattern in web testing which describes how we should use our page objects to write more readable and well designed code. What page flow telling us, is that in our test code every Page Object method which navigates from one page to another should return a new Page Object. The following actions in the test code will be executed by calling methods from the newly returned Page Object. Here is an example:
 
Sample code - Password change
 

The benefits of this pattern are:

  1. Easier to write test code. The Page Object methods reveals which page will be the next the method execution.
  2. Improving test code readability
  3. We got additional verifications, because each page object extends the Selenium’s LoadableComponent class. When we are creating a new instance of a PageObject the isLoaded() method will be executed, which contains validations against must displayed elements on the page.

Cucumber in Web testing (part 5 of 8)

5. Web testing project structure

 

Structure without cucumber

The following picture represents our basic structure what we use for web testing:

 
TestBase contains the initialization and termination of a Selenium Webdriver. It usually contains a before() and after() method where we start and close web browser. In addition to this we setting up desired capabilities if needed.
 

Can Chrome DevTools’ Device Mode be substitute for the Real device?

Every tester probably heard about Chrome Device Mode, if you didn’t, don’t worry, we will try to introduce you with it.
 
Open the Chrome DevTools and Toggle the Device Mode button Device Mode to turn Device Mode on or off. Device Mode will emulate your site across different screen sizes and resolutions. In Viewport Controls you can change the device for emulation or you can make your own custom device presets.
 
ViewportControls
It’s a very simple tool and easy to use, but if you need more details check out Google’s directions.

Make your manual testing faster with Vysor

Testing Android devices can be frustrating. Entering long texts, taking screenshots and screen recordings, transferring files from the Android device to PC, losing time just with putting down – picking up the deviceScreen capture from Vysor. All these things can be forgotten if You could use the Android device on your PC.
 
There are many apps available for screen mirroring and Vysor is one of them. Vysor is a Chrome extension developed by ClockworkMod. Because it’s a Chrome extension it is compatible with almost all operating system and devices. Vysor works using ADB (Android Debug Bridge). The Chrome app automatically detects any ADB-enabled device connected to the computer. With a few simple steps the phone or tablet screen will be available on the PC with full control over it. It has a free and a paid version. Free version, with screen mirroring and screenshotting, is probably enough for most of the users. If you want some more functionalities like higher quality mirroring, fullscreen mode, sharing, drag and drop option, paid version is for you.

 

How to set up Vysor?