Top 21 GIT Interview Questions and Answers for SDET - DevOps - Automation QA


How to Switch to previous branch:

Ans: git switch @{-1}

How to create repository in bitbucket and push code for automation project?
Ans: Below are the sequence of commands to use:

First go to your bitbucket path and get access to create repository.
Create a repository with a self defined name, let name is "Automaters"
Then open cmd in the laptop where you have kept your automation project
cd existing-project
git init
git add --all
git commit -m "InitialCommit"
git remote add origin "https://path....Automaters.git"
git push -u origin master

If you get SSL certificate error to push then use below:

git config --global http.sslVerify false

How to Push a local branch for the first time:
Ans: git push --set-upstream origin <branch>

How to Push a local branch to a different remote branch:
Ans: git push origin <local_branch>:<remote_branch>

How to undo commits?
AnsThe following command will undo your most recent commit and put those changes back into staging, so you don't lose any work:
$ git reset --soft HEAD~1
The next one will completely delete the commit and throw away any changes. Be absolutely sure this is what you want:
$ git reset --hard HEAD~1

Fetch changes from both origin and upstream in the same shot:
Ans: git fetch --multiple origin upstream

How to Delete a remote branch on origin:
Ans: git push origin : <remote_branch>

Difference between rebase and merge?
Ansgit merge apply all unique commits from branch A into branch B in one commit 
 git rebase gets all unique commits from both branches and applies them one by one.
 git rebase rewrites commit history but doesn't create extra commit for merging.

Unstash those changes and bring them back into your working directory
Ans: git stash pop

Difference between soft, mixed, and hard resets?
Ans: --soft: Uncommit changes but leave those changes staged
--mixed (the default): Uncommit and unstage changes, but changes are left in the working directory
--hard: Uncommit, unstage, and delete changes

Listing the existing tags in Git is straightforward
Ans: $ git tag

How to create tag?
Ans: git tag <tagname>

Command to delete the file from your working directory and stages the deletion?
Ans: git rm [fileName]

Unstash your changes without popping them off the stack.
Ans: git stash apply

How to know about the history?
git log
To know more about git log : https://git-scm.com/docs/git-log

How to know all the details of changes to a commit?
git show <commitID>
To know more about git show : https://git-scm.com/docs/git-show
 
How to know the last commit details and see a log where each commit is one line?
To know the last commit details : git log -1
see log each commit in one line: git log --pretty=oneline

What git add and git commit command does
Git add--> add the changes to index area
Git commit--> add changes to local repo

How to compare two branch in GIT?
git diff branch1...branch2

How to view current state and any merge conflits?
git status
    The git status command displays the state of the working directory and the staging area.

How to undo last commit and rewrite history?
git reset --hard HEAD~1
 
Difference between soft, mixed, and hard resets?
--soft: Uncommit changes but leave those changes staged
--mixed (the default): Uncommit and unstage changes, but changes are left in the working directory
--hard: Uncommit, unstage, and delete changes

How to reset a file back to how it was before changes?
git restore <filename>     # new syntax (as of Git 2.23)
git checkout -- <filename> # old syntax

How to unstage changes or restore files?
Maybe you accidentally staged some files which we don't want to commit.
git restore test.js
git restore .
Git Official Docs

Top 10 tech skills that are a must to hit in 2021

Required technical skills that can boost your career in 2021 and beyond.

The world of technology continues to change rapidly. The demand for professionals with advanced skills IT has never been higher.

With technology roles dominating the "best jobs" or "most in-demand" lists of the future, we're looking at some of the most in-demand tech skills of 2021 that will help increase demand in the tech market and your value as an employee.

 

Cybersecurity is one of the hottest technology trends in 2020 due to the importance of companies that collect customer and user information to keep their networks safe from attacks.

A The shortage of cybersecurity skills among professionals IT has created a sought-after market for those with skills in cybersecurity, information security, network security, and vulnerability assessment skills.


DevOps professionals have revolutionized the way businesses meet the growing demands of their customers and the best DevOps professionals are those that are able to work with other areas across the business.

Being able to speed up processes and development cycles all while maintaining a high degree of accuracy and not compromising on security is what talented DevOps professionals are all about.



Easy steps to create Requirement Traceability Matrix (RTM)

A Traceability Matrix is a document that co-relates any two-baseline documents that require a many-to-many relationship to check the completeness of the relationship.
It is used to track the requirements and to check the current project requirements are met.



Advantages of Requirement Traceability Matrix (RTM):
  1. Gives Overview of ALL the requirements
  2. Shows how requirements are linked to Test Cases
  3. Makes sure 100% coverage of requirements
  4. Easy to prepare
  5. No special tool is required

How to prepare Requirement Traceability Matrix (RTM):
  1. Get all available requirement documents. For eg. Business Requirement Document(BRD), Functional Requirement Document(FSD), Technical Requirement Document(TSD)
  2. First list down All the requirements from BRD one by one with requirement ID#
  3. Now go to FSD, and list all respective functional requirements for each Business Requirements
  4. Open Test Scenario or Test Case document and link available TC IDs to respective Functional Requirements
Let’s take an example:

Business Requirement Document (BRD) :


This document is provided by the Client with high-level business Requirements. Suppose for Flight Booking Application it shows below 2 requirements
BR_1  Reservation Module :
It should allow the user to book one or more tickets, one way or a round way for future dates
BR_2  Payment Module:
User should able to make payment for booked tickets via Credit / Debit Card or through Reward Points

Functional Specification Document (FSD) :

This document is prepared by the Technical team which further elaborate business requirements into functional requirements that can be implemented in software.
Suppose above 2 business requirements in BRD have more detailed functional requirements:
BR_1  Reservation Module :
  • FR_1 : One Way Ticket booking
    • It should allow user to book one-way ticket
  • FR_2 : Round Way Ticket
    • It should allow user to book round way ticket
  • FR_3: Multicity Ticket booking
    • It should allow user to book one way or round way ticket for multiple cities
BR_2  Payment Module:
  • FR_4: By Credit Card
    • It should allow user to make payment by Credit Cards
  • FR_5 By Debit Card
    • It should allow user to make payment by Debit Cards
  • FR_6 By Reward Points
    • It should allow user to make payment by Reward Points

And you have written some test cases or test scenarios for each functional requirement.
   
So if we prepare simple Requirements Traceability Matrix (RTM) for the above example it would like as below:
Requarements Treaceability Matrix
You can also add Execution Status and Defects columns in RTM to view the overall status of all requirements along with Test Cases.

How to download Chrome Driver for Selenium

The detailed steps on how you can download Selenium Chrome Driver.

Before we start with the download process, let us try to get some basic understanding on what chrome driver is and why do we need it.

What is chrome driver?

You know that selenium is a tool that basically interacts with browsers to test your web applications. In our previous article, we had mentioned that you can use selenium webdriver to open some url on a browser and interact with webpage elements like buttons, links, text boxes etc.
But selenium cannot do all these tasks on its own. It needs some help from the browser side as well, to perform all these tasks. So, in that sense, chrome driver is what helps selenium perform these actions on Chrome browser. In more technical terms, ChromeDriver is a standalone server which implements WebDriver’s wire protocol for Chrome.

Like chrome driver, are there more standalone servers for other browsers as well?

Yes. Just like chrome driver, there are multiple other standalone servers as well. Some popular ones are GeckoDriver for firefox, EdgeDriver for Microsoft Edge, InternerExplorerDriver for IE, SafariDriver for Safari browser and so on.
You will need to use these drivers when you want to run your automation scripts on their corresponding browsers.

Why have we selected chrome driver for this tutorial and not others?

This question can be rephrased like this – 
Why are we using chrome browser to automate our test cases? 

There are two main reasons for this:
  • Chrome has the highest market share worldwide. So, it makes sense to work on the browser which majority of the people are using. We have given below a comparison chart of different browsers.
  • Selenium works better in Chrome than other browsers, especially Firefox. When I started working on Selenium automation in 2012 Firefox was kind of the default browser to go to when people wanted to automate test scripts. But now a lot of people prefer to use chrome to write automation scripts.



Let us now check out the steps to download ChromeDriver !

Steps to download ChromeDriver

Follow the steps given below to download the latest version of chrome driver for selenium –
1. Open ChromeDriver download page – https://sites.google.com/a/chromium.org/chromedriver/downloads
2. This page contains all the versions of Selenium ChromeDriver. We are interested in the latest version of ChromeDriver, which is ChromeDriver 75.0.3770.8 (as on 04 May 2019), as shown in the below image.



3. Click on ChromeDriver 75.0.3770.8 link. You will be navigated to ChromeDriver download page which contains ChromeDriver for Mac, Windows and Linux operating systems.



4. Click on chromedriver_win32.zip to download ChromeDriver for Windows.
5. Once you download the zip file, unzip it to retrieve chromedriver.exe


#Reading #Writing #Learning #Skills #to #upgrate #recommend #to #change 
#Automation #Tesing #Automate #The #Manual #Efforts 

#Soni10.10 #hsoni2010 #harry #soni1010 #QualityEngineer 

Important Technical Questions - Software Testing

Important Technical Questions I have faced in the Interviews :

1. Actions in Selenium
2. Write positive and negative scenario for Alerts
3. Syntax for Windows handler
4. Find odd number
5. Disadvantages of Selenium
6. Diff btwn get() and navigate().to()
7. Write code to click the Check box which is in the Dynamic Table
8. Code for Screenshot
9. Maps in Java
10. Explain framework
11. What is Pom.xml
12. Tell the correct Xpath
13. Xpath methods
14. Css selector
15.How to identify dynamic images
16.Print only integers from strings
17.Remove duplicates from arraylist
18.Print frame names
19.How to read from XML or CSV file and store in hashmap
20.Get value of a cell in Dynamic table
21.Burn down chart(Agile)
22.Print these characters from a given string and change to uppercase
23. Access specifiers
24. Difference between Priority and Severity
25. Example for High Priority and Low Severity and vice versa
26. Difference between Test Strategy and Test Scenario
27. What Software Metrics you used
28. How to handle Dynamic Elements,since the webpage is designed in Angular Js
29. Implicit and Explicit Waits
30. Cross Browser Testing
31. Method Overloading and Method Overriding
32. Static Method
33. Dependencies in Pom.xml
34. Write code for fetching data from Excel
35. Select Statement
36. Assert and Verify
37. Check a string is Palindrome or not
38. Remove duplicate characters from a string and print
39. Which Code Repository you are using(Ex: GitHub)
40. How will you estimate the time to automate a scenario
41. How to perform Right Click
42.In a dynamic Table if I give 1 cell value,it should give me the values of other cells in that row
43.Have you Developed any Tool,If yes explain
44. Frames
45. Read from a text file and store in HashMap
46. Print the occurrence of a character if it is present more than once in a string
47. Write code for nested drop-down,You have to check all the values in the dropdown,All permutation and combination
48. Advantages of Selenium
49. Try Catch
50. How to check if a checkbox is displayed
51. What all exceptions you have faced
52. What all difficulties you have faced in Selenium
53. What all TestNG Annotations used in project
54. Where will you maintain the code
55. What all Collections,you have used in your project
56. How to run multiple test cases
57. Primitive and Non primitive Data Types
58. What is JDK,JRE and JVM
59. Settings.xml in Maven
60. Eliminate first and last string from array and print
61. Encapsulation
62. What is the use of build() and perform () in Actions



#Reading #Writing #Learning #Skills #to #upgrate #recommend #to #change 
#Automation #Tesing #Automate #The #Manual #Efforts 
#Soni10.10 #hsoni2010 #harry #soni1010 #QualityEngineer 

World’s most desirable Test Automation skills!

                                
                                 Most Desirable Test Automation skills!

In order to answer the question – “What are the most desirable test automation skills in the upcoming year of 2016?”, our research team took over the top job searching websites around the globe looking for the most popular and required technologies in the test automation field.
Most popular test automation frameworksMost popular test automation frameworks
Selenium is considered to be the world’s most popular framework. The most surprising fact regarding Selenium in the United States is that it’s almost 300% more demanded than QTP/UTF which has made to the second place. This huge gap practically renders all the other technologies as less relevant for people looking to learn a new automation framework.
The broad use of Cucumber and the fact that Behavior-Driven Development (BDD) and testing has become one of the promising technologies in Europe influence the rising popularity of the Ruby programming language. As can be seen in the graph above, Ruby for test automation has become the second most popular language in Europe, and the third most popular in the US.
We can summarize by saying that in case you are looking for test automation position in Europe, Cucumber Ruby may be the right buzzwords in your resume.
If your destination is India; Selenium or a premium solution such as QTP or Microsoft testing tools (Coded UI/Unit Testing) will most likely improve your chances in finding a job in the test automation field.
World’s test automation programming languages distribution
Most popular test automation programing languages in the world
In case you are debating on whether to acquire Java programming skills to improve your chances for sitting behind an interview desk, you probably on the right path. The combination of Java and Selenium are so far considered the most popular for test automation in the world.
The broad use of Python in test automation is already well known, yet our research reveals that Python is highly popular when used for internally developed tools.  This and the fact that it’s broadly used with Selenium contributes to its continuous and rapid growth in the US and Europe in specific.
Finally, if it hasn’t been clear so far, SQL is a very useful asset for all QA engineers.  SQL validation queries are very common and complementary to automated test scenarios, as it's broadly used with any of the existing programming languages.
Demand for mobile test automation experts Mobile test automation demand worldwide
The demand for mobile test automation experts is higher in the US compared to India, which is considered as very much lean in mobile skills demand for test automation compared to the rest of the world.
While discussing mobile technologies, acquiring test automation skills for iOS considered a must-have skill, while Android isn’t too far behind.  Therefore, we recommend targeting both technologies in order to increase your chances in finding a job in the mobile test automation field. You may refer to popular tools drill down here: Open Source Tools for Mobile App Test Automation’.
Operation Systems DistributionTest Automation for operation systems
Currently, the need for Linux automation experts is similar to Windows and continues to grow in the world of test automation across the globe, as also reflected in the growth of use in cross-platform programming languages such as (Java, Python, Ruby, etc). In any case, acquiring “advanced user” skills with Linux based distributions is necessary.
In addition, it is interesting to see the almost equal segmentation between desktop and mobile OSes (Linux<->Windows/ iOS<->Android). This trend may very much show that smartphone – mobile world is taking over the world.


#Reading #Writing #Learning #Skills #to #upgrate #recommend #to #change 
#Automation #Tesing #Automate #The #Manual #Efforts 
#Soni10.10 #hsoni2010 #harry #soni1010 #QualityEngineer 

Collection of technical ebooks

I have collection on ebooks. If need mail me on hsoni2010@gmail.com

Will share via mail.
Thank you 😊