0

I have a unique requirement where I need to click on an object when the browser is zoomed out to 45%. Standard obj interaction doesnot work in selenium because the objects cant be viewed well in browser zoomed out state. Here are all things I tried

  1. using selenium webdriver - clicking on popup with default button (Confirm) to be clicked so that default sendkeys can be sent

    driver.findElement(By.xpath("//div[@ng-if='matchClass']")).click();

  2. using selenium webdriver - Sending keys to active element.

    driver.switchTo().activeElement().sendKeys(Keys.RETURN);

  3. using selenium webdriver - Sending keys to active element.

    driver.switchTo().activeElement().sendKeys(Keys.ENTER);

  4. using selenium webdriver - Clicking on confirm button.

    driver.findElement(By.xpath("//div[@class='modal-content']//button[contains(text(),'Confirm')]")).click();

  5. using selenium webdriver - click on 'Confirm' button through javascript executor

    WebElement 'Confirm'= driver.findElement(By.xpath("//div[@class='modal-content']//button[contains(text(),'Confirm')]"));
    JavascriptExecutor js1 = (JavascriptExecutor) driver;
    js1.executeScript("arguments[0].doubleClick();", 'Confirm')

  6. Using SendKeys

    SendKeys (Keys.ENTER)

  7. used robot class to send keys, did not work.

I tried everything I possibly could. I cant zoom in and perform action because that will make other threads looking at other objects on the page fail, thus failing threads. Is there a solution that enables the user to send keyboard inputs without using object references and just sendkeys in java?

vinS
  • 1,417
  • 5
  • 24
  • 37
Raghu
  • 1
  • 2

0 Answers0