Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automated Website Testing using GUI

What is the best way for automated front-end testing using GUI for a WebSite?

I have to write testing module to test whole website automatically using GUI whatever a user can do on website.

I have used mocha for testing the code but it does not provide GUI.

like image 726
Rohit Avatar asked Apr 06 '15 07:04

Rohit


People also ask

Can GUI testing be automated?

Benefits of Automated GUI testing GUI testing is mostly performed manually. However, while assessing the performance of small straightforward testers, a lot of developers write scripts for automated testing.

What is GUI testing?

GUI testing is the process of ensuring proper functionality of the graphical user interface (GUI ) for a given application and making sure it conforms to its written specifications.

How GUI testing will be done in manual testing for a website?

Manual Testing This approach involves human tester, where each screen is manually checked to validate each functionality by creating and executing test cases. It is a useful approach when part of UI or a feature is ready, the probability of defects is more at the initial stage, and human intervention is required.


2 Answers

It's worth to take a look on Selenium Webdriver.

This framework is one of the most popular for functional testing of web-applications.

Here are the most notable features of Webdriver:

  • Direct calls to browser API
  • A lot of supported browsers
  • Opportunity to develop automated tests using different programming languages: Java, C#, Python and other
  • Ability to execute tests in "headless" mode
  • Mature and efficient webdriver's API allowing you to handle many like alerts, AJAX interactions, file upload and other

You'll also find that a lot of 3rd party applications and services (like browserstack) have tight integration with Selenium Webdriver and ready to integrate with it out of the box.

Last but not least is Selenium Webdriver's community: it's huge and professional, allowing you to get answers quickly.

You can find more information about Webdriver on official web-site, and also browse blogs related to it.

like image 116
Viktor Malyi Avatar answered Oct 07 '22 13:10

Viktor Malyi


As Viktor has noted, Selenium Webdriver is usually the tool to go to. In my experience, it is best to not use Selenium directly, but through a wrapper. Those wrappers take care of tedious timing issues that come with the asynchronicity of the web. Good wrappers are:

  • WebdriverJS (Javascript)
  • Capybara (Ruby) and
  • Coypu (C#)

Most wrappers have the additonal benefit of making it easy to replace the selenium webdriver with others (e.g. Watir or Watin), if the need should ever arise.

WebdriverJS works well with Mocha, but if you are working with Angular you might take a look at Protractor, which ties all the tools well together.

For performance reasons and easy deployment on test machines you should take a look at PhantomJS, a headless browser based on Webkit.

Update: Pareshkumar's comment made me think. If you are looking for a GUI to launch the tests from, instead of a way to test the GUI of your website, the search term you are looking for ist testrunner. Testem for example is a testrunner, that has both a cli and a gui. You should definitely look for cli support to enable continuous integration.

like image 23
Jörg Reichardt Avatar answered Oct 07 '22 13:10

Jörg Reichardt