Selenium JS sendKeys 2 или более входов - PullRequest
0 голосов
/ 22 марта 2019

Я пытаюсь зайти на сайт (Instagram) со следующим кодом:

driver.wait(selenium.until.elementLocated(selenium.By.name(loginForm.user))).then(function (userID) {
        driver.wait(selenium.until.elementLocated(selenium.By.name(loginForm.password))).then(function (pwd) {
            pwd.sendKeys(password);
            userID.sendKeys(name);
            pwd.submit();
            driver.wait(selenium.until.elementLocated(selenium.By.className('GAMXX'))).then(function (popupSave) {
                popupSave.click();
                next();
            })
        });
    });

Я тоже пытался:

 driver.wait(selenium.until.elementLocated(selenium.By.name(loginForm.user))).then(function (userID) {
        userID.sendKeys(name);
        driver.wait(selenium.until.elementLocated(selenium.By.name(loginForm.password))).then(function (pwd) {
            pwd.sendKeys(password);
            pwd.submit();
            driver.wait(selenium.until.elementLocated(selenium.By.className('GAMXX'))).then(function (popupSave) {
                popupSave.click();
                next();
            })
        });
    });

И результат введите описание изображения здесь Первый ввод напечатан и удален

Я попробую с / без обещания, добавив selenium.Key.TAB и не работает.Любые подсказки?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...