Learn Selenium and Java for Selenium

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!

Sunday, 10 June 2018

GIT in Practical World


GIT in Practical World

We have discussed about meaning of different GIT commands. Now biggest challenge is how exactly GIT is being used in our projects. What kind of GIT approaches are getting followed in organization?


Git approach 1-Using Fork
Let’s take scenario, there are three members in a team as A, B, C. Their project (Demo_GIT) is in central main repository. All three are working on same file ex. XYZ.java

Each team member will create fork of the central main repository. Forking is nothing but taking copy of the repository.

For example, ‘A’ will create fork as Demo_GIT_A.
Then they can take clone of fork into their local and they can start working on their assigned task.
After they done with their work.  They will commit it and take pull from Demo_GIT(main repository).

After resolving conflict, they will push their code to respective Fork.

Now they will raise Pull Request from fork Demo_GIT_A ->Demo_GIT. Here reviewer can review the changes. If everything is fine. Reviewer will merge the code.



Git approach 1-Using Branches

Let’s take same scenario as above, Demo_GIT project is on master branch, all team members will create individual branches.

For example, ‘A’ will create branch as Demo_GIT_A in the same repository.
Then they can take clone of branch into their local and they can start working on their assigned task.

After they done with their work. Its team member’s responsibility to keep their branch updated. So, they will commit it and will take updates from master branch to their individual branch(Demo_GIT->Demo_GIT_A). Now they will take Pull from Demo_GIT_A.
 After resolving conflict, they will push their code to respective Fork.

Now they will raise Pull Request from branch Demo_GIT_A ->Demo_GIT. Here reviewer can review the changes. If everything is fine. Reviewer will merge the code.








Popular Posts

Recent Posts



Newsletter

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


*We Hate Spam!

Powered by Blogger.