Selenium webdriver 汇流创建按钮

Selenium webdriver 汇流创建按钮,selenium-webdriver,confluence,Selenium Webdriver,Confluence,我正在与Selenium合流创建一个新页面。 但是,单击“创建”后,我无法单击“发送创建”按钮 driver.findElement(By.id("create-page-button")).click(); driver.findElement(By.xpath("//div[@id='create-dialog']/div/div[2]/button")).click(); driver.findElement(By.id("content_title")).sendKeys("Test C

我正在与Selenium合流创建一个新页面。 但是,单击“创建”后,我无法单击“发送创建”按钮

driver.findElement(By.id("create-page-button")).click();
driver.findElement(By.xpath("//div[@id='create-dialog']/div/div[2]/button")).click();
driver.findElement(By.id("content_title")).sendKeys("Test Case 1");
driver.findElement(By.id("rte-button-publish")).click();
下面的代码错误:

Unable to locate element: {"method":"id","selector":"content_title"}

由于新页面尚未创建。

这是为我自己创建页面所需的:

    driver.findElement(By.id("create-page-button")).click();

    (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() {
        public Boolean apply(WebDriver d) {
            return d.findElement(By.xpath("//*[@id='create-dialog']/div/div[2]/button")).getText().equals("Create");
        }
    });

    driver.findElement(By.xpath("//*[@id='create-dialog']/div/div[2]/button")).click();
    driver.findElement(By.xpath("//*[@id='content-title']")).sendKeys("My Test Page");
    driver.findElement(By.id("rte-button-publish")).click();
我尝试使用By.id作为内容标题输入框,但没有成功,错误与您收到的错误相同,但使用xpath成功

此外,还添加了NewDriverWait,因为该对话框已加载,如果您单击“创建”按钮太快,它实际上将是下一个按钮,这将导致页面无法创建