camelCase
camelCase

Reputation: 61

Selenium Automation on Safari Browser , javascript:onClick event is not working on Safari browser

Below is my setup for automation on Safari Browser for an internal web Application.

selenium-safari-driver-2.53.0.jar added Safari Web Driver extension 2.48.0

Am able to launch my application successfully , but am stuck on calling a javascript function , onClick on a button image is not working

Button html code:

<input onclick="search.viewJournal('','','multiple','preview');" name="0.31.0.9.23" border="0" type="image" src="ntf/images/en_xyz/BtnPreview.gif">

I tried doing

@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');");

}

Both of the above options didn't work, I see there is no event fired on executing above code.

Upvotes: 0

Views: 935

Answers (1)

camelCase
camelCase

Reputation: 61

On debugging the javascript code found that function was actually getting called . By default safari browser "Block Pop Up Window was" checked , on unchecking was able to call window.open() successfully .

Upvotes: 1

Related Questions