Software Testing is evaluation of the software against requirements gathered from users and system specifications. Testing is conducted at the phase level in software development life cycle.
October 11, 2020
Difference between SoapUI and Postman
Both SoapUI and Postman are very famous tools for API testing and API Automation. Below are the major differences between SoapUI and Postman and the criteria for choosing them for REST API.
1. SoapUI covers the testing of all API protocols like Soap, REST and GraphQL whereas Postman supports only REST API Testing
2. SoapUI provides 14 days trial and then you have to pay to get a license whereas Postman is a free Chrome browser extension
3. SoapUI supports customization of Reports in different formats whereas Postman supports reporting only in JSON and HTML formats.
4. SoapUI is one of the most trustworthy tool for API automation testing whereas Postman is a used for REST APIs manual as well as exploratory testing
5. SoapUI is a heavy tool in-comparison to Postman as this is a chrome extension
6. In Soap UI,you can use Groovy or JavaScript for more complicated automation such as validating the results, extracting data, using external Java libraries or running system processes. Groovy IDE is compatible with Java and you can easily write your code in Java with very few modifications.But in Postman there is no concept of groovy.
I hope the above information will clarify your doubts in terms of differences and criteria to select one of them depending upon the requirement.
HTTP Status Code
HTTP STATUS CODE-
GET: The resource has been fetched and is transmitted in the message body.
HEAD: The entity headers are in the message body.
PUT or POST: The resource describing the result of the action is transmitted in the message body.
TRACE: The message body contains the request message as received by the server.
Client error responses-
October 10, 2020
SQL Commands
select
AS forcolumn name
select name, continent as "continent name" from Country order by Name;
select name, continent as "continent name" from Country order by Name;
select name, continent , region from Country where continent= "Europe" order by Name LIMIT 5 offset 5;
select name as "Country" from Country;
select count(*) from Country where population> 100000 AND Continent= "Europe";
select * from customer;
insert into customer(name,address, city, state, zip)
values("FRD ","abc","KK","CL","334");
update customer SET address= "klllll" where id = 2;
delete from customer where id = 4;
select * from customer ;
create table test(
a integer,
b text
);
insert into test values (1,'a');
insert into test values (2,'b');
insert into test default values;
select * from test;
drop table test ;
drop table if exists test;
create table test(
a integer not null,
b text not null,
c text
);
insert into test values (1,'this','that');
insert into test (a,b,c) values ('one','two','');
select * from test;
null is not a value the null state represnts a lack of value
Constraints in SQL
not nul, uniques
create table test (a Text unique, b text, c text default 'cat');
insert into test (a,b) values ('one','two');
insert into test (a,b) values ('three','two');
select * from test;
alter table test add e text default 'dog';
select * from test;
alter table test add e text default 'dog';
select * from test;
select name, population from country
where population <50000 OR population is null order by population desc;
select name, population, continent from country
create table left (id integer, description text);
create table right(id integer, description text);
insert into left values (1, 'leftone');
insert into left values (2, 'lefttwo');
insert into left values (3, 'leftthree');
insert into left values (4, 'leftfour');
insert into left values (5, 'leftfive');
insert into left values (6, 'leftsix');
insert into left values (7, 'leftseven');
insert into left values (8, 'lefteight');
insert into right values(1, 'rightone');
insert into right values(2, 'righttwo');
insert into right values(3, 'rightthree');
insert into right values(4, 'rightfour');
insert into right values(5, 'rightfive');
insert into right values(6, 'rightsix');
insert into right values(7, 'rightseven');
select * from left;
select *from right;
select l.description as left , r.description as right
from left as l
left join right as r on l.id= r.id
;
where continent in ('Asia', 'Europe') order by name;
select distinct continent from country; more unique results
select s.id as sale ,i.name, s.price
from sale as s
join item as i on s.item_id= i.id;
insert into customer (name) values ('jane smith');
select * from customer;
select c.name as cust, c.zip, i.name as item,i.description, s.quantity as quan,s.price as price
from sale as s
join item as i on s.item_id= i.id
join customer as c on s.customer_id= c.id
order by cust, item
;
insert into customer (name) values ('jane smith');
select * from customer;
select c.name as cust, c.zip, i.name as item,i.description, s.quantity as quan,s.price as price
from customer as c
left join sale as s on s.customer_id= c.id
left join item as i on s.item_id= i.id
order by cust, item
;
strings-
select released,
substr(released, 1, 4) as year,
substr(released, 6, 2)as month,
substr(released, 1, 4) as day
from album order by released
;
select released,
substr(released, 1, 4) as year,
substr(released, 6, 2)as month,
substr(released, 1, 4) as day
from album order by released;
select RTRIM (' string');
select 'string'= 'STRing';
select LOWER('string')= lower('STRing');
select upper('string')= lower('STRing');
numeric type --
select typeof(1+1);
select typeof(1+1.2);
select typeof('first');
select typeof('first' + 'name');
select 1/2;
select cast(1 as real)/2;
select 17/5;
select round(2.455555);
select 17%5;
date and time
select datetime('now');
select date('now');
select time('now');
select datetime('now','+1 day');
aggregates:
having for aggregate data
where by for non aggregate data
select a.title as album , count(t.track_number) as tracks
from track as t
join album as a
on a.id= t.album_id
group by a.id
order by Tracks desc,album
;
Use the __distinct___ keyword to remove duplicates from a result
Use the _group by ____ clause to collate groups of results before calling an aggregate function.
You can undo an unfinished transaction by using the ___rollback__ statement.
begin transction
end transaction
create table updatesale(id interger primary key, itemid integer, quan integer, covalue integer);
insert into updatesale(itemid, quan ,covalue) values (31,2,33);
create trigger updatesale before update on sale
Begin
select raise(rollback ,"can not update") from updatesale
where id=new.id and covalue= 1;
End
;
Begin transaction;
update updatesale set quan= 9 where id=3;
End Transaction;
select * from updatesale;
The SELECT ___distinct__ statement removes duplicates from a result set.
To insert a blank row use the _default____ clause.
To delete a table, use the ___drop__ statement.
What are the three arguments for the SUBSTR() function in SQLite?
You are correct!
string to evaluate, starting position, length of string
The type of trigger to use for preventing updates to reconciled rows is _____
delete rows - delete cmd
delete table- drop table
alter table - add new coulmn
id integer primary key
substr(stringstart,end)
length
trim
upper lower
Commonly Used Attributes in Nunit
Catagory- The Category attribute provides an alternative to suites for dealing with groups of tests. Either individual test cases or fixtures may be identified as belonging to a particular category
Description - -The Description attribute is used to apply descriptive text to a Test, TestFixture or Assembly
expected Condition -This is the way to specify that the execution of a test will throw an exception. This attribute has a number of positional and named parameters, which we will discuss in separate sections according to the purpose they serve.
Explicit -The Explicit attribute causes a test or test fixture to be ignored unless it is explicitly selected for running. The test or fixture will be run if it is selected in the gui, if its name is specified on the console runner command line as the fixture to run or if it is included by use of a Category filter.
ignore-The ignore attribute is an attribute to not run a test or test fixture for a period of time. The person marks either a Test or a TestFixture with the Ignore Attribute
Platform-The Platform attribute is used to specify platforms for which a test or fixture should be run
Properly -The Property attribute provides a generalized approach to setting named properties on any test case or fixture, using a name/value pair.
SetUp -This is the attribute that marks a class that contains the one-time setup or teardown methods for all the test fixtures under a given namespace. The class may contain at most one method marked with the SetUpAttribute
TearDown-This attribute is used inside a TestFixture to provide a common set of functions that are performed after each test method is run. A TestFixture can have only one TearDown method
TestFixture -This is the attribute that marks a class that contains tests and, optionally, setup or teardown methods.
TestFixture Set Up- This attribute is used inside a TestFixture to provide a single set of functions that are performed once prior to executing any of the tests in the fixture.
TestFixture Tear Down--This attribute is used inside a TestFixture to provide a single set of functions that are performed once after all tests are completed
Parallel test execution - do not declare static
use [parallelizable]
What is Specflow???
SpecFlow is a test automation solution for .NET built upon the BDD paradigm. Use SpecFlow to define, manage and automatically execute human-readable acceptance tests in .NET projects (Full Framework and .NET Core).
SpecFlow tests are written using Ghekin, which allows you to write test cases using natural languages. SpecFlow uses the official Gherkin parser, which supports over 70 languages.
These tests are then tied to your application code using so-called bindings, allowing you to execute the tests using the testing framework of your choice.
You can also execute your tests using SpecFlow’s own dedicated test runner, SpecFlow+ Runner.
The automation that connects the Gherkin specifications to source code is called a binding. The binding classes and methods can be defined in the SpecFlow project
The step definition that automates the scenario at the step level. This means that instead of providing automation for the entire scenario, it has to be done for each separate step.
what is Scenario Outline: Multiple iteration of same scenario with different data.
October 09, 2020
Data Driven Testing in SpecFlow-
Data Driven Testing in SpecFlow-
1. Parameterization without Example Keyword-
LogIn_Feature.feature
2. Data Driven Testing in SpecFlow using Scenario Outline-
Parameterization with Example Keyword
@mytag
Scenario Outline: Successful Login with Valid Credentials
Given User is at the Home Page
And Navigate to LogIn Page
When User enter <username> and <password>
And Click on the LogIn button
Then Successful LogIN message should display
Examples:
| username | password |
| testuser_1 | Test@123 |
| testuser_2 | Test@153 |
3.Parameterization using Tables
Transform Table into Dictionary using Table.Rows
Transform Table into DataTable using Table.Header
Tables – CreateInstance
Tables – CreateSet
4. Data Driven Testing in SpecFlow using External Files-
Parameterization using Json
Parameterization using XML
October 05, 2020
BDD vs TDD vs ATDD
TDD-
Benefits of Test-Driven Development--
Unit test cases are covered early.
Helps reduce the amount of time required for rework.
Helps explore bugs or errors very quickly.
Helps get faster feedback.
Encourages the development of cleaner and better designs.
Enhances the productivity of the programmer.
Allows any team member to start working on the code in the absence of a specific team member. This encourages knowledge sharing and collaboration.
Gives the programmer confidence to change the large architecture of an application.
The test you write might look like this:
Describe('sum()', function () { it('should return the sum of given numbers', function () { expect(simpleCalculator.sum(1,2)).to.equal(3); expect(simpleCalculator.sum(5,5)).to.equal(10); }); })
Your implementation is currently empty. You haven’t implemented yet, so the tests will fail. You want to verify that your test is deterministic: it will tell you when it should fail or pass.
var Calculator = function () { return true // implementation goes here }
Implement it. Make the test pass. Here we’ll write the code that will make the test pass.
var Calculator = function () { return{ sum: function(number1, number2){ return number1 + number2; } }; }
Now your test will be satisfied, because we’ve added the function.
The user journey story represents a user’s behaviour. Using the business requirements provided, the developer can think about scenarios of how a user will use this new functionality. And those scenarios can be used to write the tests. This is called behaviour-driven development (BDD).
BDD is a widely-used method in UI-driven testing. It is written in a structure known as “Given, When and Then.”
Given - the state of the system that will receive the behaviour/action
When - the behaviour/action that happens and causes the result in the end
Then - the result caused by the behaviour in the state
Business-Driven Development (BDD) is a testing approach derived from the Test-Driven Development (TDD) methodology. In BDD, tests are mainly based on systems behaviour. This approach defines various ways to develop a feature based on its behaviour.
Given the user has entered valid login credentials
When a user clicks on the login button
Then display the successful validation message
Focuses on how the system should behave from the customer’s and the developer’s perspective
BDD Is a cost-effective technique
Reduces efforts needed to verify any post-deployment defects.
Acceptance Test-Driven Development is very similar to Behavioral-Driven Development. However, a key difference between them is: BDD focuses more on the behavior of the feature, whereas ATDD focuses on capturing the accurate requirement
October 02, 2020
Jenkins with Github
What next???
JENKINS
Jenkins is a powerful application that allows continuous integration and continuous delivery of projects, regardless of the platform you are working on. It is a free source that can handle any kind of build or continuous integration. You can integrate Jenkins with a number of testing and deployment technologies.
1. Download the software from https://www.jenkins.io/ and Double click
2. Click on Next
3. Click on Next
4. click on run on localsystem
5. Warning Symbol will get converted into green tick. Click on Next
6. Enter the port number as 8080 or 8081 and click on Test port to get the warning button get converted into green tick. Then click on next
7. Click on next
8. Choose option under Firewall Exception and click on next
9. Click on Install
10.
11. Jenkins will be Installed and will automatically open the page localhost:8080/
12. Fill Details
13. Jenkin Dashboard
Key concepts in Pipeline
1. Agent- To build your code or deploy your software using azure pipelines, you need at least one agent. Two types of agent- Microsoft host...
-
Author- Who creates the work product and fix the defects Management- Review planning, defining scope, selecting people, checking entry an...
-
There are different components of JMeter are called Elements that serve their own purpose. Thread Group- Thread Groups is a collection of T...
-
Review types -- Informal Review -Generating new ideas or solutions, quickly solving minor problems Walk through - Exchanging ideas about t...