How to select the item in a context menu which doesn't have a underline

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to select the item in a context menu which doesn't have a underline

tulsi.tester
Hi All,

I am right clicking on a link which populates context menu with different menu items. The menu items doesn't have any underlined letters to select that menu item. Please let me know how to proceed this.

The following is the source code for the context menu item 'New Folder'. Also find the screen shotrightClick.jpg

<td width="100%" nowrap="" style="font-family: Arial, Helvetica, sans-serif, verdana; font-size: 11px; font-style: normal; padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; cursor: pointer; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 247); color: rgb(102, 102, 102); background-position: initial initial; background-repeat: initial initial; " title="New Folder" onmouseover="this.style.background='#669966';this.style.color='white';" onmouseout="this.style.background='#FFFFF7';this.style.color='#666666';" onclick="var clickEvent = document.createEvent ('MouseEvent');clickEvent.initMouseEvent ('click', true, true, window, 0,0, null);parent.document.dispatchEvent(clickEvent);parent.addNewFolder('5','no');">New Folder
Reply | Threaded
Open this post in threaded view
|

Re: How to select the item in a context menu which doesn't have a underline

softwaretestingforum
Administrator
I had come across such issues in past and combination of mouse down/up and click key worked for me.
So if you are able to bring up the context menu then try mouse down/up followed by click on the element.
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: How to select the item in a context menu which doesn't have a underline

tulsi.tester
Hi Tarun,

Do i need to perform the following operation

1. sel.contexMenu(locator)
2. sel.mouseDown(locator)
3. sel.mouseUp(locator)
4. sel. click(locator)

Please confirm. If it so, it doesn't works for me.
Reply | Threaded
Open this post in threaded view
|

Re: How to select the item in a context menu which doesn't have a underline

softwaretestingforum
Administrator
Can you use -

selenium.highlight(locator)

before final click method -

selenium.click(locator)

Just to see if Selenium can highlight it and bring control on it
~ seleniumtests.com