Showing posts with label Mobile App Testing. Show all posts
Showing posts with label Mobile App Testing. Show all posts

Monday, January 21, 2019

Selenium + JavaScript Best Practices


We all knows that by including unit tests in your web application projects you may lead to several advantages. Mainly, an impressive and measurable method of proving code quality to developers and other project stakeholders. Browser automation takes these concepts even further, and applies the practice to running integration and regression tests live within the presentation layer user interface (UI). From there on, we can codify integration test scripts that do all the work for us – proving that the web app works as expected in the platform in which it will ultimately run.

Today’s technology world, especially in automation testing sector,one of the most known and implemented tools used for web browser automation is Selenium. It is not only intended to be used in automating web applications for testing intent, but also for automation of web-based administration work. In fact, it is a set of different software tools, each with a different approach to supporting test automation. Learning all of its tools will give you many different options for approaching different test automation problems.

JavaScript frameworks

Many software programs are composed as web-based applications that operate in an Internet browser. This is the most important reason that net frameworks are becoming increasingly more popular among other frameworks. Now, JavaScript is a widely used language for web software development, and even back-end developers favor JS rather than every other language. It's easy and flexible, but in exactly the identical time it also allows building complex web options. The advantages of using JavaScript frameworks are as follows:

Performance -- Projects that used to take weeks and hundreds of lines of code, can currently be achieved much quicker with well-structured pre-built patterns and functions.

Security -- Top JavaScript frameworks have company security agreements and are encouraged by large communities where users and members also act as testers.

Price -- Many frameworks are open source and totally free. Since they assist developers to build custom solutions faster, the ultimate price for internet apps will probably be reduced.

Combining Selenium and JavaScript

One of the most popular JavaScript applications menus for creating dynamic web sites and internet applications is MEAN stack (MEAN stands for Mongo DB, Express, Angular and Node.js). Here, I'll utilize Selenium integration with Node.js, because it's simple, nicely organized and quite suitable for use for test automation functions.

Node.js framework and Selenium installation

The code example below generates a very simple validation test for the google web page. To begin writing Selenium tests with Node.js and coffee script, we all need to get a Node.js frame using a Selenium plugin added to it.

If you installed Node.jsthen start a command line and then type these commands to make a new Node.js Project and init the fundamental job structure:

mkdir google_test

cd google_test

npm init

NOTE: in case you haven't previously installed Node.js, download it from its official site .

Next step will be to set up the node browser automation library called"selenium-webdriver". In the console you started previously, use Node's built-in package supervisor (NPM) and type the following command to get the package:

Npm install --rescue selenium-webdriver

The option"--rescue " creates a new bundle that will be saved into the project's package.json file.

Before we can begin to control the browser we will need Selenium WebDriver to your particular browser that we need to automate (IE/FireFox/Chrome/Edage). Here, I'll show an example with gecko driver for Firefox. You can obtain a driver to get a desired operating system from their github project:




When you get into the driver, then unzip it and put in on your own operating system on the default location. You'll Also have to upgrade the environment PATH variable:



 Writing tests using Selenium

Manual site regression testing can take quite some time, as it needs a tester to run each test one at a time across various browsers. Running tests asynchronously across different browsers will conserve a great deal of time, and Selenium WebDriver provides this functionality. Selenium handles asynchronous analyzing by using JavaScript promises.

Now, let us write the first code and make one simple test that assesses if Selenium functions stand alone, without using Mocha. The test will do the next steps to ensure that we actually reach the google webpage:

Open google web page.
Get its title by using promise.
Output it to the console.

NOTE: You can use any editor of your choice, however I advise using Atom that works well with the Node.js frame. You can also set up the atom-ternjs plugin to it, which may add support for Node.js, Angular along with other languages.

Create a new JavaScript file on your job, multiplying: first_test. js.
Add the following code to it



Here's a Brief code explanation:

From the first 2 lines we place example of selenium-webdriver, also assembled our browser using the webdriver and its Firefox plugin.

Then we browse into the google web page and receive its name by applying JavaScript's guarantee
We direct the title to the console and quit our browser.

Let us do this evaluation by using the following Node.js control:

node first_test. js

We'll get the following output:



This means we are on the ideal track, and also Selenium driver is working.

Wednesday, October 17, 2018

Types of Mobile App Testing

As the way that life has gotten faster and technologies can also be becoming wider, more speedier and improved. Within this fast-paced existence, everybody else wishes to skillful cell phones which could solve the aim of cellphone and notebook.The majority of the cell phones are enhanced with innovative features & applications which are far more effective in solving most of the aim of their users want. Those apps are analyzed by various sorts of analyzing methods.
Here are types of Mobile App testing: 
Let us view, which testing process will be included with mobile app testing.
Functional Testing:
Functional testing works to the operational behavior of this applying to ensure the software is currently doing work as each of your prerequisites. Functional testing works to the user interface and also telephone leaks of this applying. 
Performance Testing:
The screening procedure is completed by professional to try the operation and activities of their software that go to various mobile device challenges.
Memory Leakage Testing: 
Memory Leakage testing is just one of those terrible things of the cell application analyzing that straight have an impact on upon the operation of the mobile devices.

As a result of memory leakage, then the procedure can slow while shifting the document or affecting getting any software mobile apparatus could pull the plug on mechanically.
Interrupt Testing:
Interrupt screening can be just a procedure of analyzing a cellular software that works may possibly acquire disrupted whilst using this applying.
Usability Testing: Usability screening is also utilised to check the cellular software regarding flexibility, usability. The screening procedure leaves certain the cellular program is currently user-friendly and supplies a proper consumer experience on your own clients.
Installation Testing: The Mobile devices hold two types of software testing, yet the main one that mechanically will come with cell phone OS, and also the other you need to set up notably in the shop to use the specific app.
Installation testing is also utilized to check that the specific app is setting up, uninstalling, and upgrading precisely with no disturbance.
Operational Testing:
Any cellphone OS and background OS offers inbuilt back up and retrieval operational purposes which spare recover most of files or document of cellular phones or software that was lost thanks to a rationale.

Operational Testing is also utilized to examine this the distinct backup and retrieval procedure is operating precisely and reacting in accordance with the prerequisite.
Security Testing:
The Security testing is to check the application data network and data safety to inspect the application form's network and data security would be reacting as each provided requirement/guideline.