Using Selenium (Python), how do we pass the By object to findElement()?
Java (this works)
By locater = By.id("username")
WebElement elem = driver.findElement(locater)
elem.SendKeys("tester")
Python (this fails)
locater = By.id("username")
elem = driver.find_element(locater)
elem.send_keys("tester")
Error i get in python is 'str' object is not callable.
I looked this up in other SO conversations and its because python expects something like By.ID or By.XPATH etc.
I need a way to pass the By object and wondered it it is possible. Thanks in advance.