Monday, May 25, 2020

Part-1: Want to quickly become an Selenium Automation Engineer and build framework right from scratch?


   Hello everyone, I know you have clicked this link and opened this page with lot of hopes, to upgrade yourself from Manual Test Engineer to Automation Engineer, or to enhance your current automation skills. I know you have tried hard in this direction, but it was not that fruitful.

You have tried your level best, but not getting complete-end-to-end solution and now you have given-up. I promise that I wont let you down and strive to fulfill your requirement to best of my knowledge and provide step-by-step guidance. I will not use huge wall of paragraphs to bore you, or deviate from your requirement of learning, will talk straight to point quickly and will try make this a great and fast learning platform.

   I will be using Java-Selenium to continue my discussion, no problem even if you use C#, Python[concepts remain same]. Below are the topics that I will cover to build framework from scratch[don't worry, we will cover every unknown word]:

1.  Java
2.  Selenium Webdriver
3.  TestNG- Cucumber[BDD]
4.  Maven
5.  Log4j
6.  Extent Reporting
7.  Screenshots on Failure
8.  Jenkins
9.  Saucelabs/BrowserStack[Cloud/Grid executions]

   Just a bit of elaboration on above topics:
1.Java: We will be using 'Java' as the programming language[you can use C# or Python if you are comfortable with it]

2.Selenium: We will be using Selenium Webdriver. It is an open-source automation testing framework, for validating web elements on a web-application across different browsers and platforms[operating systems].

3.TestNG- Cucumber[BDD]: We will be using TestNg as an Assertion Framework and in later part we will also use Cucumber at last, which is a tightly coupled framework with Behavior Driven Development[BDD],and how it makes our work easy.

4.Maven: We will use Maven as build tool, how it helps in getting jars acts as central repository etc.

5.Log4j: We will also use Log4j, a very helpful tool, for logging our logs of execution, it can be helpful, in knowing the flow of application, finding an error and can also be used if management ask to produce just the logs of yesterday night execution.

6.Extent Reporting: We will be using this tool, to produce effective presentable reports of our framework[in simple words Test-cases execution report].

7.Screenshots on Failure: In later part of discussion we will be working on taking screenshots on failure[where the test exactly failed], because as the number of test-cases increases day-by-day, it will become very difficult to know what failed and where, so a failure screenshot will help you to directly get to the place where it failed.

8. Jenkins: This is a very-very powerful tool, it is also called as Continuous Integration Tool or Build Tool.We will see how with help of this tool we ease our deployment, provide triggers of execution[means at what time and on which day execution should happen], provide execution mail etc.

9. Saucelabs/BrowserStack[Cloud/Grid executions]: At last we learn how to deploy your execution on cloud with parallel testing . I know many of you in your interview question have answered 'NO' to this question, 'Have you worked on Grid?', but after this you will always say 'Yes'.

   So lets start this wonderful journey of Upgrading YOURSELF!!
 
What is a test-case:A Test-case is a set of conditions or rules which a Test-Engineer will determine whether a system under test satisfies the laid requirements or works correctly as per given conditions.

Who is a Test-Engineer: An Engineer who test above scenarios is an Test Engineer[I never use words Resource or Tester, because the person has taken formal years of education to be at this position, so respect is inevitable.]

What test-cases needs to be automated: Those test-cases which forms part of repetition or regression or can be done without manual intervention needs to be automated.

Who is an Automation Engineer: An Test-Engineer who automates test cases using above list of buzz-tools is an Automation Engineer, ie You. And eventually SDET[Software Development Engineer in Test]

You need to have Java installed in your system. Do below steps to install it:
1.Download the latest version of Java, hit Google with simple term 'java jdk download' , open the link and only down load the 'JDK Download' and not 'JRE'. On clicking 'JDK Download' search for 'Windows x64 Installer' as almost everyone now has 64 bit systems. Click the '.exe file' and download will start.

2.Once download is over go to the location where download is done,double-click the .exe and just click following next->next->Finish. Just jot-down the location where installation is done, in my case it is 'C:\Program Files\Java\jdk1.8.0_201'

3.Now whenever your application runs,it needs Java, so how will it come to know whether Java is installed or not, it will check it through the Environment Variables.
So we need to educate our environment variables about our Java installation path. Just right click 'My Computer' and select and navigate to 'Properties->Advanced System Settings->Environment Variables'.


4.Over here out of the two parts mentioned , see the below part under 'System variables', click 'New' and in then next small window enter 'JAVA_HOME against 'Variable name'  and
'C:\Program Files\Java\jdk1.8.0_201;' against 'Variable value' and click 'OK'.



5.Then scroll below again under 'System variables' to find variable called 'Path' select it and click on 'Edit', click 'New' it will navigate to the location for editing , enter %JAVA_HOME%\bin.


6.Here you are just mentioning where your java executable's are present, ie
JAVA_HOME\bin = C:\Program Files\Java\jdk1.8.0_201\bin and click OK.






7.Now open Command prompt, to check whether your installation and mapping is correct or not. In search write 'cmd' and hit enter. The command prompt should open.
Enter command: 'java -version' and hit enter, it should show you your installed java-version.



If it throws error like 'java' is not recognized as an internal or external command'
it means there is some issue with installation or mapping. Check and redo the mapping.

Now lets write our first ever java program. Open Notepad and write below simple code.
Note: 'FirstProgram' is the class name of the program:

public class FirstProgram
{

    public static void main(String args[])
   {
     System.out.println("My first Java Program");
   }
}

Save as 'FirstProgram.java' in your directory, sometimes you wont have rights to store in any of the 'C-drive' other than your drive.




Now go to command prompt and navigate to the location  where you have saved the file  using 'cd command', for me it is 'cd C:\Sanjay\temp'.
Now type command: 'javac FirstProgram.java' like mentioned below:



'javac' is where you are asking your compiler to compile your program. If your program doesn't have any issue, it will compile without throwing any errors, if errors are there then you need to rectify those first.

Once compiled, you need to run, the program using  command 'java FirstProgram' and your program runs  successfully, giving output 'My first Java Program'






Do let me know if you have any comments.

Continued in next release...Part-2: Selenium WebDriver[most important part]



Click below links for releases till now:

Did she really loved me....? Part-1

Did she really loved me....? Part-2

Did she really loved me....? Part-3

Did she really loved me....? Part-4

Did she really loved me....? Part-5

Did she really loved me....? Part-6

Did she really loved me....? Part-7

Did she really loved me....? Part-8

Did she really loved me....? Part-9

Did she really loved me....? Part-10

Did she really loved me....? Part-11

Did she really loved me....? Part-12

Did she really loved me....? Part-13

Did she really loved me....? Part-14

Did she really loved me....? Part-15[The End]

Want to own your own start-up? Want to be Richie Rich?

Hey Corona, you should go now!!

Part-1Want to quickly become an Selenium Automation Engineer and build framework right from scratch?

Part-2Want to quickly become an Selenium Automation Engineer and build framework right from scratch?

Part-3:Want to quickly become an Selenium Automation Engineer and build framework right from scratch?

Part-4: Want to quickly become an Selenium Automation Engineer and build framework right from scratch?

5 comments:

  1. Thanks Bipin for your valuable comment.

    ReplyDelete
  2. Hi Sanjay .. this is very nice introduction to testing world. brife intro to widely used testing tools is very helpful to understand somewhat scope of testing profile. helpful first step.. please keep writing whenever you find time. Thanks

    ReplyDelete
  3. Hi Sunil, thanks for your comment. I have uploaded the next part, you can find the link above or try this link:
    https://sanjaynikalje.blogspot.com/2020/05/part-2-want-to-quickly-become-selenium.html

    ReplyDelete
  4. Great Sanjay keep it up

    ReplyDelete

How to create any mathematics tables with excel...

  Generate any tables with excel... 1.        Go to excel sheet, in first cell ‘A1’ enter the number whose table you want to generate, for...