Prev: Q5, Next: Q7

# Quiz Questions


📗 Question 1



📗 Question 2





📗 Question 3



📗 Question 4





📗 Question 5



📗 Question 6





📗 Question 7



📗 Question 8





📗 Question 9



📗 Question 10




📗 End of Quiz
:
 ***** ***** ***** ***** ***** 

 ***** ***** ***** ***** *****

📗 [1 points] (SU23M2Q1, S23M2Q1) Given that driver is a Selenium WebDriver, which of the following enables us to find all the table elements within a web page?
driver.find_elements("tag name", "table")
driver.find_elements("tag name", "td")
driver.find_elements("name", "table")
driver.find_elements("name", "td")
📗 [1 points] (SU23M2Q3, S22M2Q2, F21MQ2) The Document Object Model (DOM) for a web page may not be which of the following data structure?
binary tree
weakly connected graph
directed acyclic graph
tree
📗 [1 points] (SU23M2Q2, SU23FQ11) Assume element is a Selenium WebElement given by <a href="page.html" target="_blank">link<\a>. Which of the following returns link?
element.text
element.get_attribute("text")
element.get_attribute("href")
element.href

📗 [1 points] (S23M2Q2) Assume that the variable text stores a reference to a WebElement object instance which can accept input. Which of the following will enable us to send 1 as the input?
text.send_keys("1")
text.send_keys(1)
text.send_key("1")
text.send_key(1)
📗 [1 points] (S23FQ29) Given the following HTML snippet:
<div id="a">
<ul>
<li>1</li>
<li>2</li>
</ul>
</div>
<div id="b">
<ul>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
</div>
Assuming driver is correctly initialized, what does the following code snippet print?
element = driver.find_element("id", "a")
elements = element.find_elements("tag name", "li")
print(len(elements))
2
3
4
5
📗 [1 points] (new) Suppose element is an HTML table WebElement with 3 rows and 3 columns, which of the following code finds the text in the last cell of the first row in the table?
element.find_element("tag name", "tr").find_elements("tag name", "td")[2].text
element.find_elements("tag name", "tr")[2].find_element("tag name", "td").text
element.find_element("tag name", "td").find_elements("tag name", "tr")[2].text
element.find_elements("tag name", "tr")[2].find_element("tag name", "td").text
📗 [1 points] (new) Suppose element is an HTML text input WebElement, which one of the following clears the text in element?
element.clear()
element.text = ""
element.send_key("")
element.send_keys("")
📗 [1 points] (new) Which one of the following methods is guaranteed to find a goal node that is 5 edges away from the initial node in a graph? Assume each node has a finite number of children.
breadth first search
depth first search
best first greedy search
none of the other choices
📗 [1 points] (new) Suppose the following nodes are in the priority queue, {node: "A", g: 1, h: 10}, {node: "B", g: 3, h: 7}, {node: "C", g: 5, h: 3}, {node: "D", g: 7, h: 2}, where "g" represents the distance from the initial node and "h" represents the heuristic (estimated distance to the goal node). Which node will best first greedy search check next?
"A"
"B"
"C"
"D"
📗 [1 points] (new) Suppose the following nodes are in the priority queue, {node: "A", g: 1, h: 10}, {node: "B", g: 3, h: 7}, {node: "C", g: 5, h: 3}, {node: "D", g: 7, h: 2}, where "g" represents the distance from the initial node and "h" represents the heuristic (estimated distance to the goal node). Which node will A search check next?
"A"
"B"
"C"
"D"





Last Updated: April 29, 2024 at 1:10 AM