This is a migrated thread and some comments may be shown as answers.

Clicking a hidden menu button.

2 Answers 131 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
SD
Top achievements
Rank 1
SD asked on 28 May 2010, 08:10 AM
Hi Guys,

I've got a menu button which will only 'revel' itself once you hover about the text ('Search'). 
Hovering above search will show 'General Search' that can be clicked to move to the relevant page. 

I'm already using declarations like  Manager.ActiveBrowser.Find.ByName<HtmlInputSubmit>("submit").Click(); 
and was wondering what is the appropriate element to use in my case. 
Ta,
SD. 

<div id="menuForm:searchMenu"  class="dr-menu-label rich-ddmenu-label dr-menu-label-unselect rich-ddmenu-label-unselect" > 
<span id="menuForm:searchMenu_span"  class="dr-label-text-decor rich-label-text-decor" >Search</span> 
<div style="border: 0px none ; margin: 0px; padding: 0px; position: relative; z-index: 100;" > 
<div id="menuForm:searchMenu_menu"  class="dr-menu-list-border rich-menu-list-border"  style="visibility: hidden; z-index: 2; left: -6px; top: 3px; width: 150px;" > 
<div class="dr-menu-list-bg rich-menu-list-bg" > 
<div id="menuForm:_id28"  class="dr-menu-item rich-menu-item dr-menu-item-enabled rich-menu-item-enabled"  onmouseup="Event.stop(event); "  onclick="; ;"  style="" > 
<span id="menuForm:_id28:icon"  class="dr-menu-icon rich-menu-item-icon" > 
<img height="16"  width="16"  src="/webInt/spring/a4j_3_1_6.GAimages/spacer.gif" /> 
</span> 
<span id="menuForm:_id28:anchor"  class="rich-menu-item-label" > 
<id="menuForm:generalSearch"  onclick="clearFormHiddenParams_menuForm('menuForm');document.forms['menuForm']['menuForm:_idcl'].value='menuForm:generalSearch'; document.forms['menuForm'].submit(); return false;"  href="#" > 
General Search 
<script type="text/javascript" ></script
</a> 
</span> 
</div> 
<div class="dr-menu-list-strut rich-menu-list-strut" ></div
</div> 
</div> 
<script id="menuForm:searchMenu_menu_script"  type="text/javascript" ></script
</div> 
</div> 

2 Answers, 1 is accepted

Sort by
0
Accepted
Missing User
answered on 28 May 2010, 10:51 PM
Hello SD,

Based on your code, please try:

Manager.ActiveBrowser.Find.ByContent<HtmlSpan>("Search").MouseHover();

System.Threading.Thread.Sleep(5000);

Manager.ActiveBrowser.RefreshDomTree();

Manager.ActiveBrowser.Find.ByContent<HtmlAnchor>("General Search").Click();

All the best,
Nelson Sin
the Telerik team


Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
SD
Top achievements
Rank 1
answered on 31 May 2010, 01:53 AM
Ta Nelson.
Your sample handles that situation as expected. 

SD. 
Tags
General Discussions
Asked by
SD
Top achievements
Rank 1
Answers by
Missing User
SD
Top achievements
Rank 1
Share this question
or