Всем привет,
такой вопрос, не могу понять, почему отправляются и откуда вообще взялись лишние нолики при заполнении текстового поля через .sendKeys()
Firefox 55.0.2
Selenium 3.5.2
Geckodriver 0.18
OS Ubuntu 16.04
Code for start driver:
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("browser.download.dir", downloadDir);
profile.setPreference("browser.download.folderList", 2);
profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/force-download,application/x-rpm");
System.setProperty("webdriver.gecko.driver", "/usr/lib/firefox/geckodriver");
FirefoxOptions options = new FirefoxOptions();
options.setProfile(profile);
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("moz:firefoxOptions", options);
driver = new FirefoxDriver(capabilities);
Code for test:
findElement(USERNAME).clear();
log("Sending username: " + userName); // for example, userName "admin"
findElement(USERNAME).sendKeys(userName);
log("From page: " + findElement(USERNAME).getAttribute("value"));
after start it successfully open browser, found login form, but insert 0admin00 instead of admin - это видно прямо в браузере
а при считывании обратно из этог текстового поля получает 0admin0 , т.е. снова не то, ни то, что хотели отправить, ни то, что он записал
log:
LoginPage.info() - Searching element by locator: username
UITestBase.log() - Sending username: admin
LoginPage.info() - Searching element by locator: username
LoginPage.info() - Searching element by locator: username
UITestBase.log() - From page: 0admin0