API:
1. Nividia NIM
| # | Test Scenario | Test Steps | Expected Result | Type |
|---|---|---|---|---|
| 1 | Log in with valid credentials | Enter a valid email and password, and click Login | User is logged in and dashboard is shown | Positive |
| 2 | Login with invalid password | Enter valid email and wrong password, click Login | Error message is shown | Negative |
| 3 | Login with empty fields | Click Login without entering any data | Validation messages are displayed | Negative |
| 4 | Remember Me functionality | Check "Remember Me", login, logout, revisit login page | Email should be pre-filled | Positive |
| 5 | Forgot password link | Click "Forgot Password", enter email | Password reset link is sent | Positive |
| # | Test Scenario | Test Steps | Expected Result | Type |
|---|---|---|---|---|
| 6 | Signup with valid details | Fill form with valid data and submit | Account is created successfully | Positive |
| 7 | Email already registered | Enter an already used email and submit | Error: Email already exists | Negative |
| 8 | Signup with weak password | Enter a password like "123" | Error: Weak password warning | Negative |
| 9 | Password and Confirm Password mismatch | Enter different passwords | Error: Passwords do not match | Negative |
| 10 | Signup without accepting terms | Leave "Terms & Conditions" unchecked and submit | Error: Must accept terms | Negative |
| # | Test Scenario | Test Steps | Expected Result | Type |
|---|---|---|---|---|
| 11 | Add product to cart | Click "Add to Cart" on a product | Product appears in cart | Positive |
| 12 | Remove product from cart | Click "Remove" in cart page | Product is removed | Positive |
| 13 | Change product quantity | Increase quantity from 1 to 3 | Total price updates correctly | Positive |
| 14 | Cart total calculation | Add multiple products, verify total | Cart total is correct | Positive |
| 15 | Checkout with empty cart | Click checkout without any items | Warning: Cart is empty | Negative |
| # | Test Scenario | Test Steps | Expected Result | Type |
|---|---|---|---|---|
| 16 | Payment with valid card | Enter valid card details and click Pay | Payment successful message | Positive |
| 17 | Payment with invalid card number | Enter fake card number | Error: Invalid card | Negative |
| 18 | Payment with expired card | Enter an expired card | Error: Card expired | Negative |
| 19 | Payment network failure | Simulate network loss during payment | Transaction failed, retry option shown | Negative |
| 20 | Redirect after payment | Complete payment | User is redirected to order confirmation | Positive |
Are you preparing for a Selenium WebDriver interview? Below are the most frequently asked Selenium interview questions with Java code examples. These cover real-time scenarios and will help both freshers and experienced testers gain confidence.
Selenium WebDriver is a web automation tool used to automate browser actions like clicking, typing, navigating, etc. It provides a programming interface to create and run test cases.
WebDriver driver = new ChromeDriver();
driver.get("https://example.com");
driver.findElement(By.id("login")).click();
---
Using the WebDriver interface and browser-specific driver classes like ChromeDriver or FirefoxDriver.
System.setProperty("webdriver.chrome.driver","path/to/chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("https://google.com");
---
Using locators: id, name, className, cssSelector, xpath, linkText, tagName
driver.findElement(By.id("username")).sendKeys("admin");
driver.findElement(By.name("password")).sendKeys("admin123");
driver.findElement(By.xpath("//button[@type='submit']")).click();
---
findElement() and findElements()?| findElement() | findElements() |
|---|---|
| Returns a single WebElement | Returns a list of WebElements |
| Throws NoSuchElementException if not found | Returns an empty list if not found |
Using the Select class.
WebElement dropdown = driver.findElement(By.id("country"));
Select select = new Select(dropdown);
select.selectByVisibleText("India");
---
Alert alert = driver.switchTo().alert();
System.out.println(alert.getText());
alert.accept(); // or alert.dismiss();
---
String parent = driver.getWindowHandle();
Set<String> allWindows = driver.getWindowHandles();
for (String window : allWindows) {
if (!window.equals(parent)) {
driver.switchTo().window(window);
driver.close();
}
}
driver.switchTo().window(parent);
---
Actions action = new Actions(driver);
WebElement menu = driver.findElement(By.id("menu"));
action.moveToElement(menu).perform();
---
Use dynamic XPath or wait strategies like explicit wait.
//input[contains(@id, 'user')]
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
WebElement element =
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("username")));
---
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
---
TakesScreenshot ts = (TakesScreenshot) driver;
File src = ts.getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(src, new File("screenshot.png"));
---
driver.switchTo().frame("frameName");
// Perform actions inside frame
driver.switchTo().defaultContent();
---
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("window.scrollBy(0,500)");
---
Assert.assertEquals(driver.getTitle(), "Expected Title");
Assert.assertTrue(driver.getCurrentUrl().contains("dashboard"));
---
POM is a design pattern where each web page is represented as a class. Elements are defined as variables, and actions are methods.
public class LoginPage {
WebDriver driver;
@FindBy(id="username") WebElement username;
@FindBy(id="password") WebElement password;
@FindBy(id="login") WebElement loginBtn;
public LoginPage(WebDriver driver) {
PageFactory.initElements(driver, this);
}
public void login(String user, String pass) {
username.sendKeys(user);
password.sendKeys(pass);
loginBtn.click();
}
}
---
Use WebDriverManager and pass the browser as a parameter.
WebDriver driver;
if(browser.equals("chrome")){
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
} else if(browser.equals("firefox")){
WebDriverManager.firefoxdriver().setup();
driver = new FirefoxDriver();
}
---
get() – loads a new pagenavigate().to() – can be used to go forward/backward in historydriver.findElement(By.id("upload")).sendKeys("C:\\path\\file.txt");
---
File download requires browser settings using ChromeOptions or FirefoxProfile to set download paths.
---This article covers the most frequently asked manual testing questions with real-time examples, concepts like STLC, bug life cycle, and test techniques. Suitable for both freshers and experienced professionals.
Software Testing is the process of evaluating a software application to identify defects and ensure it meets the specified requirements.
Real-Time Scenario: Before launching an e-commerce website, testers validate the cart, payment, and checkout functionalities to avoid issues post-launch.
STLC is a sequence of activities conducted during testing:
Real-Time Example: In a banking app, STLC ensures that login, balance view, and fund transfer are tested in an organised manner.
| Criteria | Verification | Validation |
|---|---|---|
| Definition | Are we building the product right? | Are we building the right product? |
| Activity Type | Static | Dynamic |
| Examples | Reviews, Walkthroughs | Testing, UAT |
States: New → Assigned → Open → Fixed → Retest → Verified → Closed
Alternate States: Rejected, Deferred, Duplicate
Real-Time Scenario: A user reports login failure → Developer fixes it → Tester retests → Marks as Verified → Closed.
| Test Case ID | TC_001 |
|---|---|
| Functionality | Login |
| Steps | 1. Enter username 2. Enter password 3. Click Login |
| Expected Result | The dashboard is displayed |
| Feature | Test Case | Test Scenario |
|---|---|---|
| Detail Level | Very detailed | High-level idea |
| Example | Validate login with valid creds | Test login functionality |
A defect is a deviation from the expected result in the application.
Example: The Login button does not redirect to the home page.
| Term | Definition | Example |
|---|---|---|
| Severity | Impact of the defect on the system | App crashes → High Severity |
| Priority | The order in which the defect should be fixed | Fixing login issue → High Priority |
Testing existing functionality to ensure new changes haven't broken anything.
Real-Time Scenario: After adding a "Save for Later" feature, re-test the cart, checkout, and payment flows.
Testing the defect after it’s fixed to verify it's resolved.
| Feature | Smoke Testing | Sanity Testing |
|---|---|---|
| Purpose | Basic build verification | Verify bug fixes/functional areas |
| Time | Initial build | After a minor release |
Testing where test cases are not predefined. Tester explores the app on the fly.
Example: While testing a new travel app, testers explore unusual booking combinations.
Unplanned testing without documentation.
Testing is done by the end-user/client to confirm that the system meets business needs.
| Feature | Functional Testing | Non-Functional Testing |
|---|---|---|
| Focus | What system does | How well does the system perform |
| Example | Login, Signup | Load time, security, UI usability |
A document describing test scope, approach, resources, and schedule.
Test inputs at the edge of input ranges.
Example: For age 18–60, test 17, 18, 60, 61.
Divides input data into valid and invalid classes.
A document mapping requirements with test cases.
| Requirement ID | Test Case ID |
|---|---|
| REQ-001 | TC-001, TC-002 |
Example: In a food delivery app, placing an order deducted payment, but didn’t place the order. Severity: High, Priority: High.
Data used during test execution, e.g., usernames, passwords, and product IDs.
Entry Criteria: Preconditions before testing start.
Exit Criteria: Conditions to conclude testing.
Testing on different browsers, devices, and OS.
Prioritising testing modules based on business impact and failure probability.
| QA (Quality Assurance) | QC (Quality Control) |
|---|---|
| Process-oriented | Product-oriented |
| Prevent defects | Identify defects |
Testing a login page is one of the most important tasks in software testing. Whether you’re preparing for a QA interview or writing real-time test cases for your web or mobile application, a login module provides many critical validations. In this post, you’ll learn manual test cases, common bugs, and Selenium automation examples for login functionality.
| Test Case ID | Scenario | Test Steps | Expected Result |
|---|---|---|---|
| TC001 | Valid username and password | Enter valid credentials and click Login | The user should be redirected to the dashboard |
| TC002 | Invalid password | Enter a valid username and the wrong password | The error message should appear |
| TC003 | Blank username and password | Leave both fields blank and click Login | Validation messages should be displayed |
| TC004 | Blank username only | Leave the username blank, enter the password, and click Login | The username required message should appear |
| TC005 | Blank password only | Enter username, leave the password blank, click Login | Password required message should appear |
| TC006 | SQL injection attempt | Enter "admin' OR 1=1--" as the username | Input should be rejected and sanitized |
| TC007 | Special characters in the username | Enter special characters like '@#$%' | Error or input validation message should appear |
| TC008 | The password field is masked | Check if the password is displayed as dots or asterisks | Characters should be hidden |
| TC009 | Remember Me checkbox | Select the checkbox and log in | The user should stay logged in on the next visit |
| TC010 | Forgot Password link | Click the link and validate the navigation | The user should go to the reset password screen |
| TC011 | Case sensitivity | Enter uppercase instead of lowercase username | The system should handle case sensitivity properly |
| TC012 | Browser Back button after login | Log in successfully and press the browser back button | The user should not return to the login page or see cached content |
| TC013 | Multiple failed login attempts | Try logging in with the wrong password 5 times | Account lock or CAPTCHA should appear |
| TC014 | Login session timeout | Login and remain idle | The session should expire after the defined timeout |
| TC015 | Mobile responsiveness | Open the login page on mobile devices | The login form should render correctly on smaller screens |
@Test
public void validLoginTest() {
WebDriver driver = new ChromeDriver();
driver.get("https://example.com/login");
driver.findElement(By.id("username")).sendKeys("testuser");
driver.findElement(By.id("password")).sendKeys("testpass");
driver.findElement(By.id("loginBtn")).click();
String expectedTitle = "Dashboard";
String actualTitle = driver.getTitle();
Assert.assertEquals(actualTitle, expectedTitle);
driver.quit();
}
This Selenium test script verifies a successful login using valid credentials. You can also write negative test cases using invalid passwords and assert error messages.
We use cookies and similar technologies (like Ahrefs and Google Analytics) to improve your experience and analyze site traffic. By clicking "Accept", you consent to our use of these tools. See our Privacy Policy for details.