Interview Questions Flashcards
Interview Prep / Knowledge refresh
What are the limitations of Selenium
- Can only test web applications
- Limited support for image testing
- No built-in reporting
- Limited test management
What are the types of web locators
- ID
- linkText
- Name
- Tag name
- Class name
- X-Path
- CSS selector
What are the types of waits?
- Implicit: wait for a defined period of time
- Explicit: wait for a defined expected condition
- Fluent: wait for a defined expected condition and check for element with defined frequency
What are the navigation commands?
- to()
Navigates to provided URL - refresh()
Refreshes the current page - forward()
Goes to next page - back()
Goes to previous page
Difference between driver.close() and driver.quit()
- close() command closes the browser’s current window.
- quit() closes all open browser windows
How can we type text into an input box?
sendKeys()
How can we click a hyperlink?
Identify element using:
- linkText()
- partialLinkText()
How can we scroll down a page?
By using JavascriptExecutor
How to assert the title of a webpage?
getTitle() returns the title of the current webpage
How to mouse hover over an element?
moveToElement() included in the Actions class
How to retrieve CSS properties of an element?
getCssValue()
What is a Page Object Model?
A design pattern where:
- Every webpage is represented as a separate class
- Each class contains element identifiers and actions
Test cases are stores in separate classes than page object classes
Can Captcha be automated?
No
How does Selenium handle Windows bases pop-ups?
Selenium cannot handle pop ups outside of the web page. Third party tools can be integrated with Selenium to handle pop-ups
AutoIT, Robot - simulates mouse movement, keystrokes
How can we take screenshots?
TakeScreenshot and getScreenshotAs()