1

I'm facing a problem double clicking an element on Safari using Java / Webdriver 2.48.

The tests are working fine on IE, Chrome, and Firefox but Actions are not supported on Safari. Currently I'm doing something like this

executor.executeScript("arguments[0].dblclick();", element);

or

executor.executeScript("arguments[0].dblclick;", element);

but is not working. Here is the error

arguments[0].dblclick is not a function. (In 'arguments[0].dblclick()', 'arguments[0].dblclick' is undefined) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 35 milliseconds Build info: version: '2.48.0', revision: 'b7b081a4f1289f17e8ecd38bc67e137c2a12e34a', time: '2015-10-07 09:50:14' System info: host: 'MacBook-Pro.local', ip: '10.0.1.7', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11', java.version: '1.8.0_25' Driver info: org.openqa.selenium.safari.SafariDriver Capabilities [{browserName=safari, takesScreenshot=true, javascriptEnabled=true, version=9.0, cssSelectorsEnabled=true, platform=MAC, secureSsl=true}] Session ID: null

I tried with dblclick and ondblclick but the double click was not executed, see the previous error.

1

1 Answer 1

0

I was able to fix the issue using the following code

It works on Safari

var event = new MouseEvent('dblclick', {
'view': window,
'bubbles': true,
'cancelable': true
});

 document.querySelector("div[id='InProcessGrid']>div>table>tbody>tr.rowselected>td:nth-child(1)").dispatchEvent(event);

Here is more info about the issue

https://github.com/webdriverio/webdriverio/issues/231

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.