0

I am passing input to rich text field. For that I have written the code below:

public void inputToDescriptionField() throws InterruptedException   , AWTException
{
    
    wait.until(ExpectedConditions.elementToBeClickable(descriptionField));
    Actions a = new Actions(driver);
    a.moveToElement(descriptionField).click().build().perform();        

    Robot r = new Robot();
    String text = "Program Description";
    StringSelection stringSelection = new StringSelection(text);
    Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
     clipboard.setContents(stringSelection, stringSelection);
        
       r.keyPress(KeyEvent.VK_CONTROL);
       r.keyPress(KeyEvent.VK_V);
       r.keyRelease(KeyEvent.VK_V);
       r.keyRelease(KeyEvent.VK_CONTROL);

but I am getting the error move target out of bounds

1
  • Could you please edit your question to include the HTML of the rich text field? The target out of bounds error suggests that there could be an issue with the element's availability.
    – Kate Paulk
    Commented Mar 8, 2023 at 13:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.