1. What are the types of locators used to identify object?
ANS:
- ID
- Name
- Class Name
- Tag Name
- Link Text & Partial Link Text
- Link Text
- CSS Selector
- DOM (Document Object Model)
- XPath
2. Difference between getwindowHandle and getwindowHandles ?
ANS:
3. How to handle popup and alerts in selenium?
ANS:
Alert alert = driver.switchTo().alert();
alert.accept(); //it will click on "ok"
alert.dismiss(); //it will click on "cancel"
4. How to handle mouse and key board events using selenium?
Keyboard Events Using Selenium Actions Class:
- sendKeys(keysToSend) : sends a series of keystrokes
- keyDown(theKey) : Sends a key press without release it. (example: Keys.ALT, Keys.SHIFT, or Keys.CONTROL)
- keyUp(theKey): Performs a key release
Mouse Events Using Selenium Actions Class:
- click (): click on element
doubleClick (): Double clicks on Element
contextClick() : Performs a context-click (right click)
clickAndHold(): Clicks at the present mouse location
dragAndDrop(source, target): Invokes click-and-hold at the source location and moves to the location of the target element before releasing the mouse. source – element to grab, target – element to release
- dragAndDropBy(source, xOffset, yOffset) : Performs click-and-hold at
the source location, shifts by a given offset, then frees the mouse.
xOffset – to shift horizontally, yOffset – to shift vertically
- moveByOffset(x-offset, y-offset): Shifts the mouse from its current
position (or 0,0) by the given offset. x-offset – Sets the horizontal
offset (negative value – shifting the mouse to the left), y-offset –
Sets the vertical offset (negative value – shifting the mouse to the up)
- moveToElement(toElement): It shifts the mouse to the center of the element
release(): Releases the depressed left mouse button at the existing mouse location
5. What are the functions most commonly used in xpath, describe any 5?
ANS:
- Contains
- Sibling
- Ancestor
- And OR
- Parent
- Starts with
- XPath Axes
- Following
- Preceding
*************************************************
API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign
Java Related Interview Question Set
https://automationreinvented.blogspot.com/search/label/Java
GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT
Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions
No comments:
Post a Comment