Thursday, May 28, 2020

Part-1: Want Quick Divorce? Come in...: [Kahani Ghar-Ghar ki]




Want Quick Divorce? Come in...




Shop No-117, 
Nyaya Marg, Canton, 
Dhoomanganj, Prayagraj, 
Uttar Pradesh 211001, India.

This is the banner written in front of my office and I am Upmanyu Mishra, Bsc.,LLB. I couldn’t find any scope after completing my graduation in Physics. As I couldn’t clear any job interview in Physics field for continuous 3 years. I was named as ‘Educated Saand’ by my friends and relatives. I was not ashamed because, just forcibly I took Physics as a graduation subject, I had no interest in it.
Then I decided to pursue my childhood passion of resolving conflicts between people. Due to my diligent and impeccable mastery in this, I was default umpire in many Cricket, Kabaddi and Kho-kho matches[to resolve war-like fights between two teams]. And I decided to pursue LLB. Passed and today I am and Advocate, in family matters from past 10 years.

‘May I come in?”, my office door knocked. ‘Yes please ’, I said. ‘I am Chitra Singh. I saw the board outside your office.’ And she looked down. Well this is quite common behavior in all my clients. I asked her to sit. Mangalsutra around her neck, red-bindi on her forehead, devastated confidence. It was also obvious she came in seeing the board, means she was thinking of ‘Divorce’ consultation from me.

Before she could collapse completely I asked her ‘You need water?’, she said ‘Yes, please.’ After having water, she said ‘Arun and I are married for past 6 years’. I interrupted her ‘Love Marriage?’. She looked at me as if I was reading her forehead lines accurately. ‘Yes, she said’ and continued. Initial days before marriage and after marriage were the best days of my life, I couldn’t expect anything better than those days. It continued for 3.5 years. I again interrupted her, ‘Do you work somewhere?’. ‘Yes, I am an MBA Grad and I work as Branch Manager in HDFC Bank, Prayagraj.'  We both just hate each other and there is no scope I can continue further’, her confidence started rising with every sentence now. That’s bad, but I interrupted her again ‘I would like to hear from start without hiding anything’. She said ‘Arun and I studied in same class, same college, St. Stephen’s Management Institute. He used to die to see me early in the morning. Hiding from my father, he used to be at my local bus-stop by dot 7’o Clock. He used to say, his routine started early morning 5’o clock, but how to come so early, so he used attend morning 6’o clock mass, at the church near my house. ‘Arun is Christian?’ I asked her. ‘No, only thing open at that time near my house was church , so he is used to spend his time there. After spending one hour, he used to meet me at bus-stop’ Chitra said.

This continued for 2 years and one day I said to my father about him. My father was strictly against our marriage. I should have listened to those kind words of my father. I made a big mistake. And she started crying. It was difficult to see a Bank Branch Manager crying. ‘But I still listened to my heart. After college we both got jobs at far locations from our house. Initially he used to drop-and-pick me  to office. He used to eat the food that I made, but as days passed, he started complaining about the lack of salt in rice, burnt roti etc etc.’ ‘Ok, then...’I replied.

He started becoming more aggressive on me, questioned me on every move of mine, started checking my phone etc . I was broken when he came drunk and raised hand on me, whom he was loving like mad. Now he has started drinking everyday. I could not sustain this anymore. ‘When do you think this all really started?’ I asked her. ‘I told you right, all this started inch-by-inch after 3.5 years of our marriage’, angrily she replied to me. I have been coming and going in front of your office and seeing tag-line ‘Want Quick Divorce? Come in..’ on the board outside your office from past one month, but couldn't  gather enough guts to get in, today I have gathered all of it and come to you. I want divorce please help me.’

I said ‘Don’t worry, I am here for this only, after all its my business. 2000 Rs, for sending divorce notice, 2000 Rs, for successfully filing the case in court, 1000 Rs  before every date in court and 10,000 Rs after successful divorce. This is my fee-structure. Ready?’ Immediately she said ‘Yes’. This gave me complete knowledge of how eager she was  for divorce. ‘But before I proceed, can you do me a favor, can you go home today, think properly and list down 10 wrong things in you husband, for which you want to leave him. This can strengthen the case. OK?’  I said to her.



Wednesday, May 27, 2020

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


Selenium WebDriver, Maven...
Thanks for your tremendous response on Part-1. I will be explaining right from root level, so even if you don't have knowledge, no problem, you will learn. Guaranteed!! Do comment me below incase I miss to explain anything or more explanation is required.


Now we will be working on one of the most important topic in Automation viz., ‘Selenium’. 
On a whole, Selenium suite consist of below tools:
-Selenium IDE[Integrated Development Environment]: A record and playback tool. It is also a distributed Firefox plugin.
-Selenium RC[Remote Control]: Allows to create a script in desired programming language and allows executing test-scripts in large spectrum of browsers.
-Selenium WebDriver: Has various advantages over Selenium RC. Here WebDriver directly communicates with browser and uses its native compatibility to automate[don’t get terrified with biblical definition, I will make it easy in further explanation]
-Selenium Grid: Used to distribute your test execution on multiple platforms and environments concurrently.

Out of above last two are important and we will be digging deep now into Selenium WebDriver.


Lets first understand what happens to the code that we write and what is behind the picture scenario, called Selenium WebDriver Architecture. When we trigger a test, the complete selenium code[whatever you have written] gets converted into a JSON format and transferred over using HTTP protocol. This generated JSON is sent to browser driver, each browser has its own browser driver[like Chrome- Chrome BrowserDriver, IE- IE BrowserDriver, Firefox- Firefox BrowserDriver etc ].

Now BrowserDriver communicates with respective browser and executes the command by interpreting JSON received on browser.  BrowserDriver now receives response from browser and sends the response back in JSON format.
You can find this image anywhere over the internet:


Simple isn’t it? Now let’s understand further:

What Selenium can automate? Selenium can only automate web-based applications. 

Now what are web-based applications? Simplest answer would be, applications made using ‘html tags’ are called web-based applications.

How would you know whether an application is made using html tags? Just right-click on the page, click 'View page source' and do ‘ctrl+f’ and search ‘html’, if you find something like ‘

I did right-click->View page source->ctrl-f->html: Found ‘html’ and got the answer, its a web-based page and I can firmly automate this page as per our earlier explanation.


Consider you are testing this page as a manual test-case scenario:

To achieve this test-case execution, you will follow above steps and check when you type word ‘selenium’ in Google search-box, it should display various options Google provides as per its search criteria like below:

Done, your manual test-case execution passed. But what if you have to achieve this using automation. Don’t worry, nothing is difficult. It is just that whenever you try something new, since you are unknown to it, you will find it difficult. Just like learning to ride the cycle for first time, once you know, it is super-simple. Trust me. 


We will achieve this in 3 stages:
1. Stage-1: Get the required software’s for automating.
2. Stage-2: Understanding the various terms like[locators, tagname, findElement etc..etc]
3. Stage-3: Stage-1+Stage-2= Stage-3


Stage-1: So let’s install required software's and nosedive in achieving this simple test case automation:

  1. Open Eclipse[an editor which will help in writing code]. If you don’t have, download using Google, just search simple words ‘eclipse download’
  2. Open the first link that you get, whatever version of eclipse you get no problem, whether Helios, Neon etc..etc.. Click on ’64-bit download’[choose Eclipse IDE for java Developers, in case it ask for]. Once download is done, go to the location where it is downloaded. Unzip, double click[which has eclipse logo on it]  on the downloaded ‘.exe’ file.
  3. Select the location for the project and click ‘Launch’ click next->next and finish the installation. Java is compulsory for eclipse, in-case it ask for Java, provide the path of your Java which you installed in ‘Part-1’. [Click on close icon, only on the ‘Welcome’  page.]
  4. Now as your eclipse is open you are already into an development environment, where you can start writing and executing any of your code. In order to achieve automation of above test-case we can do it in two ways: 
  • Using sample small code patches and demonstrate success, but again you need to reinvent the wheel, to add these patches right from start for integrating them into framework.
  • Directly work on bigger picture and start using above framework components, it will give clear and bigger view of problems-solutions and better understanding. 
     5. For example you want to create project based on first way mentioned just above, then you need           to follow below: [don’t try creating this, just read and go through]

  • Click ‘File->New->Java Project’    
                             



  • Enter project name as ‘GoogleSearch’[you can enter any name] in ‘Create a Java Project’ and click ‘Finish’.


  • Once done it will look like below:

  • Now this is your project name ‘GoogleSearch’, click on the small arrow on the left of project inside the ‘Package Explorer’


  • You will find ‘JRE System Library’[contains default java libraries] and ‘src’[your code folder]. Right-click on ‘src’ folder->New->Class:

  • Enter name of the class as ‘TestGoogleSearch’ and check the box ‘public static void main(String args[])’:

You must be having a question, what is this checkbox ‘public static void main(String[] args)? For now just consider, when you start running in a race, there is a certain valid start-point from where you start running, similarly java starts executing from this point. And when you click ‘Finish’ the Eclipse editor creates a pre-defined code as below and also just have a look at the folder structure created at the left:


So if I have to add any class files I have to repeat above procedure to create class file or folders. Now when you work in teams, you cannot assure how your team-member would create files/folder from his end and can lead to lot of confusion. It can create issue when we try to merge code or share code, as we might further need to download certain ‘jars’[Java Archive, for now understand it as library of code bunched into one, acting as helper files, For example a bicycle bell, which is made up of so many things but packed and presented as one small instrument called ‘bell’ which help in solving our problem of cycling in traffic  ]. So when we share code then we need to make sure even these jars need to be shared appropriately or can lead to unknown errors.
  • In order to avoid such shabby structure and complexity, we need to come up with a standard, so that all team-members can follow the same. So here we will introduce ‘Maven’. Many people start with showing execution on sample code in bits and pieces, though you learn that patch of concept, but no one shows how to integrate that patch to your main framework, and your remain lost on each small patches. Just follow, I will show every part and I guarantee you will be happy of the outcome, that you learned.
  • So what is Maven?: Maven is Software Project Management and Build Management Tool[highly recommended and used tool almost across all organisations] 

Maven acts as:
    1.Central Repository to get dependencies[ like no need to download jars]
    2.Maintaining common structure across the organisation[all members default share same structure]
    3.Flexibility in integrating with CI Tools[like Jenkins]


You will soon understand the magic Maven creates:
Go to google and punch these simple search words ‘Maven download’

Click on this link[Binary zip archive], download, unzip:



Calm down and take a break here...


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?

Friday, May 1, 2020

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


Rum in campus..

    Turquoise top, white pant, white heel sandals. Curly hair-fringes, swirling and showing in which direction wind should flow.Watch on right-hand. That's all, makes a complete wonderful girl more beautiful. I asked her, why do you wear watch on right-hand?, Alma said, 'So that whenever I look at, it should show me everything right' I said fair-enough logic. 'What logic you are talking about Varun?', Mom said, what are you talking, are you dreaming, get-up, you will get late. You need to go to Bangalore today right? Word 'Bangalore' catapulted me back to my senses. 'Oh gosh..that was a dream'. Alma's calls diminished to nothing during this period . Don’t know what could be the reason, has she forgotten me or she has become too busy in her academics.

   I was not at all happy during my training period because I was based in Bangalore and as per my earlier research the company didn't had any juice in the UK. We were given accommodation in companies guest house, situated within the company for few days, till we find our own accommodation. It was Friday and a fully-packed training session day. My room-mate, Jagdish Chandra, said 'tired?', lets have fun today. I looked at his face, which had both question and answer in a single go. Without waiting for answer, he said, you wait here, I will come in a hour, just arrange some chips and wash the glasses. Keeping me clueless, winked with his left-eye and he vanished, taking with him my small thermos bottle. After two-hours he came with lot of sweat and fear on his face. I asked him 'What happened? Where is the bottle?'



   And he elaborated the instance. He said, getting alcohol in campus is not allowed, so I emptied that in the your thermo-bottle, meticulously as if I was doing 'Kipps Apparatus'  experiment in Chemistry lab. To cleanly pass, the security check, I threw the bottle within the campus from outside and marked where I threw it. My bad luck, when I threw it, security guy was passing-by. 'Thawwd...' the bottle made the noise and security heard it, he walked towards the heard noise. Before I could reach, he reached, picked-up the bottle and opened it. I guess security recognized the brand, just by its smell. To catch the person who did it, he hide behind the tree. I was quick enough to enter the gate after throwing and could see him waiting for the culprit. Worried, I ran away from there, to catch any suspicion on me. Somehow got saved.

   During my training period I developed good interest in Shell scripting and SQL Database. And I was just too good in it. But started breaking from within, bit-by-bit, as I felt my struggle of completing engineering just to be in UK with my Alma, would never come into reality. Some how I completed my training-cum-probation period of six months. Now we will be allocated to some project or the other. We were asked to update our profile with our first preferences in terms technology and location in companies internal portal. Which helps the company with talent-pool information. I was assigned to local Bangalore based project. But  week later I came to know that I will be shifted to a newly acquired project of the company.

     It was the first UK based client of the company. The client needed exactly what I was skilled in ‘Shell scripting with SQL database’, a unique skill-set. Company didn't want to take any risk with new client, so puts its best guys in that project. I was among the youngest to get direct onsite opportunity as a fresher. I felt like a Pulitzer Prize winner, as if a fiction script was written, and things were happening that way. Complete Drama. My happiness had no limit. I jumped thrice wherever I was standing to demonstrate my happiness. I realized that soon my dream to meet Alma would be turned into reality, though it was still searching needle in haystack. I took a leave of four days before project and Visa formalities starts and came to Mumbai to know Alma's exact UK whereabouts.

Continued in next release, 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-1: Want to quickly become an Selenium Automation Engineer and build framework right from scratch?


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

Part-1: Want Quick Divorce? Come in...: [Kahani Ghar-Ghar ki]


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...