internet explorer 10 - selenium-webdriver issues triggering hover via move_to_element on ie10 -
i'm using remote webdriver test different configurations on saucelabs. 1 of pages has ajax function loads extended form section. load triggered either blur of particular form element, or if hovers on .form-actions div. i'm trying re-create behaviour through webdriver.
the following behaves expected on ie9 , chrome (the second part of form loads), stops working on ie10:
nxt_btn = self.sel.find_element_by_css_selector( next_btn_selector) actionchains(self.sel).move_to_element(nxt_btn).perform() self.wait_until_visible('input[name="next_to_load"]')
the form expands correctly if bring ie10 browser , move mouse in manual testing, seems it's remove webdriver isn't triggering either 'blur' of input or 'hover' on form-actions div.
is there way can change either webdriver test code or site make work ie10?
when ran tests on ie (ie11, in case), hovering worked fine (locally) code
hover = actionchains(self.browser).move_to_element(elem) hover.perform()
when ran on saucelabs, no luck. implemented in javascript (using code found here). ended doing this
def hover_over(self, params): if self.driver.desired_capabilities['browsername'] in ['safari', 'internet explorer']: print "javascript hovering on = " + params['menu'] self.js_hover_over(params ) else: print "std hovering on = " + params['menu'] self.std_hover_over(params) def js_hover_over(self, params): js_script = ''.join(["var elem = document.getelementbyid('", params['menu'], "');", "if (document.createevent) {", "var evobj = document.createevent('mouseevents');", "evobj.initevent('mouseover', true, false);", "elem.dispatchevent(evobj);", "} else if (document.createeventobject) {", "elem.fireevent('onmouseover');", "}"]) self.driver.execute_script(js_script) def std_hover_over(self, params): elem =self.driver.find_element_by_id(params['menu']) hover = actionchains(self.browser).move_to_element(elem) hover.perform()
Comments
Post a Comment