Reputation: 302
<span class="allMnuHdr">Marketing</span>
<a href="index.php?module=Campaigns&action=index&parenttab=Marketing" class="allMnu">Campaigns</a>
<a href="index.php?module=Accounts&action=index&parenttab=Marketing" class="allMnu">Accounts</a>
<a href="index.php?module=Contacts&action=index&parenttab=Marketing" class="allMnu">Contacts</a>
<a href="index.php?module=Webmails&action=index&parenttab=Marketing" class="allMnu">Webmail</a>
I am trying to click a link within a link. In this case, when I hover the mouse on the link, I'll see a list of links & I want to click on one of those. I've tried many a few things, but no luck.
From the above HTML code, you can see "Marketing" is a parent link & it has some more links within. I want to click on "Accounts" after hovering the mouse on "Marketing".
I've tried getRoproperty("allitems")
method & that doesn't return anything. While I record the script, I can see the reference to child link as below:
Browser("admin - My Home Page -").Page("admin - My Home Page -").Link("Accounts").Click
Object spy utility can't be used as links are displayed only when mouse cursor is hovered. Post recording, OR shows accounts as link. I can't get this working using dynamic scripting. Can you please suggest an approach this can be worked in UFT?
Upvotes: 0
Views: 771
Reputation: 114695
You need to cause the Marketing link to display the other links, unfortunately UFT's Link
object doesn't have a Hover
function.
Does clicking on Marketing work as well as hovering? (How does it work on mobile devices?).
If not you can try using FireEvent
with "mouseover"
to try to simulate the event.
Upvotes: 1