I am currently working on automating a Pega Web application using a script. I have implemented button click functionality, but for some reason, the button is not being clicked when I run the script. The logs indicate that the action was performed, but the button remains unclicked.
I have attempted various solutions without success, such as:
WebDriverWait wait = new WebDriverWait(driver, 80);
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//button[contains(text(),'Submit')]")));
driver.findElement(By.xpath("//button[contains(text(),'Submit')]")).click();
Afterwards, I tried another approach:
WebDriverWait wait = new WebDriverWait(driver, 80);
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//button[contains(text(),'Submit')]")));
WebElement button=driver.findElement(By.xpath("//button[contains(text(),'Submit')]"));
button.sendKeys(Keys.RETURN);
I also experimented with JavaScript:
JavascriptExecutor jse = (JavascriptExecutor) driver;
jse.executeScript("arguments[0].click();", button);