Survival KitBeginner
QE Survival Kit: Essential Tools & Commands
Quick reference guide for the most useful tools, commands, and techniques every QE needs daily
8 min read
...
toolscommandsquick-referenceproductivityessentials
Your Daily QE Toolkit
This is your survival kit—the commands, tools, and techniques you'll use every single day. Bookmark this page!
Git Commands for QE
Daily Workflow
# Check what changed
git status
git diff
# See recent changes
git log --oneline --graph --all --decorate
# Find who changed a file (blame/praise)
git log --follow -- path/to/TestFile.java
git blame path/to/TestFile.java
# Search commit history
git log --grep="payment" --oneline
git log --author="john@example.com" --since="1 week ago"
# Undo local changes
git checkout -- filename.java # Discard changes to one file
git reset --hard HEAD # Discard ALL local changes
# Stash changes temporarily
git stash # Save changes
git stash pop # Restore changes
git stash list # See all stashesBranching
# Create and switch to branch
git checkout -b feature/add-payment-tests
# Switch branches
git checkout main
# Update your branch with main
git checkout feature/my-branch
git pull origin main
# Delete branch locally
git branch -d feature/old-branch
# See all branches
git branch -aDebugging
# Find when a bug was introduced
git bisect start
git bisect bad # Current commit is bad
git bisect good <commit-sha> # This commit was good
# Git will check out commits; mark each as good/bad
# See file at specific commit
git show <commit-sha>:path/to/file.java
# Compare two branches
git diff main..feature/my-branchMaven Commands (Java Projects)
Build & Test
# Clean and build
mvn clean install
# Run all tests
mvn test
# Run specific test class
mvn test -Dtest=LoginTest
# Run specific test method
mvn test -Dtest=LoginTest#testValidLogin
# Run tests in specific package
mvn test -Dtest=com.company.api.*
# Skip tests during build
mvn clean install -DskipTests
# Run tests with coverage
mvn clean test jacoco:report
# View report: target/site/jacoco/index.htmlDebugging
# Run with debug logging
mvn test -X
# Debug specific test (attach debugger on port 5005)
mvn test -Dtest=LoginTest -Dmaven.surefire.debugREST API Testing with cURL
GET Requests
# Simple GET
curl https://api.example.com/products
# GET with headers
curl -H "Authorization: Bearer TOKEN" \
https://api.example.com/user/profile
# GET with query parameters
curl "https://api.example.com/search?q=laptop&page=1"
# Save response to file
curl https://api.example.com/products > response.json
# Pretty print JSON (with jq)
curl https://api.example.com/products | jq '.'POST Requests
# POST with JSON data
curl -X POST https://api.example.com/login \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"Test123"}'
# POST from file
curl -X POST https://api.example.com/users \
-H "Content-Type: application/json" \
-d @user-data.json
# POST form data
curl -X POST https://api.example.com/upload \
-F "file=@test-image.jpg" \
-F "title=Test Upload"Other HTTP Methods
# PUT (update)
curl -X PUT https://api.example.com/products/123 \
-H "Content-Type: application/json" \
-d '{"price": 99.99}'
# PATCH (partial update)
curl -X PATCH https://api.example.com/users/456 \
-H "Content-Type: application/json" \
-d '{"email": "newemail@example.com"}'
# DELETE
curl -X DELETE https://api.example.com/cart/items/789Advanced Options
# See full request/response headers
curl -v https://api.example.com/products
# See only headers
curl -I https://api.example.com/products
# Follow redirects
curl -L https://api.example.com/redirect
# Set timeout
curl --max-time 10 https://api.example.com/slow-endpoint
# Ignore SSL errors (NOT for production!)
curl -k https://self-signed.example.comSQL Queries for Testing
Verify Test Data
-- Check if test user exists
SELECT * FROM users WHERE email = 'test@example.com';
-- Verify order created
SELECT * FROM orders
WHERE user_id = 123
ORDER BY created_at DESC
LIMIT 1;
-- Check inventory levels
SELECT sku, available_quantity
FROM inventory
WHERE sku IN ('SKU-001', 'SKU-002');
-- Find recent transactions
SELECT * FROM payments
WHERE created_at > NOW() - INTERVAL 1 HOUR
ORDER BY created_at DESC;Test Data Setup
-- Create test user
INSERT INTO users (email, password_hash, created_at)
VALUES ('testuser@example.com', 'hashed_password', NOW());
-- Add test product
INSERT INTO products (sku, name, price, stock)
VALUES ('TEST-SKU', 'Test Product', 99.99, 100);
-- Create test order
INSERT INTO orders (user_id, status, total, created_at)
VALUES (123, 'pending', 199.98, NOW());Cleanup
-- Delete test data
DELETE FROM orders WHERE user_id = 999;
DELETE FROM users WHERE email LIKE '%@test.com';
-- Reset auto-increment (be careful!)
ALTER TABLE orders AUTO_INCREMENT = 1;
-- Truncate table (removes all data)
TRUNCATE TABLE test_sessions;Useful Queries
-- Count records
SELECT COUNT(*) FROM orders WHERE status = 'completed';
-- Group by status
SELECT status, COUNT(*) as count
FROM orders
GROUP BY status;
-- Find duplicates
SELECT email, COUNT(*)
FROM users
GROUP BY email
HAVING COUNT(*) > 1;
-- Recent failures
SELECT * FROM test_runs
WHERE status = 'failed'
AND created_at > NOW() - INTERVAL 7 DAY;Docker Commands for Test Environments
Container Management
# List running containers
docker ps
# List all containers
docker ps -a
# Start/stop containers
docker start container_name
docker stop container_name
# Remove container
docker rm container_name
# View logs
docker logs container_name
docker logs -f container_name # Follow logs
docker logs --tail 100 container_name # Last 100 linesDocker Compose (Common for Test Envs)
# Start all services
docker-compose up
# Start in background
docker-compose up -d
# Stop all services
docker-compose down
# Rebuild and start
docker-compose up --build
# View logs
docker-compose logs -f
# Run command in service
docker-compose exec web bash
docker-compose exec db mysql -u root -pCleanup
# Remove stopped containers
docker container prune
# Remove unused images
docker image prune
# Remove everything (CAREFUL!)
docker system prune -aChrome DevTools for Testing
Quick Access
F12 Open DevTools
Ctrl+Shift+C Inspect element
Ctrl+Shift+I Open DevTools
Ctrl+Shift+M Toggle mobile viewNetwork Tab
- Filter by XHR (API calls only)
- Right-click → "Copy as cURL" (reproduce API call)
- Check response times
- Verify status codes
- Inspect request/response payloadsConsole Tab
// Find elements
document.querySelector('[data-testid="submit-button"]')
document.querySelectorAll('.product-card')
// Get all cookies
document.cookie
// Get local storage
localStorage.getItem('authToken')
// Clear storage
localStorage.clear()
sessionStorage.clear()
// Network requests
// (Works in console when DevTools open)
fetch('/api/products').then(r => r.json()).then(console.log)Application Tab
- View cookies
- View local storage
- View session storage
- Clear storage
- View service workersJQ - JSON Processor (Command Line)
Installation
# macOS
brew install jq
# Ubuntu/Debian
sudo apt-get install jq
# Windows
choco install jqCommon Uses
# Pretty print JSON
echo '{"name":"John","age":30}' | jq '.'
# Extract field
curl https://api.example.com/user | jq '.email'
# Extract array items
curl https://api.example.com/products | jq '.[0].name'
# Filter array
jq '.[] | select(.price > 100)' products.json
# Count items
jq '. | length' products.json
# Transform data
jq '.products[] | {name, price}' response.jsonGrep - Search Tool
Find in Files
# Search for text in files
grep -r "LoginTest" .
# Case insensitive
grep -ri "logintest" .
# Show line numbers
grep -rn "LoginTest" .
# Show only file names
grep -rl "LoginTest" .
# Exclude directories
grep -r "LoginTest" . --exclude-dir=node_modules
# Search for pattern
grep -r "test.*Login" .
# Count matches
grep -rc "LoginTest" .Quick Debugging Techniques
Test Failures
# 1. Check recent changes
git log --since="1 day ago" --name-only
# 2. Run test multiple times
for i in {1..10}; do mvn test -Dtest=FlakyTest; done
# 3. Check logs
tail -f application.log
grep "ERROR" application.log
# 4. Compare with working commit
git diff <working-commit> <failing-commit> -- TestFile.javaEnvironment Issues
# Check Java version
java -version
# Check Maven version
mvn -version
# Check Node version
node -v
npm -v
# Check environment variables
env | grep -i java
echo $PATH
# Check running processes
ps aux | grep java
ps aux | grep node
# Check port usage
lsof -i :8080
netstat -an | grep 8080Productivity Shortcuts
IDE (IntelliJ/Eclipse)
Ctrl+Shift+T Find test class
Ctrl+Shift+F10 Run test at cursor
Ctrl+F9 Build project
Ctrl+Shift+F Find in files
Alt+F7 Find usages
Ctrl+Alt+L Format code
Ctrl+D Duplicate line
Ctrl+Y Delete lineTerminal
# Navigate
cd - # Go to previous directory
cd ~ # Go to home
pwd # Print working directory
# History
history # Show command history
!<number> # Rerun command by number
!! # Rerun last command
Ctrl+R # Search history
# Aliases (add to ~/.bashrc or ~/.zshrc)
alias gst='git status'
alias gd='git diff'
alias mtest='mvn clean test'
alias dcu='docker-compose up'Essential Bookmarks
Documentation
- Your platform's API docs (Swagger/Postman)
- Test environment URLs
- CI/CD dashboard
- JIRA/ticket system
- Team wiki/Confluence
Tools
- Regex tester: https://regex101.com
- JSON formatter: https://jsonformatter.org
- Base64 encoder/decoder
- Epoch time converter
Learning
- RestAssured docs
- Selenium docs
- Maven docs
- Git cheatsheet
Pro Tips
- Create aliases for commands you use daily
- Keep a scratchpad of useful commands/queries
- Automate repetitive tasks with shell scripts
- Learn keyboard shortcuts for your IDE
- Use version control for test data and configs
- Document weird issues you solve (for future you!)
- Share useful commands with your team
Conclusion
Print this guide, keep it handy, and customize it with commands specific to your platform. The more these become muscle memory, the more efficient you'll be!
Remember: The best tool is the one you know how to use. Master the basics before jumping to fancy tools.
Comments (0)
Loading comments...