You need to sign in to do that
Don't have an account?

Accessing Salesforce fields with Selenium
I'm trying to access the Search bar in Classic with Selenium but cannot seem to find the object. I've tried a few variants below, how do I access?
driver.findElement(By.name("str")).sendKeys("Hello");
driver.findElement(By.xpath("//*[@id='phSearchInput']")).sendKeys("Hello");
driver.findElement(By.id("phSearchInput")).sendKeys("Hello");
driver.findElement(By.name("str")).sendKeys("Hello");
driver.findElement(By.xpath("//*[@id='phSearchInput']")).sendKeys("Hello");
driver.findElement(By.id("phSearchInput")).sendKeys("Hello");
All Answers
driver.findElement(By.xpath("//*[@id=\'phSearchInput\']")).sendKeys("TEST");
driver.findElement(By.id("phSearchInput")).sendKeys("TEST");
driver.findElement(By.cssSelector("#phSearchInput")).sendKeys("Test");
Please let me know if this fixes the issue