title: Get child element programmatically selenium c#
body: <p>What I am trying to achieve is to programmatically open the first video on the web page which is enabled and displayed. I am getting the video elements by using Xpath search method and clicking on the first one available. What I want to achieve is to open that divider(video element) and inside of it search for another divider but specifically that one inside of the divider I already clicked on.</p>
  
  <p>This is how I am trying to do it now:</p>
  
  <pre><code> public void ClickOnTheProperty()
      {
          var isClicked = false;
  
          var properties = Driver.FindElements(By.XPath("//div[contains(@class, 'col-md-3 col-sm-3')]"));
          for (var i = 0; i &lt; properties.Count; i++)
          {
              if (properties[i].Enabled &amp;&amp; properties[i].Displayed)
              {
                  var smallContainer =
                      properties[i].FindElements(By.XPath("//div[contains(@class, 'miniature lightingshow')]"));
                  for (var j = 0; j &lt; smallContainer.Count; j++)
                  {
                      if (smallContainer[j].Displayed &amp;&amp; smallContainer[j].Enabled)
                      {
                          var js = (IJavaScriptExecutor) Driver;
                          js.ExecuteScript("arguments[0].click()", smallContainer[i]);
                          isClicked = true;
                          break;
                      }
                  }
              }
          }
          if (!isClicked)
          {
              throw new Exception("No property found");
          }
      }
  </code></pre>
  
  <p>Any suggestions? If you cannot understand what my problem is , or I did not explain very well, I will try to answer all the questions you need additionally. </p>