What are the limitations of Selenium
What are the types of web locators
What are the types of waits?
What are the navigation commands?
Difference between driver.close() and driver.quit()
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()
Can you type in a textbox without using sendKeys()?
Yes, using JavascriptExecutor
JavascriptExecutor jse = (JavascriptExecutor) driver;
jse executeScript (“document getElementById( ‘email’).value=”abc.efg@xyz.com”);
How can we select a value from a dropdown?
Using Select
What does the switchTo() function do?
Used to switch between active windows
How can we upload a file?
Using sendKeys() and file path
or Robot to simulate mouse/keys events
How can we set the window size?
Using manage()
- maximize()
- setSize()
findElement() vs findElements()
findElements() returns a list of elements
findElement() returns the first matching element
How to handle an Authentication pop-up for Login?
Using Alert class and authenticateUsing method
Single vs double slash in xPath?
Single slash creates absolute path
Double slash creates relative path
How can we find broken links?
By checking response codes
200 OK - link is valid
404 - Link Not Found
400 - Bad Request
401 - Unauthorized
500 - Internal error