Mouse hover and Click in IE 11 is not working

Script goes and mouse hover on the first element. Before it clicks on the second element hover menu goes away.

Same works fine in Chrome

Windows 7
IE 11
Version: 5.10.1

WebUI.mouseOver(findTestObject('TAS/Page_Transportation Asset System -/mnu_Menu1'))

WebUI.waitForElementClickable(findTestObject('TAS/Page_Transportation Asset System -/mnu_Menu2'), 10)

WebUI.click(findTestObject('TAS/Page_Transportation Asset System -/mnu_Menu2'))

Logs:
(Root cause: org.openqa.selenium.ElementNotInteractableException: Cannot click on element
Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

I had tried to setup the IE based on this one(https://docs.katalon.com/katalon-studio/docs/internet-explorer-configurations.html)

I tried to add the desired capabilities settings. Still it dint work.

Please help

You can try being a little more robust (and pedantic) about waiting until the element is “ready”. As well as using waitForElementClickable try adding present and visible first:

def menu2 = findTestObject('TAS/Page_Transportation Asset System -/mnu_Menu2')
WebUI.waitForElementPresent(menu2, 10)
WebUI.waitForElementVisible(menu2, 10)
WebUI.waitForElementClickable(menu2, 10)

Different browsers take differing amounts of time to render HTML to the visible page. If you need to test on various browsers, your test interactions need to take account of that difference.

If the above doesn’t improve matters, post back. And this time, please post the ENTIRE error message.

I tried with the above suggestion. Still the same issue.

Test Cases/TAS_SI FAILED.

Reason:

com.kms.katalon.core.exception.StepFailedException: Unable to click on object ‘Object Repository/TAS/Page_ Asset System -/mnu_Menu2’ (Root cause: org.openqa.selenium.ElementNotInteractableException: Cannot click on element

Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

System info: host: ‘W0000000’, ip: ‘1.1.0.106’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_181’

Driver info: com.kms.katalon.selenium.driver.CInternetExplorerDriver

Capabilities {acceptInsecureCerts: false, browserName: internet explorer, browserVersion: 11, javascriptEnabled: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, se:ieOptions: {browserAttachTimeout: 0, elementScrollBehavior: 0, enablePersistentHover: false, ie.browserCommandLineSwitches: , ie.ensureCleanSession: false, ie.fileUploadDialogTimeout: 3000, ie.forceCreateProcessApi: false, ignoreProtectedModeSettings: true, ignoreZoomSetting: true, initialBrowserUrl: http://localhost:34061/, nativeEvents: true, requireWindowFocus: false}, setWindowRect: true}

Session ID: 8b7f335a-5752-4bf7-842e-edabb6578831)

at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:36)

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:65)

at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:27)

at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.click(ClickKeyword.groovy:86)

at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:67)

at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:53)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:616)

at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$3.call(Unknown Source)

at TAS_SI.run(TAS_SI:34)

at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)

at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)

at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:328)

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:319)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:298)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:290)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:224)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:106)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:97)

at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)

at TempTestCase1547847430462.run(TempTestCase1547847430462.groovy:22)

The IE driver is convinced the element in question is not interactable. I’m assuming that you could perform the action yourself (by hand) and it would work… right?

(I hate IE - glad it’s finally dying some time this year). :skull:

Yes, if I do the mouse hover by hand the click operations works.

Hi @sudarson95

Can you try to click and hold, as per the following post suggests ?

I think maybe since you’re trying to click on a menu, this StackOverflow answer’s direction may solve it, hence the above suggestion doing the same thing in Katalon Studio.

Thanks!! it worked. Here is my code,

Actions myActions = new Actions(driver)
myActions.clickAndHold(menu1).build().perform()
myActions.moveToElement(menu2).click().build().perform()

Also the pointer should be moved out of IE.

1 Like

Hi, I have the issue that I want to run the test case in which this should hover on the button so, it will become visible and then click. I tried using ‘Rightclickoffset’ but it didn’t help.

I have similar symptoms on IE and was able to workaround this with using the Send Keys instead of Click.

Example:
WebUI.sendKeys(findTestObject(‘YourObject’),
Keys.chord(Keys.ENTER))

Try with this:
Check if object Element is present and then Send Keys on the object instead of Click on the object.

1 Like