Web Test Automation Flashcards

1
Q

What is Selenium?

A

Selenium is an API-based web testing tool supporting multiple browsers and languages, capable of handling frames, popups, and AJAX elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the two main Selenium objects?

A

Driver and WebElement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the Selenium Driver object do?

A

It allows interaction with the browser, including navigation, accessing page source, and finding elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the Selenium WebElement object do?

A

It encapsulates web page elements, allowing querying and interaction such as clicking, submitting, and setting text.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can web elements be located in Selenium?

A

By id, CSS selector, class name, name, link text, tag name, and XPath.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the difference between findElement() and findElements()?

A

findElement() returns the first matching element or throws an exception if none is found, while findElements() returns a list of all matching elements or an empty list if none are found.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can dynamic timing issues be handled in Selenium?

A

Using WebDriverWait and ExpectedConditions instead of Thread.sleep().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a Page Object Design Pattern?

A

It abstracts the web front end by creating an object model around it, making tests more maintainable and readable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the benefits of using the Page Object Design Pattern?

A

Improved test readability and maintainability by abstracting web elements and their interactions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How can you test adding an item to a shopping cart on Amazon using Selenium?

A

Search for an item, click the second result, add it to the basket, view the basket, and verify the item exists in the basket.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How should developers be involved in automated testing?

A

Developers should create conventions, assign unique IDs for important components, and promote testability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does the Page Object Design Pattern consist of?

A

Creating a class for each page component, passing WebDriver through the constructor, and implementing methods for page interactions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly