public void testMethod1(Map\<String, String\> map) throws Exception{
logger.info("1- Test");
WebPage1.verifyTextValue("Title1", "Title1");
WebPage1.click("SectionTitle1");
WebPage1.explicitWaitForVisibility("Heading1");
WebPage1.click("Heading1");
WebPage1.explicitWaitForVisibility("Heading2");
if(map.get("AssignMethod").equalsIgnoreCase("GenerateNew")) {
WebPage1.click("TypeDropdown"); // when I run the test it fails at this step but when I debug it passes
WebPage1.explicitWaitForVisibility("SelectCard");
WebPage1.click("SelectCard");
WebPage1.click("Enroll");
WebPage1.waitForMilliseconds();}
}
WebPage1.click("TypeDropdown"); // 当我运行测试时,它在这一步失败并显示 -> 单击的 TypeDropdown 已完成但无法找到 SelectCard 并出现错误 -> org.openqa.selenium.TimeoutException :预期条件失败:等待 (xapth) 定位的元素的可见性(尝试 30 秒,间隔 500 毫秒)
但是当我调试它时它通过并移动到下一步并且能够找到 SelectCard
我的定位器工作正常,我可以手动定位它,在调试时点击下拉菜单