14 December 2025

#Selenium

#Selenium

Key Concepts


S.No Topic Sub-Topics
1 Selenium What is Selenium?, Features, Benefits, Selenium suite overview, Use cases
2 Selenium Architecture Client-server architecture, Selenium IDE, WebDriver, Grid, Components overview
3 Selenium IDE Installation, Record & playback, Commands, Test suite, Export scripts
4 Selenium WebDriver Overview, Browser drivers, Language bindings, Advantages, Limitations
5 Locators in Selenium ID, Name, ClassName, XPath, CSS Selector
6 WebDriver Commands Get, FindElement, Click, SendKeys, GetText
7 Handling Web Elements Text boxes, Buttons, Radio buttons, Checkboxes, Dropdowns
8 Synchronization in Selenium Implicit wait, Explicit wait, Fluent wait, Page load timeout, Best practices
9 Browser Navigation Open URL, Back, Forward, Refresh, Window management
10 Handling Alerts Alert types, Accept, Dismiss, Get text, Send keys
11 Handling Frames & IFrames Switch to frame, Switch by index, Switch by name/id, Switch back, Nested frames
12 Handling Windows & Tabs Get window handles, Switch windows, Close window, Multiple tabs, Focus handling
13 Handling DropDowns Select by index, Select by value, Select by visible text, Multi-select, De-select options
14 Keyboard & Mouse Actions SendKeys, Key press, Key release, Mouse hover, Right click, Drag & Drop
15 Handling Checkboxes & Radio Buttons Check status, Select, Deselect, IsEnabled, IsDisplayed
16 Taking Screenshots Full page screenshot, Element screenshot, File saving, Formats, Automation reporting
17 Handling Tables Rows & columns, Get cell data, Iterate table, Dynamic tables, XPath strategies
18 Handling JavaScript Alerts Accept, Dismiss, Get text, Send text, Switch to alert
19 Handling Popups Alert popups, File upload popups, Window popups, Frame popups, Close handling
20 File Upload & Download SendKeys, Robot class, AutoIT, Handling download folder, Validation
21 JavaScript Executor Execute script, Scroll into view, Click element, Change value, Handle dynamic content
22 Implicit vs Explicit Wait Definitions, Use cases, Syntax, Pros & cons, Best practices
23 Selenium Grid Hub & nodes, Parallel execution, Cross-browser testing, Configuration, Scaling
24 TestNG Integration TestNG setup, Annotations, Assertions, Groups, Parameterization
25 Maven Integration Maven project, Dependencies, POM file, Build lifecycle, Plugins
26 Jenkins Integration Jenkins setup, CI/CD pipeline, Job configuration, Triggering builds, Reporting
27 Handling Dynamic Elements Dynamic XPath, CSS selectors, Wait strategies, Loops, Element identification
28 Page Object Model (POM) Design pattern, Page classes, Locators, Reusable methods, Implementation
29 Hybrid Framework Keyword-driven, Data-driven, Combination, Implementation, Advantages
30 Hands-on Projects & Best Practices Automation of login page, E-commerce site testing, Form submission, Reporting, Code organization

Interview question

Basic Level

  1. What is Selenium?
  2. What are the different components of Selenium?
  3. What are Selenium WebDriver advantages?
  4. What is the difference between Selenium 3 and Selenium 4?
  5. What browsers does Selenium support?
  6. What is a WebDriver?
  7. What is the difference between findElement and findElements?
  8. What is a WebElement?
  9. How do you launch a browser in Selenium?
  10. How do you open a URL using Selenium?
  11. How do you locate elements in Selenium?
  12. What are locators? Name the eight locators.
  13. What is XPath?
  14. What is the difference between absolute and relative XPath?
  15. What is CSS Selector?
  16. How do you handle text boxes in Selenium?
  17. How do you click a button using Selenium?
  18. How do you retrieve text from an element?
  19. How do you close and quit the browser?
  20. What is implicit wait?
  21. What is explicit wait?
  22. What is fluent wait?
  23. What is getTitle() used for?
  24. How do you check if an element is displayed?
  25. What is the difference between driver.get() and driver.navigate().to()?

Intermediate Level

  1. What are different types of waits in Selenium?
  2. What is WebDriverWait? Give an example.
  3. What is the Actions class in Selenium?
  4. How do you perform mouse hover?
  5. How to handle dropdowns in Selenium?
  6. Difference between Select class and custom dropdowns.
  7. How do you handle checkboxes and radio buttons?
  8. How do you handle alerts in Selenium?
  9. What are Frames and how do you switch to them?
  10. How do you switch between windows/tabs?
  11. What is JavaScriptExecutor in Selenium?
  12. How do you scroll using Selenium?
  13. How do you upload a file using Selenium?
  14. How do you handle file downloads?
  15. How do you take screenshots?
  16. How do you capture full-page screenshots in Selenium 4?
  17. What is Page Object Model (POM)?
  18. What is Page Factory?
  19. What is the @FindBy annotation?
  20. What is TestNG? Why is it used with Selenium?
  21. Explain the TestNG annotations.
  22. How do you generate reports using TestNG?
  23. What is data-driven testing?
  24. How do you parameterize tests in TestNG?
  25. What is the difference between soft assert and hard assert?
  26. What is a headless browser?
  27. How to run Selenium tests in headless mode?
  28. What is WebDriverManager?
  29. What is the difference between quit() and close()?
  30. What is StaleElementReferenceException?
  31. What are navigation commands in Selenium?
  32. How do you maximize and minimize windows?
  33. How do you wait for an element to be clickable?
  34. What is XPath axes?
  35. How do you validate broken links in Selenium?

Advanced Level

  1. How do you handle dynamic elements?
  2. How do you create custom XPath expressions?
  3. What is Shadow DOM and how do you handle it in Selenium 4?
  4. How do you handle WebSockets in Selenium 4?
  5. Explain Relative Locators in Selenium 4.
  6. How do you run tests in parallel using TestNG?
  7. How do you integrate Selenium with Maven?
  8. How do you integrate Selenium with Jenkins?
  9. How do you run Selenium tests in Docker?
  10. Explain Selenium Grid architecture.
  11. How do you set up Selenium Grid 4?
  12. What is distributed Parallel testing?
  13. What is the role of Hub and Node in Selenium Grid?
  14. How do you capture network logs in Selenium 4?
  15. How do you intercept requests/responses in Selenium 4?
  16. How do you automate authentication pop-ups?
  17. How do you manage cookies in Selenium?
  18. What is fluent design in automation framework?
  19. What is a hybrid test framework?
  20. What is Keyword-Driven Framework?
  21. What is Data-Driven Framework?
  22. What is Behavioral Driven Development (BDD)?
  23. How do you integrate Selenium with Cucumber?
  24. What is Hooks in Cucumber?
  25. Explain Gherkin syntax with example.

Expert Level

  1. How do you design a scalable Selenium automation framework?
  2. Explain your framework architecture in detail.
  3. How do you integrate Selenium with CI/CD pipeline?
  4. How do you design reusable utilities in automation?
  5. How do you apply SOLID principles in Selenium framework?
  6. How do you implement a Factory design pattern in POM?
  7. How do you implement the Builder pattern for tests?
  8. How do you apply Strategy pattern in Selenium automation?
  9. How do you manage test data for large test suites?
  10. How to integrate Allure/Extent reports?
  11. How do you perform cross-browser testing at scale?
  12. How do you handle intermittent automation failures?
  13. How do you set up cloud test execution using BrowserStack/Sauce Labs?
  14. How do you implement Self-Healing locators?
  15. Describe an enterprise-level Selenium automation solution you built.

Related Topics


String Handling

#String Handling

Key Concepts


1Introduction to StringsDefinition, String vs character array, Memory concept, Immutable concept, String literal vs object
2String CreationLiteral, new keyword, Intern pool, String constants, equals() behavior
3Basic OperationsConcatenation, length(), substring(), charAt(), indexOf()
4Equality & Comparisonequals(), == operator, compareTo(), equalsIgnoreCase(), best practices
5String PoolString intern(), memory saving, literal reuse, JVM mechanism, debugging pool
6StringBuilderMutable concept, append(), insert(), reverse(), capacity()
7StringBufferThread safety, synchronization, performance, use case, compare with StringBuilder
8ConversiontoCharArray(), getBytes(), valueOf(), parse methods, format() output
9Useful Methodstrim(), replace(), split(), startsWith(), endsWith()
10Regex BasicsPattern, Matcher, meta characters, match(), replaceAll()
11Advanced RegexGroups, quantifiers, lookahead, lookbehind, capturing
12TokenizationStringTokenizer, Scanner use, split vs tokenizer, stream tokenization, parsing
13String Formattingprintf(), format(), placeholders, locales, formatting numbers
14Case HandlingtoLowerCase(), toUpperCase(), locale support, Unicode cases, normalization
15Substring & IndexingExtract substring, boundaries, index operations, find substring, custom search
16Searching AlgorithmsBrute force search, KMP logic, pattern matching, rolling hash basics, use cases
17Performance OptimizationCost of concatenation, StringBuilder usage, profiling, memory leaks, repeated operations
18Mutable vs ImmutableDeep dive, advantages, thread safety, identity hash code, security
19Memory ManagementHeap allocation, String pool garbage collection, intern optimization, examples
20Unicode & EncodingUTF-8, UTF-16, char vs byte, surrogate pairs, emoji handling
21Character HandlingCharacter class, codePoint(), isDigit(), isLetter(), conversion
22File & IO StringsReading text, StringBuilder for building, buffer read, split lines, writing
23Stream API with Stringsmap(), filter(), joining(), flatMap(), collectors
24Security AspectsPassword handling, String vs char[], secure erase, log sanitization, risks
25LocalizationLocale, Collator, Comparator, region-based formatting, internationalization
26Complex ParsingJSON parsing basics, CSV parsing, escaping quotes, splitting rules, custom delimiters
27Design PatternsString pool pattern, builder pattern, flyweight pattern, factory use, internalization
28Testing StringsJUnit tests, assertions, regex tests, corner cases, mock inputs
29Enterprise Use CasesLogging, request handling, templates, localization, user input validation
30Interview PrepTop 20 questions, coding challenges, regex tasks, performance traps, custom implementation

Interview question

Basic Level

  1. What is a String in Java?
  2. How do you create a String object?
  3. Difference between String and char[].
  4. Why are Strings immutable in Java?
  5. What is the String constant pool?
  6. Difference between == and equals() in String comparison.
  7. What does length() method return in a String?
  8. How do you find a character at a specific index in a String?
  9. Difference between charAt() and substring().
  10. How do you check if a String is empty?
  11. How do you concatenate two Strings?
  12. What is the difference between + operator and concat() method?
  13. How do you convert a String to lowercase or uppercase?
  14. How do you trim whitespace from a String?
  15. How do you compare two Strings ignoring case?
  16. How do you find the index of a character in a String?
  17. What does lastIndexOf() method do?
  18. How do you check if a String contains another String?
  19. What is startsWith() and endsWith() used for?
  20. How do you replace characters in a String?
  21. Difference between replace() and replaceAll().
  22. How do you split a String by a delimiter?
  23. How do you join Strings in Java 8?
  24. How do you convert a String to a char[]?
  25. How do you convert a char[] back to a String?

Intermediate Level

  1. What is String interning in Java?
  2. How does the intern() method work?
  3. What is the difference between heap Strings and pool Strings?
  4. How do you check if a String is a palindrome?
  5. How do you reverse a String in Java?
  6. What happens when you use + operator inside a loop with Strings?
  7. Why is StringBuilder faster than String for concatenation?
  8. Difference between StringBuffer and StringBuilder.
  9. What is the substring() method used for?
  10. How does substring() implementation differ in Java 6 vs Java 7?
  11. How do you count the number of words in a String?
  12. How do you count the number of occurrences of a character?
  13. How do you extract only digits from a String?
  14. How do you check if a String contains only alphabets?
  15. How do you validate an email using Regex with Strings?
  16. Difference between matches() and contains().
  17. How do you remove special characters from a String?
  18. How do you check if a String is numeric?
  19. How do you find all substrings of a String?
  20. How do you find duplicate characters in a String?
  21. How do you sort the characters in a String?
  22. How do you remove duplicate characters from a String?
  23. How do you convert String to int and double?
  24. How do you convert numbers to Strings?
  25. How do you use String.format()?

Advanced Level

  1. Explain memory allocation of Strings in Java.
  2. How does garbage collection work with String literals?
  3. Why are Strings immutable from a security perspective?
  4. Why is char[] better than String for storing passwords?
  5. How do you compare two Strings lexicographically?
  6. How do you handle Unicode in Java Strings?
  7. How do you normalize Unicode Strings?
  8. How does encoding affect Strings in Java?
  9. How do you convert a String to bytes?
  10. How do you convert bytes back to a String?
  11. How do you handle special characters in JSON Strings?
  12. Explain the role of CharSequence interface.
  13. What is StringJoiner introduced in Java 8?
  14. How does StringJoiner work internally?
  15. How do you join multiple Strings using Streams?
  16. How do you split a multiline String into lines?
  17. How do you check if a String is an anagram?
  18. How do you implement case-insensitive search?
  19. How do you replace multiple substrings at once?
  20. How do you tokenize a String in Java?
  21. What are Pattern and Matcher classes used for?
  22. How does replaceAll() use Regex internally?
  23. How do you extract a substring using Regex?
  24. How do you efficiently join large Strings?
  25. How do you check if two Strings are rotations of each other?

Expert Level

  1. How does JVM optimize String usage internally?
  2. How does String constant pool improve performance?
  3. What are the performance implications of String immutability?
  4. Explain lazy loading of Strings.
  5. How does String concatenation compile into StringBuilder?
  6. How do Streams improve String processing in Java 8+?
  7. What are best practices for handling Strings in enterprise apps?
  8. How do you handle memory leaks with Strings?
  9. How does String interning affect garbage collection?
  10. How do you measure performance of String operations?
  11. What is the impact of substring() holding references to large arrays?
  12. How was this fixed in Java 7 update?
  13. How do you create a custom immutable String-like class?
  14. How do you secure sensitive data stored in Strings?
  15. What are pitfalls of using == in String comparison?
  16. How do you handle locale-sensitive String operations?
  17. What is collation in String comparison?
  18. How do you optimize String-heavy applications?
  19. How does StringBuilder grow internally?
  20. What is the difference in thread safety between StringBuffer and StringBuilder?
  21. How does String deduplication work in JVM?
  22. How do you debug encoding issues with Strings?
  23. How do you use Charset class with Strings?
  24. How do you build efficient String utilities?
  25. What is the future of String handling in modern Java versions?

Related Topics


   StringBuilder   
   Java String - Sample Coding