我在使用moveToElement自动执行由Google帐户创建的测试时遇到问题

时间:2019-10-29 16:29:48

标签: selenium-chromedriver

我尝试创建一个供个人使用的Google帐户,但单击“为我自己”按钮不起作用。

webdriver.get("http://mail.google.com");
        WebElement createAccountGoogle = webdriver.findElement(By.xpath(".//span[@class='NlWrkb snByac']"));
        createAccountGoogle.click();
        WebElement createAccountGoogleForMe = webdriver.findElement(By.xpath(".//div[@jsname='RZzeR']//div[@class=\"jO7h3c\"]"));
        Actions builder = new Actions(webdriver);
        builder.moveToElement(createAccountGoogleForMe).click(createAccountGoogleForMe);
        Action mouseoverAndClick = builder.build();
        mouseoverAndClick.perform();
        builder.moveToElement(createAccountGoogleForMe).click();

0 个答案:

没有答案