title: Can I use Selenium WebDriverWait to wait for xpath relative to a known web element?
body: <p>Our application makes use of a generic drop down "Actions" button that looks like:</p>
  
  <pre><code>&lt;div class="button dropdown petrocore-actions"&gt;
  Actions
  &lt;ul class="no-hover" style="top: 30px;"&gt;
    &lt;li&gt;
      &lt;a href="javascript:void(0)" onclick="OpenCreateGroupDialog('4')" data-selection="create"&gt;Create Group&lt;/a&gt;
        &lt;/li&gt;
    &lt;li&gt;
      &lt;a id="lnkDelGroup_4" href="javascript:void(0)" onclick="ConfirmGroupDeletion('4')" data-selection="delete"&gt;Delete Group&lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a href="javascript:void(0)" onclick="OpenRenameGroupDialog('4')" data-selection="rename"&gt;Edit Group Name&lt;/a&gt;
    &lt;/li&gt;
    &lt;li&gt;
      &lt;a href="javascript: Navigate('link', '/groupadmin/4')" data-selection="view"&gt;View Group&lt;/a&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>
  This button can be contained by any number of different types of objects within our application. The container object type will dictate the structure of the container div, where the actions button will sit relative to the container object and what the li contents of the drop down menu are.</p>
  
  <p>I have created a page object class to represent this drop down button to encapsulate interactions like expanding/collapsing the menu, returning its contents, clicking on one of its selections ...etc. The actions button class constructor takes a Selenium WebElement for the container of the button. When the button is clicked to be expanded I would like to use <code>WebDriverWait.Until(ExpectedConditions.ElementExists(By.Xpath(&lt;xpath relative to container WebElement&gt;)))</code> but I can only figure out how to use an xpath for the entire DOM which may contain any number of these action buttons which are only identifiable by there container type and ID.</p>
  
  <p>I have run into other situations where I want to set up a WebDriverWait for xpath relative to a known webelement as well. I am quite new to working with Selenium and C# programming for that matter. Thanks for your time and consideration on this question.</p>