Learn Selenium and Java for Selenium

Sunday, 15 July 2018

WebServices Test Automation-Introduction


What is WebServices?
WebServices are set of rules and protocols which helps in communication between two software on same or different platforms. For implementing these webservices there are two popular approaches:

REST:
REST stands for REpresentational State Transfer. This requires less bandwidth than SOAP. It allows all types of data formats  like plain text, HTML, XML, JSON etc
For example:
http://services.groupkt.com/country/get/all

SOAP:
SOAP stands for Simple Object access protocol. This requires more bandwidth than REST. It allows XML data format only.

Web services component?
Before moving to webservices testing, we should know about web services components.So have look at webservices components.

URL – Web service URL. Using this URL, we can send multiple requests to server.
For example:
http://services.groupkt.com/country/get/all

HTTP Method – GET, POST, DELETE etc.
GET: This method will fetch data from database and display to user.
POST: This method will enter new entry into the database
Delete: This method will Delete record from database.
PUT: This method will update any record from database

Header –  This will define what type of data we are passing.

Body Parameter – Here we pass actual data along with the request.

Response Code – After request has completed we will get response. There are specific codes are defined according to type of request has been made.For example:200,500 etc

What is Web Services testing?
Webservices can be tested by manually or by automation.First, We will see how to test  it manually. There are couple of tools are available for webservices testing.
SOAPUI, Postman etc.

You can download Postman from below :
https://www.getpostman.com/apps

You can install and open it.
PFB the sample screen shot for UI of Postman, where We need to hit the web services URL.I would be using above URL only.
Here, I am fetching data using GET method.





How can we Automate?
Manual testing for webservices is more tedious and time taking. There are couple of tools and frameworks are available for webservices  automation testing. SOAPUI, RestAssured, jersey-client, etc
In upcoming articles, we will see webservice automation testing using jersey-client.

Saturday, 14 July 2018

What are collections in JAVA?

What are Collections in JAVA?


Today we will be learning of Collections , Collections in java are used to store different object in a single unit.It is like a jar of chocolates


Now let us understand why we need Collections?


As java Collections framework provide useful set of classes and its methods which are very powerful. If we need to perform algorithm operation we can perform that, if we want to perform add,remove operation that are also easily achievable .

Collections framework helps to decrease the development effort and increase the quality of code

A Collections framework consist of

  •                    Interface and its implementation(classes)
  •                          Algorithms


Use of Collections

The use of Collections is not all about its powerful nature it is also about about the flexibility it adds , consider if we use array we define its fixed size but after using the arraylist in Collections the size is dynamic which helps not to waste any memory.Now Collections can also store both homogeneous and heterogeneous objects which is an additional advantage ,so benefits are many


In next article we would understand the Collections architecture, Keep reading!!


Sunday, 8 July 2018

Strings in Java : Part 7

String Methods

Remember our last post focused on usage of split() method in string in case you have missed seeing that you can see our Strings in Java : Part 6 Post , now we are going to explain some of the easy and most commonly used string methods here ,

  • String toLowerCase()
    • This method converts all the character in string to the lower case
  • String toUpper()
    • This method converts all the character in string to the upper case
  • String concat()
    • This method is used to combine two strings
  • String replace()
    • This method is used to replace a old character with new character
  • String compareTo()
    • This method is used to compare given string to current string and this method can return positive, negative or zero values


Let us understand the usage of methods used above using below program :


public class Main{  
public static void main(String args[]){  

String s1="Learn Selenium Automation";
String s2="Selenium ";

String lower = s1.toLowerCase(s1);
String upper =s1.toUpper(s1);
String replace =s1.replace('L', 'T');
String concat=s1.concat("Easily");

System.out.println(s1.compareTo(s2));
System.out.println(upper);
System.out.println(lower);
System.out.println(replace);
System.out.println(concat);

 }
}  

The output of the above program is 

-6
LEARN SELENIUM AUTOMATION
learnseleniumautomation
Tearn Selenium Automation
Learn Selenium Automation Easily


Hope you have understood the Post if there is any doubt please feel free to add the comments section we would answer your queries :)

Saturday, 7 July 2018

Strings in Java : Part 6

String Methods

Exited about the next method that we are going to explain is Split() method in string. It is commonly asked method in the interviews and it is used most frequently in the Automation projects.

Split() method in short returns the array of the string based on the delimiter provided in the method.

So let us understand the basic syntax and usage of the split method


  • String split()
    • The split() method split the string into the arrays of sub string based on the separator specified
  • split() method is available with 2 different variables which are
    • String array[]= str.split("/")- It will return the array of strings whenever a '/' is encountered in string. 
    • String array[]= str.split("/,2")- It will return array of only 2 strings even after the '/' is present in string more than 2 times.


Let us understand the split() method using the programs



public class Main{  
public static void main(String args[]){  

String s="Learn/Selenium/Automation";  

   String[] a=s.split("/");//   

      System.out.println(a[0]);
      System.out.println(a[1]);
      System.out.println(a[2]);
  
 }
}  

The output of the above program is 

Learn
Selenium
Automation

                    Now Lets try the other variant of the split() method

public class Main{  
public static void main(String args[]){  

String s="Learn/Selenium/Automation/Strings";  

   String[] a=s.split("/,2");//   

      System.out.println(a[0]);
      System.out.println(a[1]);
 
  
 }
}  

The output of the above program is 

Learn
Selenium/Automation/String


Hope you have understood the Post if there is any doubt please feel free to add the comments section we would answer your queries :)

Tuesday, 19 June 2018

What is Scrum meeting ? What happens in this meeting? Who participates in the meeting?


Have you been thinking about the above questions but not getting the relevant answer? Please keep reading.

Scrum meeting is a part of Agile testing environment. When you are working in an Agile based environment, you will encounter scrum meeting on daily basis.

Basically, Scrum meeting happens as first thing in the morning as your office day starts. Usually, it goes for 15-20 minutes. It is called as stand up meeting as people will be standing majorly and discussing about the work.

Participants in scrum meeting are QA's, Developers including developer lead, B.A( Business Analyst) and Scrum Master. There will be 6-8 or 8-10 people in the meeting. ( depending upon how many QA's or Dev's are there in your organisation).

Everybody joins the meeting and discuss and contribute on the below pointers:

The Agenda or the key pointers of the meeting is:

i) To speak on what you did yesterday
ii.) Are there any hurdles or blockers which are stopping you to do your work ?
iii.) What is your work plan for tomorrow?


Everyday, each of the person has to give their inputs and discuss the problems if they have and come up with solutions.

This is what we call as Scrum Meeting.

Please feel free to give your inputs! I hope you like what you read. Happy Reading and please come back to learn some more interesting concepts like this.

Thank you for reading!




What is Gradle?


Have you been hearing the term “Gradle” but not sure what it is? Let me give you a short and crisp overview. 


  •      Gradle is a build management tool for the JVM.

  •      Gradle is based upon groovy scripting. But, you do not need to learn Groovy to understand it.
  •      When you create a gradle project, you get build.gradle file and settings.gradle file whereas In Maven, you get POM.XML file.
  •           In Build.gradle, you do not have to write dependencies using </ tag and /> tag.In Gradle, you can write your own tasks.No tags are used unlike Maven.
  •       In Build.gradle, you do not have to write dependencies using </ tag and /> tag.In Gradle, you can write your own tasks.No tags are used unlike Maven
  •        Gradle has good supoorts of IntelliJ which is IDE similar to NetBeans or Eclipse. You can create a gradle project  in IntelliJsuccessfully. Also, you can import an already existing gradle project in IntelliJ as well. 
  •       Build.gradle has simple notation. You can easily understand what is written in gradle file.
  •       Gradle uses dsl-domain specific language so its quite easy to maintain and work with it.


Thank you for reading!

Please keep coming back to read more such good notes and feel free to give your inputs.


What is Maven?

Maven is a build automation tool. With Maven we can import all libraries and can also create project structures. 

A Maven is basically a tool used to compile our applications. It helps to develop and managing project structure or applications like deployment, clean, packaging, jar and many more features for the Java-based project. When you create a Maven project,you get two folders: src/tests and src/main src/tests where you write all your tests and src/main where you write all your page classes.  Also,when you create a Maven project,POM.xml file is created in your folder structure,you can add all the required dependencies to it like selenium,Apache POI,JUnit,extent report( whichever you need for your project). It is one of the very effective tool for build management. You need to download some 8-10 dependencies in POM.XML file to work on your Java based project.

Please feel free to provide your inputs. Keep reading and please come back to this page for more short and crisp notes.

Thank you for reading!

Popular Posts

Recent Posts



Newsletter

Join our newsletter to get secret tips directly in your inbox!


*We Hate Spam!

Powered by Blogger.