Hi,
I need help with hover menus. I’m using following code to select menu called dashboard (This is a submenu under Actions->Edit->Details->Dashboard
We have to click Action to open the menu and then mouse over the Edit and Edit Details and then click the Dashboard. This works fine on my machine (chrome headless) but intermittently fails when I run in Jenkins Chrome headless. Please help! Thanks
When it fails I get an errors like the following:
“Unable to move mouse over object 'Object Repository/Edit/li_edit_details”
“Unable to move mouse over object 'Object Repository/Edit/li_edit”
“Unable to click object 'Object Repository/Edit/div_dashboard”
// Select Actions (This needs to be clicked)
WebUI.click(findTestObject(‘CommonLocators/actions’))
// Mouse over ‘Edit’
WebUI.mouseOver(findTestObject(‘Edit/li_edit’), FailureHandling.CONTINUE_ON_FAILURE)
// Mouse over ‘Details’
WebUI.mouseOver(findTestObject(‘Edit/li_edit_details’), FailureHandling.CONTINUE_ON_FAILURE)
I think you would be better if you put in some wait statements to ensure your object in on the page and is enabled, such as:
WebUI.waitForElementVisible(findTestObject('CommonLocators/actions'), 10)
WebUI.verifyElementClickable(findTestObject('CommonLocators/actions'))
// Select Actions (This needs to be clicked)
WebUI.click(findTestObject('CommonLocators/actions'))
WebUI.waitForPageLoad(10)
WebUI.waitForElementVisible(findTestObject('Edit/li_edit'), 10)
WebUI.verifyElementVisible(findTestObject('Edit/li_edit'))
// Mouse over ‘Edit’
WebUI.mouseOver(findTestObject('Edit/li_edit'))
// now you should be good for the rest of this page
// Mouse over ‘Details’
WebUI.mouseOver(findTestObject('Edit/li_edit_details'), FailureHandling.CONTINUE_ON_FAILURE)
// Click Dashboard option
WebUI.mouseOver(findTestObject('Edit/div_dashboard'), FailureHandling.CONTINUE_ON_FAILURE)
WebUI.focus(findTestObject('Edit/div_dashboard'), FailureHandling.CONTINUE_ON_FAILURE)
WebUI.click(findTestObject('Edit/div_dashboard'), FailureHandling.CONTINUE_ON_FAILURE)