-
Which Selenium class is used to perform complex user interactions like drag-and-drop and keyboard actions?
A. WebDriverWait
B. Select
C. Actions
D. ActionChains
Answer: D. ActionChains -
To use ActionChains in Python, which import statement is correct?
A. from selenium.webdriver.common.by import ActionChains
B. from selenium.webdriver.support.ui import ActionChains
C. from selenium.webdriver.common.action_chains import ActionChains
D. from selenium.webdriver.common.actions import ActionChains
Answer: C -
Which method of ActionChains performs the built-up actions?
A. perform()
B. execute()
C. run()
D. start()
Answer: A -
What does the
move_to_element()method do?
A. Moves mouse cursor to the center of an element
B. Clicks the element
C. Scrolls to an element
D. Types text into element
Answer: A -
Which method is used for right-click?
A. click()
B. context_click()
C. right_click()
D. secondary_click()
Answer: B -
Which method performs a double-click action?
A. double_click()
B. click_twice()
C. duel_click()
D. action_double()
Answer: A -
Which method is used for drag-and-drop?
A. drag_and_release()
B. drag()
C. drag_and_drop(source, target)
D. drag_to(source, target)
Answer: C -
Which methods simulate keyboard press and release?
A. send_keys()
B. key_press()
C. key_down() and key_up()
D. key_stroke()
Answer: C -
What does
click_and_hold()do?
A. Double-clicks
B. Holds down the left mouse button
C. Takes a screenshot
D. Right-clicks
Answer: B -
Which Python class handles keyboard actions?
A. selenium.webdriver.common.keys
B. selenium.webdriver.common.keyboard
C. selenium.webdriver.keys
D. selenium.webdriver.driver.keys
Answer: A -
Which method scrolls to an element using Actions API?
A. scroll()
B. scroll_to_element()
C. move_to_element()
D. scroll_to()
Answer: B -
What does
pause(2)do?
A. Stops browser
B. Pauses action chain for 2 seconds
C. Refreshes after 2 seconds
D. Closes browser
Answer: B -
Which ActionChains method releases a held mouse button?
A. mouse_release()
B. release()
C. up()
D. drop()
Answer: B -
Correct drag-and-drop sequence?
A. click(), release(), perform()
B. click_and_hold(), move_to_element(), release(), perform()
C. move_to_element(), click(), perform()
D. context_click(), release(), perform()
Answer: B -
Which key emulates pressing Enter?
A. Keys.RETURN
B. Keys.ENTER
C. Both A and B
D. Keys.SUBMIT
Answer: C -
If perform() is not used after actions, what happens?
A. Error occurs
B. Actions execute automatically
C. Nothing happens
D. Browser quits
Answer: C -
Which method moves the mouse by x,y coordinates?
A. move_to()
B. move_to_offset()
C. move_by_offset()
D. move_mouse()
Answer: C -
Which method sends keys to the active element?
A. send_keys()
B. write()
C. input_keys()
D. type()
Answer: A -
Which method is used to click multiple elements one by one?
A. multiple_click()
B. click_and_hold()
C. click() chained with perform()
D. build()
Answer: C -
What does build() do in ActionChains?
A. Compiles actions without executing
B. Executes actions
C. Stops actions
D. Clears action queue
Answer: A
No comments:
Post a Comment