title: Determine the number of of common element locator in Selenium
body: <p>I am trying to dynamically select an element using a for loop. In order for me to determine the range, I need to know the count of the elements, how do I do this in selenium (python). Do i need to execute a javascript for this?</p>
  
  <pre><code># count = how??
  
  for i in range(1, count): #element index start at 1
          xpath = '//div[@class="form-group"]/select/option['+str(i)+']'
          if self.find_elements_by_xpath(xpath).text == driver_name:
              self.find_elements_by_xpath(xpath).click()
  </code></pre>