def enter_text_textbox(self, locator, text):
ele = self.driver.find_element(*locator)
try:
logging.info("# Entering text in Textbox.")
ele.clear()
ele.send_keys(text)
return True
except NoSuchElementException:
return False
Here is a method enter_text_textbox which accepts locator and some text as parameters. I passed locator as something like this: self.email_field = (By.XPATH, "//input[@id='email']")
When I tried to get into this(self.driver.find_element(*locator)) method, it displayed
As from the image the methods contains parameters of ID only.
By running the test script(not displayed here), it worked perfectly fine. I want to know how does this method know if this locator is made by XPATH or ID or CSS i.e. How the starred expression works?