Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double click does not work with Firefox / Marionette #77

Closed
bhecquet opened this issue Jan 19, 2018 · 2 comments
Closed

Double click does not work with Firefox / Marionette #77

bhecquet opened this issue Jan 19, 2018 · 2 comments

Comments

@bhecquet
Copy link
Owner

Due to mozilla/geckodriver#661
This is corrected in Firefox 59 but we cannot wait until that version

See workaround

private void doubleClickWithJavascript(WebElement element) { String jsCode = "var evObj = new MouseEvent('dblclick', {bubbles: true, cancelable: true, view: window});"; jsCode += " arguments[0].dispatchEvent(evObj);"; driver.executeScript(jsCode, element); }

workaround should be possible on a per-method / per browser version basis

  • get driver version from capabilities
  • create a workaround object which defines methods that could be rewritten spcifically for a browser version
    In HTMLElementclass, add a IF when some workaround has to be added (e.g: call javascript instead of native call)
@lbottoni
Copy link

lbottoni commented Mar 15, 2018

i have created a @Keyword in Katalon, but work only with chrome

`
@Keyword
def doubleClickWithJavascript(TestObject element) {
String jsCode = "var evObj = new MouseEvent('dblclick', {bubbles: true, cancelable: true, view: window});";
jsCode += " arguments[0].dispatchEvent(evObj);";

	WebElement webel = WebUiCommonHelper.findWebElement(element,30);
	WebUI.executeJavaScript(jsCode, Arrays.asList(webel))
	
}

`

this work on IE, FF e Chrome
String script = "if(document.createEvent){var evObj = document.createEvent('MouseEvents');evObj.initEvent('dblclick', true, false); arguments[0].dispatchEvent(evObj);} else if(document.createEventObject) { arguments[0].fireEvent('ondblclick');}";

@bhecquet
Copy link
Owner Author

Thanks for the tip

@bhecquet bhecquet closed this as completed Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants