My current automation setup is for Safari Browser on an internal web Application.
Included in my setup are the selenium-safari-driver-2.53.0.jar and Safari Web Driver extension 2.48.0
I can successfully launch my application, but I'm facing a challenge when trying to call a JavaScript function, specifically onClick
on a button image that is not functioning as expected.
The HTML code of the button is:
<input onclick="search.viewJournal('','','multiple','preview');" name="0.31.0.9.23" border="0" type="image" src="ntf/images/en_xyz/BtnPreview.gif">
I have attempted two methods:
@Find(By.xpath('path to button'))
WebElement previewBtn
public void clickOnPreview(){
previewBtn.click();
}
public void clickOnPreview(){
JavascriptExecutor executor = (JavascriptExecutor) driver;
executor.executeScript("search.viewJournal('','','multiple','preview');");
}
Unfortunately, neither option worked, as no event was triggered upon executing the above code.