Cant sendKeys into ebay username field using WebDriver Selenium 3 with Java and chrome
I have been unable to sendKeys text into the username and password field on ebay.
Here is the code:
WebDriver driver = null; System.setProperty("webdriver.chrome.driver", "/usr/local/bin/chromedriver"); driver = new ChromeDriver(); driver.get("http://www.ebay.co.uk"); WebElement myEbay = driver.findElement(By.linkText("My eBay")); myEbay.click(); WebElement signInForm = driver.findElement(By.id("SignInForm")); if (signInForm.isDisplayed()) System.out.println("Sign in form is displayed"); WebElement username; username = driver.findElement(By.cssSelector("input[placeholder="Email or username"]"));
It manages to find the My Ebay link, and verifies that the sign in form exists but the the username and password fields id’s change after every refresh of the page.
The username cssSelector seems to be the problem??
RE: Keyboard is not visible when typing a string in a text field By akvenk - on June 22, 2018
Disable "Connect Hardware Keyboard' option in your iOS simulator and try running your scripts. Steps in this video: https://www.youtube.com/watch?v=jA0aT24kL-8
RE: Best and easiest way to customize a GUI in Matlab? By Melvinchunter - on June 20, 2018
GUIs give point-and-click control of programming applications, disposing of the need to take in a language or sort commands keeping...
This generally looks like a visual testing task. Are you limited to Selenium only? In case there is an option for you to try something else for this task, you could do that with a visual regression testing tool. Such as Screenster which is actually an alternative to Selenium for visual/CSS testing tasks.
Screenster is a test automation tool which performs screenshot-based comparison of different versions of your web pages. First it creates a visual baseline for a page, taking a screenshot for each user action. During the next run it takes a new screenshot at each step, compares it with the one from baseline and highlights differences. It also has a number of features for easy maintenance of tests: here is how it handles regression testing of Gmail UI.