Clicking a hidden menu button.

3 posts, 1 answers
  1. SD
    SD avatar
    62 posts
    Member since:
    Apr 2010

    Posted 28 May 2010 Link to this post

    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. Answer
    Missing user
    Missing user avatar

    Posted 28 May 2010 Link to this post

    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.
  3. SD
    SD avatar
    62 posts
    Member since:
    Apr 2010

    Posted 30 May 2010 Link to this post

    Ta Nelson.
    Your sample handles that situation as expected. 

    SD. 
Back to Top