internet explorer - Single click in selenium acts as double click -


i have simple code click on link , opens new window. while executing script, single click acts double click on same element , 2 windows opened.

i using internetexplorer driver

string baseurl = "url_to_opened";  desiredcapabilities cap = desiredcapabilities.internetexplorer();  cap.setcapability(internetexplorerdriver.native_events, false);  cap.setcapability(internetexplorerdriver.introduce_flakiness_by_ignoring_security_domains,true);   webdriver driver = new internetexplorerdriver(cap);  driver.get(baseurl);  driver.findelement(by.xpath("element clicked")).click(); 

here answer question:

when work selenium 3.4.0, iedriverserver 3.4.0 ie(v 10/11), may consider passing following configuration properties through desiredcapabilities class:

native events: internetexplorerdriver windows-only, attempts use so-called "native", or os-level events perform mouse , keyboard operations in browser. in contrast using simulated javascript events same operations. advantage of using native events not rely on javascript sandbox, , ensures proper javascript event propagation within browser. however, there issues mouse events when ie browser window not have focus, , when attempting hover on elements.

browser focus:the challenge ie appears not respect windows messages send ie browser window (wm_mousedown , wm_mouseup) if window doesn't have focus. specifically, element being clicked on receive focus window around it, click not processed element. arguably, shouldn't sending messages @ all; rather, should using sendinput() api, api explicitly requires window have focus.

you can find more documentation these facts in link.

desiredcapabilities cap = desiredcapabilities.internetexplorer(); cap.setcapability(internetexplorerdriver.native_events, true); cap.setcapability(internetexplorerdriver.requirewindowfocus, true); cap.setcapability(internetexplorerdriver.introduce_flakiness_by_ignoring_security_domains,true); webdriver driver = new internetexplorerdriver(cap); 

let me know if answers question.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -