Monday, July 13

Git Essential Commands!

 Master Git with These Essential Commands! 🖥️


1. Basic Git Commands

📌 git init – Initialize a Git repository.
📌 git clone <repo_url> – Clone a repository to your local machine.
📌 git status – Check the current state of your repository.
📌 git add <file> – Stage changes for commit.
📌 git commit -m "message" – Save changes with a commit message.
📌 git push – Upload local commits to a remote repository.
📌 git pull – Download and merge changes from a remote repository.

2. Branching & Merging
📌 git branch – List branches.
📌 git branch <branch_name> – Create a new branch.
📌 git checkout <branch_name> – Switch to another branch.
📌 git checkout -b <branch_name> – Create and switch to a new branch.
📌 git merge <branch_name> – Merge changes from another branch.

3. Remote Repository Management
📌 git remote -v – View remote repositories.
📌 git remote add <name> <url> – Add a remote repository.
📌 git push origin <branch> – Push changes to a remote branch.
📌 git pull origin <branch> – Pull changes from a remote branch.

4. Viewing & Comparing Changes
📌 git log – View commit history.
📌 git log --oneline – View a simplified commit history.
📌 git diff – Show changes between commits or branches.
📌 git blame <file> – Show who changed each line of a file.

5. Undoing Changes & Resetting
📌 git reset --soft HEAD~1 – Undo last commit but keep changes staged.
📌 git reset --hard HEAD~1 – Undo last commit and remove changes.
📌 git revert <commit_id> – Revert changes without losing history.
📌 git restore <file> – Undo changes in a file.

6. Stashing Changes
📌 git stash – Temporarily save changes without committing.
📌 git stash list – View saved stashes.
📌 git stash pop – Apply the last stash and remove it.

7. Tags & Releases
📌 git tag <tag_name> – Create a tag for a specific commit.
📌 git tag -a <tag_name> -m "message" – Annotated tag with description.
📌 git push origin --tags – Push all tags to the remote repository.

8. Git Hooks & Automation
📌 git pre-commit – Runs scripts before a commit.
📌 git post-commit – Runs scripts after a commit.
📌 git pre-push – Runs checks before pushing to remote.

9. Handling Merge Conflicts
📌 git mergetool – Open a merge conflict resolution tool.
📌 git merge --abort – Cancel a merge.
📌 git diff <branch_1> <branch_2> – Compare differences between branches.

10. Git & DevOps
📌 git fetch --all – Fetch changes from all remotes.
📌 git rebase <branch> – Reapply commits on top of another branch.
📌 git cherry-pick <commit_id> – Apply a specific commit from another branch.

Infosys Interview Pattern

 Infosys Interview Pattern | Automation Testing


🔹 Round 1: Technical Round (Core + Coding)

👉 This is where most candidates get rejected
What I (interviewer) will ask you:
💡 1. Self Introduction (VERY IMPORTANT)
Not your story
Your project + framework + tools + impact
👉 Example structure:
Experience
Project
Tools (Selenium, Java, API, etc.)
What YOU did

💡 2. Selenium + Automation Concepts
Expect questions like:

Difference between find Element() vs find Elements()
Waits (Implicit vs Explicit)
Handling dropdown / alerts / frames
POM (Page Object Model)
How you handle dynamic elements
👉 I will ask:
“Tell me how YOU used it in your project?”

💡 3. Java (Important for Infosys)
OOP concepts (Inheritance, Polymorphism)
Collections (List, Map)
String programs
👉 Example:
Reverse string
Find duplicates
Palindrome

💡 4. Framework Questions (Game Changer)
👉 I WILL ask this: “Explain your framework architecture”
You must explain:
Test layer
Page layer
Base class
Utilities
Reporting
CI/CD

👉 And MOST IMPORTANT:
Flow (how everything works together)

💡 5. API + SQL (Sometimes Asked)
What is API testing
Status codes
Basic SQL query
Join

💡 6. Scenario-Based Questions (VERY IMPORTANT)
👉 I check your thinking:
Test case failing → what will you do?
Script working yesterday but failing today
Element not found → how will you handle

🔹 Round 2: Managerial Round
👉 Here I check your real experience
Questions:
Explain your project in detail
Your role & responsibilities
Challenges faced
How you handled deadlines
How you work in Agile

👉 Tip: Use real examples only (no theory)
🔹 Round 3: HR Round
Expected salary
Notice period
Relocation
Why Infosys?

🔥 What Infosys REALLY Checks

👉 Not tools… but:
✔ Clarity of basics
✔ Confidence in explanation
✔ Real project understanding
✔ Problem-solving mindset

Locator

 Here are some tips to help you choose the best locator strategy:


1️⃣ ID Locator: The fastest and most reliable. Always prefer `id` whenever possible.

2️⃣ Name Locator: Great for forms, especially when no `id` is available. It's also quick, though not as reliable as `id`.

3️⃣ Class Name Locator: Ideal for identifying elements with shared CSS class names. Use it when the class is unique and stable.

4️⃣ XPath Locator: Powerful and flexible but slower. Use XPath when other locators are not an option, but try to avoid overcomplicating your expressions.

5️⃣ CSS Selector Locator: A great alternative to XPath! Faster and more efficient, especially with complex web pages.

𝗡𝗮𝗴𝗮𝗿𝗿𝗼 𝗤𝗔 𝗔𝘂𝘁𝗼𝗺𝗮𝘁𝗶𝗼𝗻 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄 𝗤𝘂𝗲𝘀𝘁𝗶𝗼𝗻𝘀

  𝗡𝗮𝗴𝗮𝗿𝗿𝗼 𝗤𝗔 𝗔𝘂𝘁𝗼𝗺𝗮𝘁𝗶𝗼𝗻 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄 𝗤𝘂𝗲𝘀𝘁𝗶𝗼𝗻𝘀 - Write a Java Program to find the Maximum Sum Subarray.   ...