0

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.

Cosmin
  • 2,354
  • 2
  • 22
  • 39
camelCase
  • 61
  • 5
  • 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 . – camelCase Oct 04 '16 at 04:44

1 Answers1

1

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 .

camelCase
  • 61
  • 5