WebDriver第二次在同一个提交按钮上单击Google Forms上的()

时间:2018-02-03 23:13:04

标签: forms selenium testing selenium-webdriver

我需要点击按钮才能进入Google表单的第二页,这是我的步骤。

  1. 提交表格(以确定答案是强制性的)
  2. 填写强制性问题
  3. 再次提交(使用相同的按钮)以进入第二页
  4. 提交按钮有效,但问题出在我第二次尝试提交时。我看到动画按钮被点击但没有任何反应。知道如何让它工作吗?

    // STEP 2 Validate that third question is mandatory
        driver.findElement(By.cssSelector("span.quantumWizButtonPaperbuttonLabel.exportLabel")).click();
        String errorTextActual = driver.findElement(By.xpath("//*[@id=\"i.err.1133270322\"]")).getText();
        assertEquals(errorTextExpected, errorTextActual);
    
    // STEP 3 Fill third question and go to another step
        driver.findElement(By.xpath("/html/body/div/div[2]/form/div/div[2]/div[2]/div[3]/div[2]/div/div[1]/div/div[1]/input")).sendKeys(thisMonth);
        driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
        driver.findElement(By.cssSelector("span.quantumWizButtonPaperbuttonLabel.exportLabel")).submit();
    

    提交按钮

    <div role="button" class="quantumWizButtonPaperbuttonEl quantumWizButtonPaperbuttonFlat quantumWizButtonPaperbutton2El2 freebirdFormviewerViewNavigationNoSubmitButton isUndragged" jscontroller="VXdfxd" jsaction="click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef;" jsshadow="" jsname="OCpkoe" aria-disabled="false" tabindex="0"><div class="quantumWizButtonPaperbuttonRipple exportInk" jsname="ksKsZd"></div><div class="quantumWizButtonPaperbuttonFocusOverlay exportOverlay"></div><content class="quantumWizButtonPaperbuttonContent"><span class="quantumWizButtonPaperbuttonLabel exportLabel">Další</span></content></div>
    

0 个答案:

没有答案