Actions Click

Use Selenium Actions class to move to the button and click it.

How to test
// Java
WebElement button = driver.findElement(By.id("actions_click_btn"));
new Actions(driver).moveToElement(button).click().perform();

# Python
button = driver.find_element(By.ID, "actions_click_btn")
ActionChains(driver).move_to_element(button).click().perform()

// Java - Full Test
WebElement reset = driver.findElement(By.id("actions_click_reset"));
reset.click();
WebElement button = driver.findElement(By.id("actions_click_btn"));
Actions actions = new Actions(driver);
actions.moveToElement(button).click().perform();
WebElement result = driver.findElement(By.id("actions_click_success"));
assert result.isDisplayed();
assert result.getText().contains("Actions click completed");

# Python - Full Test
driver.find_element(By.ID, "actions_click_reset").click()
button = driver.find_element(By.ID, "actions_click_btn")
ActionChains(driver).move_to_element(button).click().perform()
result = driver.find_element(By.ID, "actions_click_success")
assert result.is_displayed()
assert "Actions click completed" in result.text

// Java - Alternative Solution
new Actions(driver)
    .click(driver.findElement(By.id("actions_click_btn")))
    .perform();

# Python - Alternative Solution
ActionChains(driver).click(
    driver.find_element(By.ID, "actions_click_btn")
).perform()


Tester Task
  1. Locate the button using id actions_click_btn.
  2. Create a Selenium Actions object.
  3. Move to the button and click it using Actions.
  4. Verify actions_click_success is displayed.
  5. Verify the result contains Actions click completed.