Important Test Cases For Mobile Applications

Mobile application development is gradually taking a front seat in software development. Mobile testing is day by day increasing its prospects. But still, testers have many questions regarding mobile testing like how to create test cases and test scenarios, how to use various mobile testing tools, etc. In this article, we will cater to test cases and test scenarios for mobile testing.
Below we have curated a list of sample test cases and test scenarios for various types of mobile testing.

Types of Test Cases

  • Performance Testing Test Cases
  • Functional Testing Test Cases
  • Compatibility Testing Test Cases
  • Security Testing Test Cases
  • Recoverability Testing Test Cases
  • Usability Testing Test Cases

Performance Testing Test Cases

Performance testing for the mobile application ensures that your application performs as required under certain performance requirements like a number of users, memory requirements, etc.
In performance testing, we largely need to have test cases for

  • Device performance
  • Server/API Performance
  • Network Performance

Your test cases should deal with the following aspects:

Device Performance:

  • Application start-up time
  • Memory consumption
  • Usage with other Applications
  • Battery Time while using the application
  • Hardware and Software variation
  • An application running in the background

Server/API Performance:

  • API calls generated
  • Data to and from the server.
  • Server downtime

Network Performance:

  • Network Speed
  • Packet Loss

Also Read: How to create Test cases For Android Application

Few test cases that you can conduct for performance testing are

  1. Test application performance under different load conditions.
  2. To test if the network coverage supports the application at various user levels.
  3. To test the application performance under prevailing client-server configuration setup.
  4. To detect infrastructure and application bottlenecks that hold back your application from working as expected.
  5. To test the response time.
  6. To evaluate the application for planned and unplanned load volumes.
  7. To evaluate battery time while using application
  8. To test application during network change from WIFI to 2G/3G/4G or vice versa.
  9. To test the memory leaks, Camera, battery consumption, resources like GPS.
  10. To test if the application works well when the device is being moved from one location to another.

Functional Testing Test Cases

In mobile testing functional testing generally deals with testing the user interactions and the transactions. When conducting functional testing, you have to consider a few scenarios

  1. Business functionality usage of your application like banking, gaming, social or business
  2. Target audience type like consumer, enterprise, education
  3. Distribution channel you would like your application to share one.eg. Apple App Store, Google play, direct distribution

Based on your application and requirement you can have following test cases for your testing:

  1. To verify if the essential and non-essential fields can be easily identified and are displayed on the screen in a distinctive way.
  2. To test the essential fields for their proper working.
  3. To test that during an incoming call the application goes to minimized mode.
  4. To verify your application does not crop up any hindrance for other applications installed on the system.
  5. To test the application’s compatibility with required versions of the devices.
  6. To test the application for the proper working during starting and closing.
  7. To test your application supports required social network options such as posting, sharing, and navigation, etc.
  8. To test for truncation errors. Any truncation error should not harm your system and should be under a safe limit.
  9. To test for proper network error message during improper network connection.
  10. To test the smooth installation of the application provided all requirements are fulfilled.
  11. To test the auto-start facility based on the requirements.
  12. To test if the mobile is able to receive and store messages while your application is running.
  13. To test if your application does not hinder the multitasking capability of the device.
  14. To verify the required navigation among the related modules
  15. To test if application restarts at the same point after a system crash.
  16. To test the availability of the user guide.
  17. To test any payment gateway transaction support if required by the application.
  18. To test for required page scrolling scenarios.
  19. To test newly added functionalities or changes made to the code.

Compatibility Testing Test Cases

Compatibility testing is very important as markets are flooded with various kinds of mobile devices. Your application should be compatible with all these devices to reach wider customers. Compatibility tests your application compatibility with various mobile devices, OS, and a combination of both.
Some of the prominent test cases for compatibility testing are:

  1. To test user Interface of the application on various screen size.
  2. To test your application supports various mobile devices.
  3. Test application’s compatibility with various OS
  4. Test applications compatibility with a combination of different devices and different OS.
Security Testing Test Cases

In times of increasing cyber-crime, security testing is very important. It checks whether your application fulfills all the security requirements.
Below are some of the most important security testing test cases for mobile apps that can ensure better security of your application:

  1. To your application withstanding capabilities against brute force attack
  2. To test the application against buffer overflows and memory corruption cases.
  3. Test custom created files and test that they do not perform any malicious deeds.
  4. To test applications immunity against malicious runtime injections.
  5. To test the well-being of cryptography code.
  6. To test if your application supports a strong password protection system, and does not allow an unauthorized person to change password.
  7. To detect dynamic dependencies.
  8. To test security against SQL injection-related attacks.
  9. To detect and recuperate from unmanaged code scenarios.
  10. To test if certificates are verified and whether your application support Certificate Pinning.
  11. To test the application response from the denial of service attacks.
  12. To analyze data validation requirements.
  13. To test the business logic implementation is secured.
  14. To test file system interactions.
  15. To test the protocol handlers.
  16. To test applications immunity tonasty client-side injections.
  17. To test that keyboard cache is protected from apprehensive data storage.
  18. To test if regular audits for data protection analysis are supported.
  19. To test if your application goes through a proper authentication process before sharing sensitive information.
  20. To test your application is immune to insufficient session expiration.
  21. To inspect file caching.
  22. To test for cookies.
  23. To test whether session management is enabled to prevent unauthorized users to access unwanted information.
  24. To test different data streams.
Recoverability Testing Test Cases
  1. Test for Crash recovery
  2. Verify recovery state of the applicationafter unanticipated crash
  3. Test for Transaction interruptions.
  4. Verify application’s transaction handling capabilities during a power failure (i.e. Battery dies or sudden manual shutdown of the device)
  5. The application recoverability when the connection is suspended.

Usability Testing Test Cases

The usability testing tests whether your mobile application is easy for the users to use. The main objective of usability testing is to whether your application supports intuitive, easy-to-use, and industry-accepted interfaces.

  1. Test that the buttons on your application are of the required size.
  2. To test icons consistency with the application.
  3. To test for the colour coding of the buttons as per the requirements.
  4. To test for zoom- out and zoom-in facilities support in your application.
  5. To test the proper acceptance of keyboard input.
  6. To test the support for undoing an action within a time limit, when any wrong item is touched.
  7. To test no overloading of contextual menus.
  8. To test that the text is simple, readable and clearly visible to the users.
  9. To test for the apt font.
  10. To test that the users are prompted when they download a large amount of data not beneficial for the application performance.
  11. To verify the closing and reopening of application from various states.
  12. To test for language translation facility.
  13. To test the synchronization of application items as per the user actions.
  14. To ensure the availability of user manual for the ease of the users.

Conclusion
Usability is all in all a manual testing approach as only a human can understand the usability accepts and ease of using the application. We hope these test cases will help you with your mobile testing endeavor.

Dating Apps Test: How To Test?

Dating Apps Test: Why do we need that? this question might have come across many companies thinking about leveraging the popularity of such apps.
You must Remember that there are hundreds of dating apps out there. Many are not successful? Reason? Bugs! Users will be always driven towards apps that have high user experience and stable.
To make a stable app you need to test it rigorously so that no bug will be there and the app can assure your company success.
to know more about how to perform Dating Apps Test, continue reading this blog

How to test a dating application
Before we move further in the topic of dating application, it is essential to know how these applications are even tested. This solid foundation will open up new doors in terms of coding and testing for us to understand the main concept of the headliner.
There are several applications for dating that can be downloaded in order to test them. Once, you have tested them, you can easily put up a review for developers to understand what goes wrong.
Whereas in most of the scenarios, a testing team is assigned to ensure that they understand the flow of an application and test it with the highest priority.
The main thing that a tester knows better than others is that a location specific application is easy to test but when it comes to multiple locations then it can be a daunting task.
It requires a lot of struggle and localization for the testing methods to come into play. So, let us understand the workflow in order to get a hang off dating application testing.
1. Download an application
It will actually depend whether you are putting up an application in the beta mode of testing or having a team to do the deed.
In the beta mode, some of the users are given an authority to test an application by downloading it and checking on the essential features. Whereas in the testing team mode, the testing team will follow up a certain process to test an application properly.
In the beta mode, a user is required to search an application on the store of their phone. One can easily click into an application with the help of keywords, description, and title of an application given by the developer.
In addition to this, it is essential to know the localization of that particular application. This will help in placing it in the group of a global or local audience.
Once, this is done, the people can download the application which has signed up for the beta mode. They can send out their reviews for developers to understand the bugs or errors. It is the best in case one don’t have local testers or they want the live response of their audience. The first and foremost thing that this will help in is to understand the downloading and installing process.

  • There are times when a user has trouble in downloading an application. This will help in eliminating that trouble.
  • Then there is third-party interference in an application that might trigger a user off. This point must be tested as well.
  • There can be a custom error during the time of launch that can be filtered out.
  • In addition to this, there might be memory errors or location issues.

In order to avoid these problems, it is better to launch an application as the beta testing. This will reveal a new dating application to users and even test your application.
2. Get registered
Now, since the download and installing are handled, comes the registration process of a user. For every single application, we all have seen two types of application. One of them is having a personal user password and ID while other depends on an API network. In the case of testing, it is essential to test both the aspect.
In the personal name and password system, one needs to fill in their account details and get them verified. There are many mandatory conditions such as email address and phone number through which an identity of an individual can be tested.
As the tester, you must know the importance of reset and cancel button as well. Then, once the details are submitted, check in the table and database where it is getting stored and how they are verifying the information. Make sure that no personal data is shared with the third-party application.
In case, some of the information is missing, check on the popup. These are essential things during the whole process. Then, comes the API network of the registration process.
This type of method requires an Open authorization (OAuth) process to check on the checklist of a process. The main thing that check is to know the security of the API network that is followed by the creditability.
3. Match Made
This is the most essential part of the whole dating application. The main work done by such an application is to make a perfect match as per the algorithm. The main aspect will be movies, books, hobbies, music, etc.

In this step, one needs to review the test criteria of a user on which the match is done. This can be achieved with the help of matching criteria test. Then, you need to check that if one criterion is changed then how an application is reacting.
This can be verified while matching the data of both the parties after the match is made. Then, you need to understand the whole concept of rejecting a person in the algorithm. This will give you basic information about the whole process of acceptance and rejection that occur in a dating application.
4. Personal Chats on the application
Once, the work is done, now move to the next step which will be getting in touch with the matched person. It is the part where one gets involved in the personal chat.
This features must be tested as per the connectivity and how many characters are shared among individual. There are two types of testing mode that is used to test this feature such as a functional test and performance test.
In the functional testing mode, the functions are tested in regards to launching a chat, sending and receiving messages, emoticons, files, etc. This will also include sharing off video, image, and even doc files.
The further steps will include the testing of the send button, launching options, visiting the profile, status of chats and even total limit of sending a message.
In the performance testing mode, one will check on the smoothness while running an application. It will include the personal chats time exist, continuous mode of working, the response time of the chats, failed message ratio, and even the sending mode of files. This will involve every aspect and how the application is reacting to the change.
5. Mode of Payment
Nothing is for free in the world, not even a dating application. There is a different mode of earning that is used by the developers to make bucks such as pro-version, in-app ads, in-app purchase and even user subscriptions.
These are the basic mode in which the developers make money. For all the cases, it is essential to test off few essential parts of an application such as card details, data transferring, etc.
The card details will include the personal information of users such as card type, card number, account number user registration number, expiration date, CVV number, holders name, etc.
This type of information is extremely sensitive and requires multiple modes of security. Hence, it becomes essential to test the data transferring to ensure that no data of a user can be leaked. For be sure, a tester needs to test, the server connection security and also the verification mode such as SMS, phone, Chatbot and even emails.
6. Testing user experience
Now, the final step of testing is to test how the total experience of a user is while testing a date application. It can be determined in terms of the technical viewpoint to check on the perspective of a user.

However, this can be tested by the user as per their planning mode since there is a different mode to follow this type of testing. It will have a transition animation scale, window animation scale, animator duration scale, etc.
Final Words
The main reason that people are actually bending toward dating application is that it is extremely popular as compared to other application.
People are depending on them due to advancement in the globalization of an application.
This allows them to get in touch with other people all around the globe. Also, due to modernization, people don’t have much time to go and focus on their love life.
It is a chance for them to get a proper life with different people. Also, one can found their soulmate or a friend for a lifetime. Hence, it is a win-win situation.

11 Tips and Tricks For Appium and Selenium

Selenium and Appium are two well-known automation testing tools. Selenium is largely leveraged for testing web applications whereas Appium is widely used for testing mobile applications. Bundled with many features, both these tools are highly recommended for software testing.
But you need to have a proper understanding of these appium and selenium tools to get best out of them.  There are few tips and tricks that can help you get best out these tools and leverage them to their best abilities.
Let’s make our job easier with these veteran Tips and Tricks about Appium and Selenium.

The Use of Waits: 

Using Thread.Sleep() is a common method of “waiting” while any processing is going on. But it possesses a few drawbacks. Here is how we can overcome it.
a)    WebDriverWait.  It census your query every 500ms, and return when the wait condition is fulfilled. WebDriverWait can explicitly put a maximum threshold to elude locks and infinite waiting.
b)    FindElementBy / FindElement(..): Second method is by invoking FindElementBy or just FindElement(..). FindElementBy waits until the element is found and returns null if maximum wait time passes. But be sure you have to explicitly configure the implicitly waits.
1. Locating Elements
Locating element is not a tough job in selenium and there are many ways to do it. But the haunting part is getting StaleElementReferenceException.
It happens when you assign IWebElement reference but it already has some other location in the DOM. The solution to StaleElementReferenceException is to re-query and reassign the element reference.
2. Sending Keyboard input
Selenium allows sending inputs in two ways. First is by setting “value” property of editable elements by using ExecuteScript() / ExecuteAsyncScript(). Second is to use SendKeys() API.
I would suggest you use ExecuteScript() / ExecuteAsyncScript() method when you are more concerned about filling in a few fields and when you are not concerned about DOM events being fired and concurrent character-by-character verification.
But if you want to focus on real-time validation, the second method i.e. using SendKeys() API will be more apt for you.
3. Executing JavaScript code
You can execute JavaScript in either of the below-given ways depending upon your requirements.
i)    ExecuteScript().ExecuteScript() does not execute the next line of         test code till script execution is returned.
ii)    ExecuteAsyncScript() does not block your test code.
4. Drag & Drop Interfaces
Action Builder API, and the “DragAndDrop” and “DragAndDropToOffset” methods support easy drag and drop interface in Selenium.
5. Switching between windows and iframes
You can easily switch between windows and frames in Selenium.

  1. For iFrames

driver.SwitchTo().Frame(frameElement); //IWebElement

  1. For Windows

driver.SwitchTo().Window(handle);// driver window handle
and then can switch back to the original window by using
driver.SwitchTo().DefaultContent();

  1. Using drivers for multiple browsers

When using the driver API, always refer it by using RemoteWebDriver class for all the browsers used for running tests.
It is good to label your environment in a text/XML file and then deconstruct this and return the correct driver instance.
6. Cleaning UP
When you are done with your testing, you need to free all the resources and close the browser.
For this you can use Close(), Quit(), and Dispose().  Quit() closes all browsers, close() closes the existing browser  while Dispose() calls the quit() and closes all browsers.
Now when we are done with a few tips and tricks of working with selenium, let us now get better in our Apium skills.
Appium is one of the widely used mobile app testing tools. Though its users encounter some common problems while using it…
Here are some tips and tricks that can help you handle some common problems faced in using it and making it’s working more efficient and effective.
So, here we go…
7. Writing cross-platform tests 
One of the major issue in testing mobile apps is we have to write different test scenario for Android and iOS. Having common tests can be a big benefit in terms of saving time and efforts.
Though it gets much easier having the same set of test cases for both if your application is the same from a UI point-of-view.

Read also :  Testcafe Vs Selenium. Which is Better?

Just make sure that the accessibility IDs on corresponding UI elements in each version of the app matches with each other. If it stands true, you can run the same test on both applications. Also, be sure your test sets up the appropriate capabilities for each platform.
Based on different platforms, here are some more and little-known tips and tricks about Appium that can make your testing easier.
8. For All Platforms

  • AutoWebView – it is very useful for Cordova apps and helps to start in the webview context.

9. For Android

  • ignoreUnimportantViews – It is a very useful method to quicken your Android tests.
  • nativeWebScreenshot – Helps you to take a screenshot from UIAutomator. It is very useful if your screenshots from chromedriver are not as expected.

10. For IoS

  • locationServicesAuthorized – It helps you to prevent showing an alert when you are trying to use the user’s location by pre-authorizing location services.
  • Auto[Accept|Dismiss]Alerts – It helps you avoid alerts from disrupting your tests.
  • nativeWebTap – Permits users to use non-javascript taps.
  • safariIgnoreFraudWarning – It is beneficial in cases where your test environment doesn’t have 100% perfect SSL setup.
  • interKeyDelay – Sometimes Appium’s typing speed can cause a problem with your application, in such cases, interKeyDelay can evade the problem.
  • sendKeyStrategy – Helps in avoiding the keyboard altogether.

11. Networking Conditioning
You can use driver.setNetworkConnection(value) to stimulate various states of connectivity when you run your tests.
Hope these tips will prove helpful to you, will be back soon with some more useful testing tips and tricks. So stay tuned!

Why Should You Shift to Functional Automation Testing?

Do you get bored with manually testing your code for bugs again and again? Proper functioning of the code is the foremost thing that matters.  If your code does not act as per the requirement specification, it is no longer of any use.

Functional testing assures that your code functions as per the requirements. But alas! Even a small change or an alteration in your code can alter its working. Hence it is advisable to retest your code every time a change is made to the code.
But running same test cases again and again can be daunting. And there enters automation testing. Automating your functional testing can relieve you of a lot of burdens and can save you a lot of time.
What is Functional Automation Testing? 
Before moving on to functional automation testing, let us first know a little about Functional Testing.
As discussed earlier functional testing confirms that every function of your code works in accordance with the requirement specification. Functional testing requires you to send appropriate inputs and to verify the actual output with the expected output.
But being the foremost quality assurance process, you may be required to repeat functional testing. And hence to ease out your work it is advisable to automate your functional testing process.
Functional Automation testing is a process that assists you in easy and faster execution of your functional test cases. Manual testing requires you to execute the test case step by step, which can be time-consuming as it is done by hand.
And to outcast, this peril, automating functional test case comes as a savior saving on both time and efforts. It helps in executing functional test cases automatically with no human intervention.
Before moving forward let’s look into some drawbacks of manual functional testing.
Drawbacks of Manual Testing
Here are some weaknesses of manual testing that promote testers to adopt automated testing:

  • Manual functional testing is very time-consuming.
  • Functional testing like regression testing becomes very repetitive and losses testers’ interest.
  • It requires many resources.
  • It might miss out on a few scopes of functional testing.

Why Functional Automation Testing?
Considering the current scenario where we develop software at a fast speed and alterations and enhancements are done at an equally fast speed, we need a methodology where we can test our code with an equally high speed. And that is where a need arises for functional automation testing.

Know More: 7 Best Practices You can Consider for Functional Testing

Companies are now moving toward Agile and DevOps, increasing the importance of automation than ever before. The frequent integrations and enhancements in the code require test cases to run quickly and accurately. And automation functional testing assures the best accuracy and quick run avoiding all human errors.
The main reason for a switch to functional automation testing is to save on both time and money. It assists the quick feedback to the developers for any bugs and errors.
Apart from time and money savings, Functional automated testing also benefits in:

  • More precise benchmarking.
  • Fewer faults because of human error.
  • Gives wider test coverage.
  • Assists reusability.
  • Helps in faster release of the software.
  • Assists in faster feedbacks to the developers about the bugs in the code.

So are there any downsides to creating automated tests?
What’s the real story?
Functional test automation as software development
Functional automation tests or any other automation tests are a piece of software code that relies on one or other programing language. This makes it a complete software development activity where you develop a code to test another piece of code.

Developing functional testing code is equally complicated like other software development projects and presenting similar issues like them.
So take care to follow software development best practices to develop a successful functional automation test case.
Should you automate all your test cases?
Automating all the test cases does not seem to be a good idea. Rather, not everything is even automatable. To look out for what test cases you should ideally automate, consider the following things:

  • Deterministic test cases
  • Automate test cases that do not require manual communication
  • Test cases that deals with fiscal-related areas of the software
  • Test cases that deals with risk areas of the software
  • Test that requires running on different data sets.
  • Test cases those are difficult for manual testing.
  • Test cases those are required to run on various browsers, systems, etc.
  • Test cases that is time-consuming.
  • Stress/load test cases
  • Unit test cases

You can consider automating the more time-consuming and repetitive test cases. Though, the criterion may vary depending on various other conditions.
But what about Functional automation testing ROI? Let’s have a look into it.
Functional Automation Testing ROI 
Finally, it is ROI that majorly governs any business decisions. Whether to automate your test cases or not; is also largely dependent on ROI. The determination of ROI for automation testing is tricky. Here is a small formula that can help you find a rough estimate of the automation cost.

Know More: Difference Between Functional and Non Functional Testing

Automation Cost = automation tool cost + cost of the labor to automate test cases + maintenance cost
If your automation test cost turns out to be lower than the manual testing cost, you should look out for automating test cases.  Moreover, testing cost increases with every run in manual testing, whereas the ROI adds up with every run in automation testing
But there are some other factors apart from ROI that can affect your decision to whether or not to automate test cases.
What Not to Automate
Functional automation testing, no doubt save time and efforts. But automating all the test cases is not a good idea. There are certain types of test cases you should not consider automating.

  • Test cases that are to be performed only once.
  • Ad Hoc based test cases.
  • Test cases that do not have a predictive result.
  • Usability test cases.

Be wise in your selection of test cases to automate. Functional test case automation can be highly beneficial for you if done wisely.
Conclusion:
Functional testing is one of the most important phases of STLC. But sometimes functional testing can be very time-consuming and frantic task.

Automating function test cases is one most apt solution to overcome this snag. Functional automation testing can save you both time and money.
So be clever and consider functional automation testing for your upcoming projects.

Mobile App Installation Testing: Ultimate Guide

Installation is a crucial aspect for the survival of any app. it doesn’t matter how well your app is working a minor flaw in installation sequence itself is enough for users to discard your app and never look back at it again. So, for the assurance, you need app installation testing.
Since we all believe in the saying that“Customer is the king” and “The first impression is the last impression”.
It is a must to keep our customers happy and leave a good impression on them. And thus it becomes very important to test your application for successful implementation to leave a good first impression on your customers.

So let us learn more about Application Installation Testing.
What is Application Installation Testing?
Application Implementation testing aka Application Installation Testing tests the successful installation of your mobile application across various mobile gadgets, models and operating systems.
Application Installation Testing is generally carried out before your application first interacts with its customers.
Application Installation Testing is the last phase of software testing life cycle (STLC).

Why should you do Application Installation Testing?
What if while installing your application, it corrupts the complete OS of user’s high-end mobile phone? FURY! Is all that you can expect.
To avoid such situations, it is a must that your application goes through an intensive round of Application Installation Testing.
Here are a few aspects that might help you apprehend the importance of Application Installation Testing.

  1. The first impression promotes the users to go deep into that thing and explore it. With an application, its implementation forms the first impression on its customers. Make sure your application is fit to be successfully installed by proper Application Installation Testing.
  2. Application Installation Testing makes sure that all the components of your application are entirely coordinated.
  3. Apart from Application Installation Testing, you cannot take application uninstallation testing lightly. After you uninstall the application from your hand-held device, it is important that all the related files are also deleted and application uninstallation testing ensures it commendably.


Type of Mobile Application Installation–Which one does your application supports?
Silent Installation: This kind of mobile Installation does not prompt any messages at the time of its installation. The related messages are saved in a log file.
Attended application installation: In attended mobile application installation, when you install your application; you are prompted and asked for various inputs. Few of the inputs that might be required from your end are:

  1. Accepting EULA/end user license.
  2. Entering the password is another input that you might be asked for.
  3. You can also be asked to give your input on various errors like internet connectivity issues.
  4. Some bigger applications can also ask you to use WiFi connection instead of mobile data for their installation.

Unattended mobile installation: In such type of installation you are not prompted during installation but if user intervention is required, it is done using an answer file where user mentions all the inputs that are required for installation.
Headless mobile installation/Network mobile Installation: Sometimes mobile networks install apps on their user’s mobile devices without having physical access to their devices. Such applications are installed from a network on a targeted mobile gadget.
Clean mobile Installation: In such mobile installation no older version of the application is installed, and it is being installed for the first time.
Automated mobile Installation: Such mobile installation is apt for applications where some prerequisite conditions are set and on meeting them the installation automatically starts.
Like for a few big applications user set a condition to be installed when the WiFi connection is on. When the application detects a WiFi connection on the gadget, it automatically installs it on the device.
Now when you know what type of installation does your application supports, its time to move on further.
Things to keep in mind before performing Application Installation Testing:

  1. Operating systems your application supports.
  2. Type of installation your application performs.
  3. The operating system on which you have to test your application.

How to perform Application Installation Testing?
Testing your application for proper installation is a must for a proper kick start of your application. Here are the steps that can help you carry out the testing properly.

  1. Check for an existing application and validate if your application checks for them too.
  2. Validate if installers draw all the instructions properly.
  3. Stop the installation process in between and check if the system returns to its original state.
  4. Manually check for the disk space and then validate if the application installer calculated the disk space appropriately.
  5. Confirm application responses for low disk space. Test if your application returns an appropriate error message when the disk space of your device is low.
  6. Test for registry changes that take place during the application installation process.
  7. Another important part that you need to consider isapplication uninstallation testing. After you uninstall the application from your hand-held device, it is important that all the related files are also deleted and application uninstallation testing ensures it commendably.

Know More: How To Test A Location-based App?

Test Cases for Application Installation Testing
Typical test cases you can test while performing Application Installation Testing:

  • Take into account your requirements and consider Test cases for all workflows.
  • Include test cases to check if the old version of an application is already installed and if it is available, and then have a test case to verify the installation of the application on the same path.
  • Have Test cases to check the Disk Space availability for installation.
  • Include Test cases which verify that your application prompts appropriate error message if an error occurs during installation.
  • Have Test cases to test the disk space before and just after installation.
  • Include Test script for checking the changes in the registry.
  • Include Test cases for the installation’s forced stop.
  • Include Test cases for custom installation and Default installation path.
  • Test your application installation when some other application of similar type is running concurrently.
  • Have test cases to test your application installation while an application that uses a lot of RAM for its operation is running.
  • Have Test cases for insufficient RAM condition and corresponding error message for it.
  • Test for inadequate disk space and corresponding error message for it.
  • Test application installation under high security, when the Firewall is on.
  • Test your installation process for variable Network speed.
  • Have test cases for multiple Concurrent installations.
  • Include Test cases for checking the Time in which installation and extraction process is completed.
  • Include test cases to test the path of extraction of application.
  • Test the log files that contain a list of all the events of installation.
  • Your testing should include test cases for Uninstallation and to test whether all related files are removed at the time of uninstallation.
  • Test for patch installation and Update installation.
  • Have Test cases to check uninstallation behavior when it is stopped in midway.
  • Have test cases to check the installer’s reaction when a newer version of the application is present, and the user is trying to install an older version.
  • Test if an older version of your application exists, the newer version is stored on the same path.
  • Have test cases for various interruptions like an incoming call or a message, low battery, putting in the charging socket, etc.
  • Have test cases to check the path of installation both in SD card and phone memory.


Challenges incurredinApplication Installation Testing
With, various mobile gadgets and operating systems the Application Installation Testing requires a complex execution and becomes time-consuming. It can also become very challenging sometimes. Some common challenges that can be faced while performing Application Installation Testing are:
Compatibility

    : With the wide increase in usage of mobile phones, year on year companies keep bringing new models of mobile phones and better versions of OS. It is important to check that your application is compatible with all of them. Checking your application’s compatibility with each of the gadgets and OS comes very challenging.

  • Interruptions: Testing should be done in various conditions. There are various conditions where your installation process might be interrupted like by an incoming call, low battery, a ping, etc. Checking for all such conditions can be another challenge for the tester.
  • Application Installation Testing is time-consuming, and the challenge is further enhanced with the running of multiple test cases on different configurations.
  • There are no clear test models, tools and test coverage criterion for Application Installation Testing that further increases the challenge for the testers.


Conclusion:
With the mobile application development industry blooming at a faster pace and more and more people finding their career in this field, it becomes very important to be best in it to survive this very tough competition.
Hence to offer your best make sure your application is free from all kinds of bugs and defects. And Application Installation Testing promises you a good starting interaction with your customers.
So make sure to conduct a round of Application Installation Testing before you launch your application in the market.

How To Test A Location-based App?

Geolocation is an important feature if you are developing a social media web or mobile application. According to a 2016 report by Pew Research Center, 90 percent smartphone users in the United States always keep the geolocation feature on.
There are bazillion apps out there that use GPS based features as the core functionality. But are they all successful?
No! Many of them fail owing to the lack of proper testing. What’s needed is correct methodology, tools, and the right team.

Click here to download our latest PDF on a GPS software system we tested lately

Testing a location-based app using mock location

To make the testing possible, you need a location simulator. Xcode is a popular simulator, which is used to test iOS apps. You can also use Location file formats called GPX and KML.
GPX or GPS Exchange Format is a document available in XML data format used to exchange location information of GPS data between your mobile application and the web service.

On the other hand, KML is the format the displays geographical data on Google Earth and other applications. It has a tag-based structure that uses nested attributes and elements, which is very similar to the XML standard.
To generate GPX or KML, you can use the many generators available online. Some of these include My Tracks, Google Earth to ADT plugin, RunKeeper, Google Earth, and KML Generator.

Generating GPX file using RunKeeper

Using RunKeeper is fairly simple but requires a bit of physical work. Let’s take a look:
Step 1 Download the RunKeeper app on your mobile phone.
Step 2  Finish the sign-up procedure and go to open ground. Make sure there are no buildings around.
Step 3  When you reach there, click on Start Activity and start walking around.
Step 4  Keep walking until you feel you have enough data. Hit STOP and click Yes I’m Done. Save the file and go back to your workplace.
Step 5  Open the RunKeeper website and log in using your username and password.
Step 6 Click on Activities and look for the Export GPX option. Download the file and save it on your computer.

Testing an Android App

Before you begin, create a GPX or KML route as mentioned in the images. Download Emulator Control and open the files on it (only one file at a time). Use DDMS perspective of Eclipse with ADT Plugin.
Step 1. Open Eclipse and click on Create a Project. Create an application that listens to Location Updates for the designated location provider.
Step 2  Click on Create Emulator. Go to your application’s folder in the project explorer. Right click on it and go to run as. Choose the option Android Application.
Step 3  Open Google Map. Go to DDMS and select Emulator Control.
Step 4  Go to Location Control, click on GPX, and open load your GPX file.
Step 5  After it uploads, select the file and hit the press button. Now you can start selecting mock locations. The process is the same for KML files.

Testing an iOS app

To test an iOS app, you will need a slightly different GPX file format. Use RunKeeper to convert the above Android-compatible route to iOS-compatible route. Also, you will need xCode simulator for this process.
Step 1 Open xCode project. Click Product > Debug > Simulate Location > Add GPX file to Your Project.
Step 2 Click on Location icon and then select your GPX file. The point on the map will start moving and you can start testing.

Testing location-based web applications using a mock location

With websites and web applications, testing geolocation is super easy. All you have to do is install VPN or Virtual Private Network, which is software that hides your current location.
You can send data without anyone else being able to track it. When you activate it, you simply have to change your current location to any location you want to and start testing.

Tips to remember while testing location-based apps

Location-based testing is challenging, which means you need to pay extra attention while performing it. Here are some tips that will help you out:

1. Mention the exact location

Choosing a location that is less than 100 meters from your point of testing can create a big difference in the results. If you aren’t sure you have pointed the right place, enter latitude and longitude of that location. You can find it easily on the internet.

2. Test flight mode

Testers often forget to test how the app works when the phone is on flight mode. It gives interesting results, so make sure you perform it.

3. Testing different conditions

Using a mock location to test is just one of the many conditions that you need to test. Others include app performance in motion, while talking phone, and during signal loss. Get creative and think of other conditions.

4. Check power-saving mode

When a person activates their phone’s power-saver mode, it has an effect on the GPS. Check how this affects your app’s performance. Also, if your app offers a power-saver mode, check the feature’s performance when you activate it.

5. Signal strengths

Always check your app’s location feature at varying signal strengths. It should be able to support GPS the maximum even at the lowest signal but if it doesn’t, you need to go back and make the changes. You can also check using different internet sources including Wi-Fi and 3G or 4G mobile data.

Perform a variety of tests while testing at mock locations including usability, security, functionality, and load testing.

Selenium Tutorial For Beginners [Step by Step]

Everybody knows about the impeccable selenium! The ultimate tool for testing web applications! for you to learn in detail about how to carry out automation testing, we have written an extensive Selenium tutorial just for you!
This blog comprises of three part,
1. Selenium Tutorial For Beginners
2. Selenium Intermediate Level Tutorial
3. Selenium Advanced level Tutorial

Selenium Tutorial For Beginners

What makes Selenium better?

You don’t need to code anything in Selenium and with this; any beginner will be able to record and play the simplest web application scripts.
Usually, Selenium RC needs a server to be up and running for sending commands to the browser. It is used for cross-browser testing and you can write the code in any language.
Selenium Web Driver is a better version of IDE and RC. It directly sends commands to the browser without the need of a server to be up and running.

Different languages can be used for coding the scripts like Java, C#, PHP, Python, Perl, and Ruby. Selenium Grid is used for parallel testing in multiple browsers and environments. It used the hub and node concept where hub acts as a source of Selenium commands and each node is connected to it.
Now, here we will discuss Selenium WebDriver. How a beginner can start learning Selenium WebDriver and how he can excel in it.
Now, first, we will look at the steps we need to follow to download Selenium Web Driver in your machine.

Ways to download and install Selenium WebDriver

  • You should have Java installed in your machine. This is the pre-requisite for Selenium Web Driver to work.
  • You can visit the page: http://seleniumhq.org/download/ and download the client drivers and language bindings. You have the select binding for Java.
  • This download will be named – selenium-2.25.0.zip.
  • Now, you can import all the Jars in Eclipse. You have to right click on the project and import jar files by selecting all the downloaded jar files. For this, you can click on the Libraries tab and then click on “Add External JARs”.

Now Let’s look the First Selenium WebDriver Script

Let’s take an example of the first Selenium Script which we would create using Selenium basic methods.
Let’s first look at the script in detail. In this script, we will do the following test steps.

  • Go to the home page of the test application
  • Verify the title of the page
  • Do a comparison of the result.
  • Close the browser after the script is done.

package projectSelenium;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class seleniumTest {
public static void main(String[] args) {
System.setProperty(“webdriver.chrome.driver”,”C:\\chromeDriver.exe”);
WebDriver driver = new ChromeDriver();
String baseUrl = “https://google.com”;
String expectedTitle = “Google”;
String actualTitle = “”;
        // launch Fire fox and direct it to the Base URL
driver.get(baseUrl);
        // get the actual value of the title
actualTitle = driver.getTitle();
/*
* compare the actual title of the page with the expected one and print
* the result as “Passed” or “Failed”
*/
if (actualTitle.contentEquals(expectedTitle)){
System.out.println(“Test Passed!”);
} else {
System.out.println(“Test Failed”);
}
driver.close();
}
}

Things to look at the above code:

  • In the first two lines, we have imported two packages. You have to import – org.openqa.selenium and org.openqa.selenium.firefox.FirefoxDriver.
  • The most important step is to instantiate the browser. This is done by line

WebDriver driver = new ChromeDriver();
//This is done to invoke a chrome browser.
You can invoke a FireFox browser by following line of code
WebDriver driver = new FirefoxDriver();
You can invoke an IE browser by following line of code:
WebDriver driver = new InternetExplorerDriver ();
Also, while invoking a browser you have to pass the path of the executable file. You can do it by following line of code:
System.setProperty(“webdriver.chrome.driver”,”Path of chrome driver”);
System.setproperty(“webdriver.ie.driver”,”Path of ie driver”);

  • Get() method is used to enter a url in a browser.
  • getTitle() method of selenium webdriver is used to fetch the title of a web page.
  • Now, we have to compare the expected title with the actual title.

If(expectedTitle.equals(actualTitle))
{
System.out.println(“TEST PASSED”):
}

  • For terminating the browser, close() method is used. Driver.close() closes the active browser window. If you want to close all the opened browser windows by selenium web driver then you can use driver.quit().
  • You can run this test by right clicking on the program and then select as “Run As” as “Java Application”.
  • Next thing which is of utmost important while writing a test script is to identify web Elements which will be explained in detail in the below section.

Locating Web Elements

Locating web elements is very easy. Various selectors are available for that process. find Elements is one such 2 in which selenium webdriver is used for locating a web element and then, you can perform an action on that.

Know More: Selenium Automation Testing With Cucumber Integration

Let’s see some of the methods by which you can identify web element on a web page.

  • className – It will locate web element based on the class attribute. Eg: By.className(“abc”);
  • cssSelector – used to locate web element based on css selector engine. Eg:- By.cssSelector(“#abc”);
  • id – If some web element has id attribute, then you can directly identify the web element using id tag. Eg:- By.id(“abc”);
  • linkText – It will find a link element by text mentioned by you in the test script. By.linkText(“Login”);
  • name – If any web element has name attached to it then you can identify it using name attribute. Eg: By.name(“name”);
  • partialText – It will find a link element by text containing the text mentioned by you in the test script. By.partialText(“abc”);
  • tagName – It will locate all elements which will have this tag.
  • xpath – It is the most used locator in a selenium test script. It will identify the element using html path. It can be relative or absolute. Absolute xpath traverses the path of the web element by root and relative takes the reference of any web element and then traverse to that specified web element. It is better to refer an element by relative xpath rather than absolute xpath.

Basic Actions on a web element

You can click on a web element by using click() method of selenium web driver. You can locate a web element and then perform an action on it.
Eg: driver.findElement(By.xpath(“”)).click();
Also, you can send keys to a particular web element by using send Keys() method of selenium web driver. You can locate a web element and then you can enter some text in it using sendKeys() method.
Eg: driver.findElement(By.xpath(“”)).sendKeys(“name”);
Also, there are other actions which you can perform on a web element by using action class.
WebElement wb = driver.findElement(By.xpath(“”));
Actions actions = new Actions(Driver);
Actions.moveToElement(wb).build(). Perform ();
You can even switch to alert boxes which come when you click on some webelement. You can do it by switchTo().alert() method.
Eg code:
WebElement wb = driver.findElement(By.xpath(“”));
Wb.click();
Driver.switchTo().alert();
Now, you will be able to access the alert box. You can retrieve the message displayed in the text box by getting the text from it.
String alertMessage = driver.switchTo().alert().getText();
Also, you can accept the alert box by function accept(). You can see the sample code as below:
Driver.switchTo().alert().accept();
You can even check conditional operations on a web element.
Also, check whether a web element is enabled or not. If it will be enabled then you can do some operation on it.
Apart from all these, you can check if some web element is displayed or not. In the case of radio buttons, you can check if the radio button is selected or not. You can do these checks by – isEnabled(), isSelected() and isDisplayed() option.

Waits in Selenium Web Driver

Selenium Web Driver
If you want some step to get completed before any other step then you have to wait for the prior step to get completed. In manual testing, it is very easy to achieve but in automation testing, it is bit tedious and you have to wait for the previous step to get completed or a condition to be fulfilled before moving on wards to the next step.
This can be achieved by adding waits in between. There are two types of wait- explicit and implicit wait. If you are expecting a particular condition to be fulfilled before moving to the next step,
Another feature is that you can use explicit wait while if you just want a universal wait, then you can go ahead to use implicit wait. The implicit wait is used to set the default time out for the whole script.
A perfect automation script is made by adding both type of waits – Explicit and Implicit. You have to judiciously use both types of waits to make an efficient test case.

Know More : Top 50 Selenium Interview Questions and Answers

Explicit Wait

Syntax of Explicit Wait:
WebDriverWait wait = new WebDriverWait(WebDriverRefrence,TimeOut);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(“”));
Expected Condition can be used with so many conditions. Some conditions which can be used with it are:

  • alertIsPresent()
  • elementSelectionStateToBe()
  • elementToBeClickable()
  • elementToBeSelected()
  • frameToBeAvaliableAndSwitchToIt()
  • invisibilityOfTheElementLocated()
  • invisibilityOfElementWithText()
  • presenceOfAllElementsLocatedBy()
  • presenceOfElementLocated()
  • textToBePresentInElement()
  • textToBePresentInElementLocated()
  • textToBePresentInElementValue()
  • titleIs()
  • titleContains()
  • visibilityOf()
  • visibilityOfAllElements()
  • visibilityOfAllElementsLocatedBy()
  • visibilityOfElementLocated()

Implicit Wait

Syntax of Implicit Wait:
driver.manage().timeouts().implicitlyWait(TimeOut, TimeUnit.SECONDS);
For this, you have to import a package into your code. The package name is java.util.concurrent.TimeUnit;

Selenium Intermediate Level Tutorial

Through the section Selenium Tutorial for Beginners, We gave you the basic info that you need to know about the tool. Now let’s go further and learn much more about this impeccable web app testing tool.
How to upload a file in Selenium test cases?
To upload a file, first, you have to identify the element on which you have to upload your file. There you can directly use sendKeys() function of selenium web driver. You can pass the path of the location in sendKeys. In this way, you will be able to upload a file using selenium web driver.

public static void main(String[] args) {
System.setProperty(“webdriver.gecko.driver”,”path of gecko driver”);
String baseUrl = “http://www.google.com /upload/”;
WebDriver driver = new FirefoxDriver();
driver.get(baseUrl);
WebElement element = driver.findElement(By.id(“id of element”));
uploadElement.sendKeys(“C:\\newhtml.html”);
//Here,  above you have to pass the path of the file where your file is located.
// Then you can click the upload file link
driver.findElement(By.xpath(“”)).click();
}
How to use a web table in selenium script
You have to access a web table and the elements present in the table. You can get it by making an xpath. Suppose you have had1 0a table with four blocks.
selenium intermediate tutorial
The first thing which you have to do is to find the XPath of the web element in this web table. Let’s say you want to get to the third element in the above web element.
The coding of the above web table is as below:

Selenium Intermediate Level TutorialSelenium Intermediate Level Tutorial
Now, you can analyze that first there is a table and then there is a tbody. In that tbody there are two rows. One row is having two tables. The first row is having two cells – First and Second. The second row is having two cells – Third and Fourth.
Our goal is to reach to the third cell. Let’s try to make the XPath of it.
The XPath of it will be //table/tbody/tr[2]/td[1]
So, the table is the parent node from which we will iterate to go the third element. From there, we will go to the tbody section and then the second row. From there we will get the first column.
Let’s write a script to get the text out of it.
public static void main(String[] args) {
String url = “http://testsite.com/test/write-xpath-table.html”;
WebDriver driver = new FirefoxDriver();
driver.get(baseUrl);
String txtWebelement = driver.findElement( By.xpath(“//table/tbody/tr[2]/td[1]”).getText();
System.out.println(txtWebelement);
driver.close();
}
}
Let’s take an example of a nested web table. You have to then analyze it carefully and get the XPath of it. Let’s look at the example below to get more information on it.
Selenium Intermediate Level Tutorial:
So, if you want to access the web element which is having text 10-11-12 then you can do it by traversing from the table and then iterating through the rows and columns to reach there.
Xpath would be: //table/tbody/tr[2]/td[2]/table/tbody/tr[2]/td[2]
public static void main(String[] args) {
String url = “http://testsite.com/test/write-xpath-table.html”;
WebDriver driver = new FirefoxDriver();
driver.get(baseUrl);
String txtWebelement = driver.findElement( By.xpath(“//table/tbody/tr[2]/td[2]/table/tbody/tr[2]/td[2]
”)getText();
System.out.println(txtWebelement);
driver.close();
}
}
This way, you can iterate through the rows and columns to reach to a specific cell from a web table.
Now, one of the most important concepts in selenium which will help you in many cases when you won’t be retrieving any text from a web element or to enable a web element to get the text or to perform any action on it.
Let’s talk about JavaScript Executor in detail. It is an interface which helps to execute javascript.
JavaScript Executor
Sometimes you are not able to click on a web element using click() function. You can then use javascript executor to execute click function on a web element. Let’s have a look at the code.
WebDriver driver= new FirefoxDriver();
// JavascriptExecutor interfaceobject creation by type casting driver object
JavascriptExecutor js = (JavascriptExecutor)driver;
You can now click on a webelement using below command.
WebElement button = driver.findElement(By.xpath(“”));
Js.executeScript(“arguments[0].click();”,button);
Also, if send keys isn’t working. You can make use of java script executor to send keys. Let’s look at the example below.
WebDriver driver= new FirefoxDriver();
// JavascriptExecutor interfaceobject creation by type casting driver object
JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript(“document.getElementById(‘id’).value=”value;”);
You can even make use of java script executor to refresh a web page. You can do it by following command:
WebDriver driver= new FirefoxDriver();
// JavascriptExecutor interfaceobject creation by type casting driver object
JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript(“history.go(0)”);
Sometimes, getText() doesn’t work and then you have to make use of java script executor to get text of a web element. You can do it by following line of code:
WebDriver driver= new FirefoxDriver();
// JavascriptExecutor interfaceobject creation by type casting driver object
JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript(“history.go(0)”);
Sysout(js.executeScript(“return document.documentElement.innerText;”).toString());
You can even get the title and URL of a web page using java script executor. The procedure is very simple. Let’s have a look at the following lines of code.
WebDriver driver= new FirefoxDriver();
// JavascriptExecutor interfaceobject creation by type casting driver object
JavascriptExecutor js = (JavascriptExecutor)driver;
System.out.println(js.executeScript(“return document.title;”).toString());
System.out.println(js.executeScript(“return document.URL;”).toString());
Desired Capabilities Concept in selenium web driver
You can make the set of configurations on which you want a particular test script to run. You can pass browser name, version to specify the type of environment on which you want a test case to run.
Let’s see some of the capabilities which you can set in a test case for IE browser.
//it is used to define IE capability
DesiredCapabilities cap = DesiredCapabilities.internetExplorer();
cap.setCapability(CapabilityType.BROWSER_NAME, “IE”);
cap.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
In the above capability, we have passed the capability browser name and we have ignored the security domain.
After setting the capabilities you can pass the capabilities to the web driver instance so that it executes the test on a particular configuration.
Let’s have a look at the complete set of code.
public static void main(String[] args) {
//it is used to define IE capability
DesiredCapabilities cap = DesiredCapabilities.internetExplorer();
cap.setCapability(CapabilityType.BROWSER_NAME, “IE”);
cap.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
System.setProperty(“webdriver.ie.driver”, “path of executable”);
WebDriver driver = new InternetExplorerDriver(capabilities);
driver.get(“http://gmail.com”);
driver.quit();
}
Handling a drop down in selenium web driver
You have to first import following packages: org.openqa.selenium.support.ui.Select.
First, you have to identify from DOM whether the dropdown is of select type or not. If it is of select type then you have to go for the below steps.
Then, you have to uniquely identify the select tag. You have to first make the object of Select class and pass the element for which you have to choose the options from the drop-down.
Select dropdown = new Select(driver.findElement(By.xpath(“”)));
Now, there are three main methods which you have to use to select any element from this select object.

  1. selectByVisibleText
  2. selectByIndex
  3. selectByValue

You can either select any element from this drop-down by matching the visible text with that of the text passed by you. You can also select any web element from the drop-down using an index. Last option is to select by value tag.
Also, there are some more functions which are available. Some of them are selectAll() and deselectAll() too select and deselect all the elements when more than one element can be selected.
But, if the dropdown is not of select type then you can’t go for the conventional method. You have to follow another method. You have to uniquely identify the web element on which you have to select a dropdown option. You can identify it and the sendKeys() function of selenium web driver to send keys to the uniquely identified dropdown.
WebElement dropdown = driver.findElement(By.xpath(“”));
Dropdown.sendKeys(“value to be selected”);
How to select the checkbox and radio button is selenium
Sometimes, you come across situations where you have to select checkboxes and radio buttons. You can do it easily with selenium web driver. You just have to use click() function of web driver to click on checkbox and radio button. You can even check of the web element is selected or not.
.isSelected() checks if any web element is selected or not.
It gives false if the web element is not selected and it gives true if the web element is selected.
This way, you can handle radio buttons and checkboxes in a selenium script.

Selenium Advanced level Tutorial

Now, you know almost the stuff which is required for selenium intermediate and beginner level. Now, you are proficient enough to deal with all the advanced level of selenium web driver. You can then practice those and while you are done with those, you can move forward to the advanced level of course.
Let’s see what lies ahead and what can give you an edge in your interviews. You can look at this advanced course so that you can be ahead of all the candidates who just know the basic and intermediate selenium course. Let’s have a look at Selenium Advanced level Tutorial

Selenium Grid


Selenium Grid is issued for running various tests on different browsers, operating systems, and machines in parallel. It used a hub and node concept. You don’t want test cases to run on a single machine. You have your machine as a hub and various systems on which test cases will be distributed. You call those machines as nodes.
The hub is the central point and there should be only one hub in a system. This hub is your machine from which you want to distribute the test cases among all the clients.
This is the machine on which test cases will run and those will be executed on the nodes. There can be more than one node. Nodes can have different configurations with different platforms and browsers.
Let’s see how you can establish a selenium grid in your machine.
You can download the selenium grid server from the official site. You can place Selenium server.jar in a hard drive. You have to place it in all nodes and hub c drive.
Open the command prompt in your hub and then, go to C directory. There you have to fire the below command java -jar selenium-server-standalone-2.30.0.jar -role hub
Now, if you want to check if the selenium grid server is running on localhost that is 4040 port or not. You can visit the local host on your browser.
You have to then go to C directory of the node and open command prompt in it. Also, when you have made the selenium grid server up in the hub, you have to note down the IP address and port.
java -Dwebdriver.gecko.driver=”C:\geckodriver.exe” -jar selenium-server-standalone-3.4.0.jar -role webdriver -hub ip address of hub -port port number of hub
When you fire the above command, again go to hub browser and the port number 4040. Refresh the page and you will see IP address which will be linked to the hub.
Now, you have set up machines with different configurations. But how would the hub know which test case would be run on which node.
This will be done by desired capabilities which will tell that this test script would run on a particular set of configuration.
One can do it using below source code:
This way, you will be able to distribute the test cases across different machines and browsers. You will be able to do parallel testing using Selenium Grid.

Maven and Jenkins Integration with Selenium


Maven is a build management tool which is used to make the build process easy. Maven avoids hard coding of jars and you can easily share the project structure across the team using artifact and version id.
Every team member would be at the same page. You can make a maven project by going to File – New – Other – Maven project. You have to then specify the artifact id and then version id. You will be prompted to select a template. For starting, select a quik start template.
You will get a folder structure where you will be having two folders – src/main/java and src/main/test. In java folder, you will maintain all other stuff except tests while in test folder you will maintain all the test cases.
You will be having pom.xml file where you have to define all the dependencies so that it can download from the maven repository and place them in ./m2 repository in your local project structure.
You can get the dependency from the maven official site and then place in pom.xml. It will download all the required jars.
Also, Jenkins issued for continuous integration of the latest build with the production environment. Whenever a developer will fire the latest build then the smoke test will start running on that build.
If the build gets passed then it can be deployed to the production else the developer and tester would get a notification about the failed build. It makes the delivery cycle very fast.
Also, you can do it by downloading Jenkins war file and then running it so that Jenkins server will be up and running on port number 4040.

After doing that you can install all the necessary plug-ins. You can then create a new item and does the post-build actions.
Also, you can pass the path of git repository from which it will fetch the latest build. If you are using a local server then you pass the path of pom.xml from the system.
You can even set nightly runs with Jenkins, You have to specify the time when you want your test to run. They will run and you will get the reports on the Jenkins server the next morning. Isn’t it time-saving?

Database Testing using Selenium WebDriver

Integrating Selenium tests to the database is so easy in the latest version of the tool. You have to make use of JDBC library for database connections. It allows connection of Java and databases. First, make a connection to the database with the following command:

DriverManager.getConnection(URL, “userid”, “password” )
After doing that you can load the JDBC driver. You can do it by following lines of code:
Class.forName(“com.mysql.jdbc.Driver”);
Now, you have to send the query to the database. How will you do it? You can create an object of a statement class and then execute the query using the statement object.
Statement stmt = con.createStatement();
stmt.executeQuery(select *  from employee;);
Now, you can get the result in the result set. You can do it by following command:
ResultSet rs= stmt.executeQuery(query);
After doing all the operations, you can close the connection.
Con.close();
In this way, you can get the result set and then do all the validations on the result set.

How to take screenshots in selenium web driver

You should get the screenshot of the failed test cases so that you can get to know where exactly is the problem. This will help in better-debugging skills.

Let’s look at the steps involved in taking a screenshot:
TakesScreenshot scrShot =((TakesScreenshot)webdriver);
This step caste a driver instances to Takes Screenshot interface. Now, you have one method which is getting screenshots which will get the image file.
File SrcFile=scrShot.getScreenshotAs(OutputType.FILE);
Now, you have taken the screenshot but you have to place it somewhere. You can create some folder which will be used for storing all the screenshots captured during the execution.
You can do it by following the line of code:
FileUtils.copyFile(SrcFile, DestFile);
This is the way to capture screenshots. But if you want that only the screenshot is taken when a test case fails. You can use ITestListener.
It has various methods and one of the methods is onFailure() which will do the specified task when every there is any failure in a test case.
So you can put this code in that method so that whenever any test fails it will take the screenshot and place it in the folder specified by you.

How to drag and drop in a web page using Selenium Web driver

Now if you want o drag and drop something o a web page, you would be confused. It is very simple. You have to make use of Actions class which gives you a method dragAndDrop() which will drag and drop a web element from a source destination to the desired destination.
Actions actions = new Actions(driver);
Actions. dragAndDrop(Sourcelocator, Destinationlocator).build().perform();
Make sure that the source locator and destination locator have correct xpaths. In this way, you will be able to drag and drop any element on a web page.

How to do right click and double click on a web page

You can do a right-click on a web page using Actions class. Actions class provides a doubleClick method which allows to double click on a web element. You can do it by following lines of code:

Actions actions = new Actions(driver);
WebElement elementLocator = driver.findElement(By.id(“ID”));
actions.doubleClick(elementLocator).perform();
You have to do right-click in selenium using action class only. It is very easy. It provides a method – contextClick() and then right click on a web element.
Actions actions = new Actions(driver);
WebElement elementLocator = driver.findElement(By.id(“ID”));
actions.contextClick(elementLocator).perform();
This way, you will be able to right click and double click on a web element.
How to switch to an iFrame

iFrame is a web page which is embedded into another web page. Whenever you want to click on a web element, which is in another iframe. First, you have to switch to that iframe and then perform an action on it.
You can do switching by
Driver.switchTo().frame(index or name or id of iframe);
Conclusion
Before learning Selenium it’s better to have a thorough understanding of any object-oriented language. languages that Selenium support includes, Java, Perl, C#,  PHP, Ruby, and Python Currently.
We genuinely hope this tutorial has helped in understanding selenium better.

Get a eBook : Download PDF

How To Do Performance Testing For Web Application Using Jmeter?

Performance testing is done to ensure whether the application is capable enough to bear the load. It can analyse the system’s performance under high load. Jmeter performance testing offers various benefits like it can be used to test the performance of both static and dynamic resources.

Dynamic resources can be JSP, Servlets and AJAX. Static resources can be Javascript and HTML.
There are two kinds of web application testing done using Jmeter.
1. Load Application Testing: The process is mainly used to predict the expected usage by simulating various conditions.
2. Stress Application Testing: Be it any web application the architecture of it can only support a certain number of users at a time. With the help of stress testing load above this capacity will be given on the server after which it behaves weirdly. By doing so, maximum load the web server can handle can be found out.
This can be understood in a much better way by below diagram:
How to create a Performance test in Jmeter
Let’s test the Google website for 1000 users with the help of Jmeter.

  • Add Thread Group

First, start the JMeter application and click on test plan option on the dashboard.          Click on add option and then Thread(Users). Afterwards, click on Thread Group.
The Flow would be:

Add -> Threads (Users) -> Thread Group

  • Enter thread properties in the thread group control panel. You have to enter a certain number of things like :

Number of Threads: Number of users which you want to target to the target website. For example, here we will use 100
Loop Count: 10 (Number of times to execute testing)

Know More: Step by Step Implementation of App Performance Test

Ramp-Up Period: 100 (It is the delay which Jmeter has to wait before starting the next user). 100 seconds is the time which we have used.
Now, you must be confused between thread count and loop count. It is very easy to understand.
Thread count means how many concurrent users Jmeter will create to connect to the web server.
Loop count would be the number of times, Jmeter would simulate one user connecting to the target server.
Suppose in the above example: Jmeter would create 100 concurrent users connecting to the server while one user would be connecting to the server 10 number of times.

  • Adding JMeter elements

There are various JMeter elements which can be used to the test case. Let’s see what they are:
1. HTTP request default
Now, you have created a thread group and you can attach HTTP request element        to it by following the below path:

Add -> Config Element -> HTTP Request Defaults.

In the HTTP request control panel, enter the website name which you have to define. In our example, it would be “www.google.com”.
2. HTTP request
You can add this element to the thread group by following below path:
Add -> Sampler -> HTTP Request.
Now, in the control panel of the HTTP request, you have to enter the URL      request you want to send to Google. If you give the command as “calendar” in path field, Jmeter will send request http://www.google.com/calendar to google server. If you will keep it blank then send request http://www.google.com/ to google server.

  • Adding Graph Result to the test output

Jmeter can show the results in graph format. You have to right click on the test plan and then follow the below path:

Add -> Listener -> Graph Results

In this way, you will be able to see the results in graph format.

  • How to run the test and get the test result

You can see the test button on the toolbar to start the testing process. You would be able to see the test result in real time. When you will simulate 100 users which will access Google server then you will get the real-time output.
But all output lines would not be in the same colour. Some would be in black, blue, red and green colours. Black colour means the total number of current samples sent. Blue colour represents the current average of all samples sent. Red colour represents the current standard deviation. Green colour represents throughout rate that represents the number of request per minute the server handled.
How to analyse the graph results in Jmeter
There are two main parameters which you should focus while looking at the result graphs. Throughput and deviation are those which are very important while looking at any JMeter output graph.

Know More: Performance Testing-Types, Stages and Advantages

Throughput is the ability of the application to handle a heavy load. Throughput should be very high ideally. Deviation indicated deviation from average. It should be very low.
In the above graph, throughput is 867/minutes. It means this server can handle 867 requests per minute. This data is of yahoo website. While if you will test Google.com then you see throughput is 1000/ minute. Google has higher throughput than yahoo.
These parameters can vary on other factors also. Which include internet speed at JMeter site, current server load at google server, your CPU power and many others. It’s not necessary that you will get the same results every time as they can vary because of other factors.
Conclusion
So start the web application testing using Jmeter and see how much load one website can handle. In this way, you can see why your site stops responding and one of the reasons can be low load-bearing capacity.

If you had some difficulty while doing the above test then try to not connect to the internet via a proxy. If you are connecting through a proxy then don’t connect via that. Try opening a new JMeter instance and then try to run the test.
By following these you would be able to run the test cases with Jmeter. So, keep doing performance testing with JMeter and make your site less prone to vulnerable attacks. All the best!!

Top 13 Resources to Learn Selenium Automation

When QA engineers started with the selenium testing journey, they really had a tough time finding out good resources to help them in improving their skills.
The resources then were mediocre once and a very few that could actually help. So with so much of activities happening over the internet, we thought of finding some good selenium resources to help you get started.
Below is a list of top 13 selenium automation resources that will prove helpful to you throughout your learning journey.

1. Selenium 2 WebDriver Basics With Java
Selenium WebDriver is the web automation tool that has the market and its expertise sought after. When you master utilizing the Selenium WebDriver tool, you can make sure of expanding your capacity to compose those awesome automation codes.
This seminar on the web has some truly astonishing video guides and learning materials that will enable you to find more without anyone else. This Alan Richardson’s course is simply too moving to even think about learning.
2. Clean Coders by Uncle Bob Martin
This ought to be your most loved go-to site for adopting best practices being developed. On the off chance that you seek to wind up a really sparkling mechanization hotshot, you need great information about practices being developed. Clean Coders is likewise accessible as a handbook on different web-based business sites.
All the more imperatively, you will be tested to reassess your expert qualities and your responsibility to your art.

Know More:  15 Top Selenium Webdriver Commands For Test Automation

3. Selenium Guidebook by Dave Haeffner
With the exercises in this book and the elemental Selenium tips, you will be ready to play out a genuinely decent arrangement of automatized acceptance tests against the application over some stretch of time and numerous cycles.
As such, we ask you to purchase the book. It’s somewhat more exorbitant than comparative Selenium books, however it’s substantially more successful.
As a matter of fact, this is a gathering of Dave’s extraordinary assets. You get an e-book, video instructional exercises and cheat sheets.
4. gcreddy.com
An online instructional exercise, gcreddy.com gives you recordings and class notes with the goal that you can undoubtedly learn Selenium.
All these demo instructional exercises can be a superb learning and practice stage for you. You can likewise structure a test situation number to computerize in the wake of looking at the usefulness given by every exercise.
This instructional exercise can be given an attempt without a doubt!
5. Ultimate QA
This online course is the main instructional exercise on the planet that will show you how to work without any preparation.
It furnishes you with deep-rooted structure advancement aptitudes. Created by Nikolay Advolodkin to make the best QA engineers, Ultimate QA offers a full Selenium WebDriver adapting course.
You can watch video courses on the web, get a rundown of sites for testing automation, read books, e-learning stage, and browse to slides/introductions, online classes, recordings and significantly more.
Toward the end of this online course, you will have a nitty gritty comprehension about selenium web testing.
6. Selenium – Automation Step by Step – Raghav Pal
Before we figure out how to walk and run, we need somebody to hold our hand and help us make the initial couple of strides.
Each course in this online instructional exercise is intended for fledglings who think nothing about the subject. The sections are rearranged and separated into straightforward subject.
You will gain some new useful knowledge from each video instructional exercise, so we think the more you investigate, the more you learn.
7. Selenium Easy
Selenium Easy is available to students by a little group of experts who work in different associations. The primary goal of the online investigation entry is to give a space to learning and down to earth execution.
They give tests and guides to give you an unmistakable image of your needs. You may need to do little work to meet your present prerequisites.
8. Guru 99 Free Selenium Tutorials
Guru 99 Selenium instructional exercises are helpful for people of Selenium from beginning to advanced edge levels.
They bit by bit proceed onward to advance edge subjects, for example, Framework Creation, Selenium Grid and Cucumber BDD, beginning from the essential Selenium ideas.
To show you Selenium WebDriver, it’s extremely elusive great assets. Also, Guru 99 is one of them.

Know More:  50 Selenium Interview Questions and Answers(2019)

9. Selenium Academy – CrossBrowserTesting
This course demonstrates to you how you can utilize your Selenium matrix for testing on cell phones, including web testing. While you need some earlier learning, beginning with a vigorous cloud testing tool like Cross Browser Testing is an incredible asset.
What’s more, Selenium Academy has a whole course index in your favored programming language covering everything automatization.
10. Selenium Conference
There is no better method to gain from individuals who really use selenium than by going to an individual meeting. On the off chance that you need to break into test automatization, the Selenium Conference is the spot to be.
The uplifting news for you is that the vast majority of the general population are dynamic via web-based networking media and dependably share their tips, traps and counsel on test computerization.
11. Stack Overflow
Do you have any questions? When you hit a knock out and about, here’s the place you sought answers. Stack Overflow is the place in excess of 50 million designers and analyzers share their insight, so you realize somebody will assist you with an issue, regardless of how little, explicit or basic it might appear.
Also, on the off chance that you need the most exact data, go straightforwardly to the source code individuals post for you
12. Software Testing Help
Software testing help is another incredible emotionally supportive network for testers endeavoring to make the change to selenium automation, and these instructional exercises begin from fundamental ideas through cutting edge points, for example, system creation, Selenium Grid and Cucumber BDD.
As you experience these instructional exercises, you’ll see that writing test cases is substantially more reasonable than you thought previously.
13. Selenium 101 Series
The complete Selenium 101 Series gives the tools you have to test selenium tests and achieve the desired results. Selenium 101 Series offers a helpful and edible asset for cleaning your aptitudes by tending to the most widely recognized selenium challenges, including highlights, for example, our intuitive selenium life structures, learning test and eBooks for testing automatization.

Conclusion
Testing is an active industry and the community is constantly talking about more efficient automation. Fortunately, you have a lot of resources to learn Selenium. This list includes some of our favourite content, but it only skims the top of everything.
Take the time to talk to other testers and see what worked for them, practice frequently, and you’re going to write your own test cases in no time.

Mainframe Testing – What Happens?

Here is everything that you need to know about Mainframe Testing – what it is and what is the process that is followed, essentially a complete beginner’s guide to Mainframe Testing.

What is Mainframe Testing?

Mainframe Testing is the process of testing Software Services and Applications that are based on the Mainframe Systems.

The process is crucial part of the Application Development Process as it is instrumental in adhering to the cost and quality standards of the industry.

Mainframe Testing ensures that the system is in fact, ready to be launched in the market.

What are the steps followed while undertaking Mainframe Testing?

  • Smoke Testing – Also known as Shakedown, this is the take-off point of the process of Mainframe Testing. Before any action is taken on the codes that are to be used, this first step is to ensure that all the codes that have been deployed are actually in the right testing environment.
  • Only after the adaptability of the code has been confirmed, and the codes checked for any critical technical glitches, are they approved to be worked on in the later stages of the Mainframe Testing Process.
  • System Testing – This stage involves a series of testing that is undertaken to test the functionality of individual systems that comprise the Mainframe system, as well as their performance with respect to each other.
  • Batch Testing – The Batch Jobs begin by testing the scope of data and files, recording the results and making changes wherever necessary. The Batch Testing is the stage where the validation of the test results on output files and data as done by the batch jobs take place.
  • Online Testing – While the Batch Testing can be loosely understood as the back-end testing phase, with Online Testing, the testing moves to the front end of the mainframe application. The Mainframe Application is tested here in relation to the entry fields that are used by the system.
  • Online-Batch Integration Testing – This stage bridges the gap between the back-end and the front-end of the Mainframe System. Through this integrative testing, the data flow, as well as the interaction that takes place between the online screen and the batch job, is validated and approved before being passed on to the next stages of the Mainframe Testing process.
  • Database Testing – At this stage, the database of all data for the Mainframe Application is stored is validated for the layout of the data storage.
  • System Integration Testing – Once the basics have been covered, System Integration Testing is initiated to test the functionality of the system under test and their response to, as well as their interaction with other systems. This is rather a broad spectrum and is prone to be considered as unnecessary, but it is an essential step as it ensures that the new system integrates with other systems in an organized manner.

The relationship between the different systems here is not in terms of either being affected by the requirements of the other.

But in the sense that each use data that is being collected, stored or managed by the other systems.

Hence, testing the exchange of data takes place, and how commands and results flow from one system to the other is essential to create a streamlined integration process between different systems.

Again, the different types of testing processes that are used for System Integration Testing are Batch Testing, Online Testing and Online-Batch Integration Testing (as discussed previously).

  • Regression Testing – This can be understood as the counteractive stage to the previous one. While the System Interaction Testing ensures that the different systems that comprise the Mainframe function simultaneously and are conducive to the performance of the System as a whole, the Regression Testing is a way to ensure that the different systems do not hinder the performance of each other.

Each system should not only be involved in the functioning of the other, as long as it is beneficial for both of the systems. Therefore, Regression Testing is responsible for making sure that the batch jobs or online screens, for instance, do not negatively affect the system that is currently being reviewed or vice versa.

  • Performance Testing – Once we know that each system that is currently at work is doing its job in relation to the new system, or an update being tested and that the new system under test does not hamper the functionality of an existing system, the next step is to test the performance of the system in its specific environment. It involves identifying bottlenecks in high hit areas like the front end data, or other activities like upgrading online databases and to check and understand the scalability of the application.
  • Security Testing – When it comes to software or well any Technology for that matter, the first question that needs to be answered is whether it is a secure platform or a safe space for the users. The same goes for the Mainframe Testing process. Before approving it for being used in the system, it is important that the system is tested to see how it fares against the security attacks. Security Testing is a stage that evaluates the design and development of the application and its ability to withstand potential security attacks. It includes the system’s independence in countering those attacks and keeping all information and data entrusted to it, absolutely safe. The two most common types of Security Testing that need to be undertaken are the Mainframe Security and Network Security. The features that both these tiers of security tests, check in their specific ways are – Integrity, Confidentiality, Authorization, Authentication, and Availability.
selenium

This is the basic model that is followed by testers when it comes to Mainframe Testing.

While specificities might vary depending on the particular project at hand, the basic outline that is to be followed remains the same. As with every other aspect of Technology, there is enough room to negotiate or experiment with this industry standard.

Experimenting and exploring unchartered territories though might lead to dead ends or tunnels that don’t always end with light.

But you can always trace your steps back, and find out where you went wrong and take corrective measures as and when required.

The next section focuses on the challenges or problems that are faced by the Mainframe Testing team and how can they find their way out of a tight spot.

What are the common challenges faced in the process of Mainframe Testing?

Each and every kind of Testing is a series of hit and trial until you arrive at the best possible system. Mainframe Testing is no different. Though we have discussed the steps that are generally followed during the process of Mainframe Testing, even the closest adherence to these steps do not always ensure the best solution in the first attempt.

There will always be challenges or troubleshooting that the testing team will be faced with during the process.

Discussed below are some issues that have been often reported by the testers and the possible approach that can be adapted to find a solution to that problem.

  • Unclear Requirements

Problem – It is extremely important to have clearly set requirements before you working on any testing project. While a supporting manual might be available, it does not always cater to the demands and needs of the project at hand. The problematic of unclear, incomplete or impractical documentation is a problem that hinders the testing process.

Solution – The testing team should be actively involved in the Software Development Life Cycle right from the time when Requirements are being set for the system. Their involvement in the early stages will ensure that they can verify that the requirements that are being set are after all testable and practical. This saves time, money and efforts of the team, while also ensuring that the Software Development Process does not come to a standstill at a later point in the testing phase.

  • Ad-hoc Request

Problem – it may so happen that upstream or downstream application issues might necessitate end-to-end testing needs. These unexpected requests have the potential to disrupt the pre-defined schedule of the testing process by increasing the time, efforts and other resources required in the execution cycle.

Solution – To provide for the unforeseeable issues during the testing process, it is advisable to have automation scripts, regression scripts, skeleton scripts and any other backup plans to implement immediately as and when faced with a problem. This considerably reduces the overall time and efforts required for the completion of the project.

Here goes your basic guide to Mainframe Testing. This is not an exhaustive guide, there is always more that we can learn, and there is always room for improvement and efficiency. Keep exploring.