<button class="add-school btnEditDashboard btn btn-primary pull-right" ng-click="CreateNewSchool()" name="AddSchool" type="submit">Add School</button>
也尝试过xpath。(\\html/body/div[2]/div/div[2]/div/div/div[1]/div/div[2]/button
)
Exception in thread "main" org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"tag name","selector":"AddSchool"}
尝试使用此代码:
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(By.xpath("//button[text()='Add School' and @name='AddSchool' and @ng-click='CreateNewSchool()']"))).click();
如果是在iframe中,请将驱动程序的焦点切换到相应的iframe,然后尝试与其进行交互。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句