La naturaleza violenta del deseo
2.3 La transgresión y el deseo: partes fundantes del erotismo
(B) What are good candidate for automation in testing?
(B) Does automation replace manual testing?
Note: - This question is normally asked to judge whether you think automation is a silver bullet. The time you say everything can be automated you have already lost the job.
Automation is integration of testing tools into the test environment in such a manner that the test execution, logging, and comparison of results are done with little human
intervention. A testing tool is a software application which helps automate testing process. But testing tool is not the complete answer for automation. One of the huge mistakes done in testing automation is automating the wrong things during development.
Many of the testers learn the hard way that every thing can not be automated. The best component to automate is repetitive task. So some companies first start with manual testing and then see which tests are the most repetitive ones and only those are then automated. Before doing testing automation try to judge is it really worth of the automation, probably manual testing can be better.
So as thumb rule do not try to automate:-
• Unstable software: If the software is still under development and undergoing lot of changes automation testing will not be that effective.
• Once in a blue moon test scripts: - Do not automate test script which will be run once in a while.
• Code and document review: - Do not try to automate code and documents reviews they will just add to your trouble.
Below figure shows what should not be automated.
Figure: - What should not be automated
All Repetitive tasks which are frequently used should be automated. For instance regression tests are prime candidates for automation because they're typically executed many times. Smoke, load, and performance tests are other examples of repetitive tasks that are suitable for automation. White box also can be automated using various unit testing tools. Code coverage can also be a good candidate for automation. Below figure shows in general the type of test which can be automated.
Figure: - candidates for automation
(I) which automation tool have you worked and can you explain them in brief?
Note: - For this book we are using AutomatedQA as the tool for testing automation. So this answer we will answer from the point of view of AutomatedQA tool. You can install the AutomationQA tool and practice for yourself to see how it really works.
In this answer we will be testing a tool called as “WindowsFileSearch”. This tool does the following functionality:-
• This tool basically searches file by name and internal content of the file.
• It also has facility of wildcard as well as the extension search. Which means we can search the file by extension for instance *.doc , *.exe etc.
Note :- To answer this answer in a detail manner we have used the FileSearch application. You can experiment with any other application installed in your system for instance a messenger or office
applications.
So let start step by step how we can use the automatedQA tool to automate our testing process. First start the tool by clicking all programs à AutomatedQA à TestComplete 5 à TestComplete 5. Once the tool is started you will get a screen as shown below. We
first need to create a new project by using the new project menu as shown in the below figure.
Figure: - Create a new project
After clicking on the new project we will be popped with what kind of testing are we looking at. i.e. Load testing , General testing etc. Currently we will select only General-Purpose Test project. At this moment you can also specify the project name , location and the language for scripting ( Select VBscript currently).
Figure: - Select the type of project
Once the project name and path is given you will be then popped with a screen as shown below. These are project items which we need to include in our project depending on testing types. Because currently we are doing a windows application testing we need to select the below project items as shown in figure. Please note events have to be selected compulsorily.
Figure: - Select project items
Once you have clicked finished you will get the test complete project explorer as shown below. Test complete project explorer is divided in to three main parts Events, Script and TestedApps. Script is where all the programming logic is present. In TestedApps we add the applications which we want to test. So lets first add the application in TestedApps.
Figure: - Project explorer
In order to add the application EXE in TestedApps we need to right click on TestedApps folder and click on New Item.
Figure: - Add new applications to the project
You will then be popped with a screen as shown below. Browse to your application EXE file and add the same in the TestedApps folder.
Figure: - Add the EXE to your TestedApps folder
Once the EXE is added to the you can see the Application added below TestedApps folder as shown in the below figure. Currently we have added the WindowsFileSearch application. Now that your application is added we need to start recording our test. In order to start recording click on the RED button shown in the below figure or click SHIFT + F1.
Figure: - EXE see once added successfully
Once the recording tool bar is seen right click on the Application added and run your test.
In this scenario you can see the windows file search application running. In this we have recorded a complete test in which we gave the folder name , keyword and then tried to see if we are getting proper results. You application under test can be something different , so your steps can vary.
Figure: - Recording
Once the test is comple te you can stop the recording using the BLUE button on the recording toolbar. Once you stop the recording tool will generate script of all your actions done as shown the figure below. You can view the programming script as shown below.
Figure: - Script generated for the recording
Once the script is recorded you can run the script by right clicking and running the same.
Once you run the script tool will playback all the test steps which you had recorded.
Figure: - Running the recorded test
If everything goes proper you can see the test log in green color as shown below which signifies that your script had run successfully.
Figure:-Successful execution of the scripts
(I) Can you explain how does load testing conceptually work for websites?
In order to understand this we need to first understand the concept of how actually
websites work. Websites have software called as Web server installed on the server. User request to the web server and receives a response. So for instance when you type
http://www.questpond.com (well that’s my official website) web server senses it and sends you the home page as a response. This happens each time either when you click on the links, do a submit etc. So if we want to do load testing you need to just multiply these request and response “N” times. This is what exactly an automation tool does. It first captures the request and response and then just multiplies it by “N” times and shoots it on the web server, which results in load simulation.
Figure: - Concept of load testing
So once the tool captures the request and response, we just need to multiply the request and response with the virtual user. Virtual users are logical user which actually simulates the actual physical user by sending in the same request and response. If you want to do load testing with 10000 users on an application it’s practically impossible. But by using the load test tool you only need to create 1000 virtual users.
Figure: - Load testing simulation by virtual user
(A) Can you explain how did you perform load testing using tool?
Note: - As said previously we will be using automatedQA tool for
automation in this book. So let’s try to answer this question from the
same perspective. You can get the tool from the CD provided in the book.
The first step is to open a new project using the test complete.
Figure: - Create new project
After than select HTTP load testing from the project types.
Figure: - Select HTTP load testing
Once you click “Ok” you will get different project items which you need for the project.
For load testing only select the three i.e. Events, HTTP load testing and Script as shown below.
Figure: - Select the three items in load testing
Project has the following items Stations, tasks, tests and scripts. Stations basically define how much number of users the load testing will be performed for. Task is the one which has the request and response captured. Tests and script has the script which is generated when we record the automated test.
Figure: - Load testing explorer
Figure: - Project items
You need to specify the number of virtual users, task and the browser type like internet explorer, opera etc.
Figure: - Assign number of virtual user and browser
As said previously the basic thing in load testing is the request and response which needs to be recorded. That can be done by using the recording task bar and click the icon below.
Figure: - Record HTTP task
Once you click on the icon you need to enter the task name for the same.
Figure: - Specify task name
In order to record the request and response tool changes the proxy setting of the browser.
So you will see the below screen just click yes and let the next screen (change proxy settings) after it complete.
Figure: - Prompting to change proxy setting
Figure: - Changing proxy settings
Once the setting is changed you can then start your browser and make some request and response. Once that is done click on the stop to stop the recording.
Figure: - Stop the task once done
Tool actually generates script for task recorded. You can see the script and the code generated as shown in the figure below. To view the code you can double click on the Test2 script (here we have named it test2 script).
Figure: - Test2 created
If you double click the test you can see the code below.
Figure: - Code generated for test
Right click on the task and run the same you should be popped up with summary report as shown in the figure below.
Figure : - Load test Summary report
(I) What does load test summary report contain?
The above figure explains everything.
(I) Can you explain the concept of data-driven testing?
Normally application has to be tested with multiple set of data. For instance a simple login screen depending on user type will give different rights. For example if he is a admin he will have full rights , while a user will have limited rights and support will only have read-only support rights. In this scenario the testing steps are same but with
different user id and passwords. In data-driven testing inputs to the system are read from data file like excel, CSV (comma separated values), ODBC etc etc. So the values are read from these sources in to variables and then test steps are executed by automated testing.
Figure: - Data driven testing
(I) Can you explain table-driven testing?
Left to the readers
(I) How can you perform data-driven testing using Automated QA?
This question is left to the user. Please install the tool and try for yourself. In case of issues you can mail to [email protected] .