gpt4 book ai didi

testing - 找不到元素 : Trying to verify a disabled button

转载 作者:行者123 更新时间:2023-11-28 20:48:56 25 4
gpt4 key购买 nike

尝试验证此按钮是否在页面上被禁用:

<div class="btn-group pull-right" xpath="1">
<div class="pull-right" style="">
<input type="submit" ng-disabled="registrationForm.$invalid|| vm.payload.ConfirmPassword!= vm.payload.Password|| vm.payload.ConfirmEmail!= vm.payload.Email|| vm.isAgreed== false|| vm.payload.GRecaptchaResponse== ''" class="btn btn-success btn-flat" value="Register and Continue" disabled="disabled" style="">
</div>
</div>

但每次我运行它时,它都说找不到元素:(使用 katalon)尝试添加延迟()/waitForElement 但得到同样的错误。

这是我正在使用的 xpath://div[@class='btn-group pull-right']


WebUI.delay(10)

WebUI.verifyElementNotClickable(findTestObject('H3. Sign Up/H3.5 Providing correct details (Profile and Contact page) without checking Terms and Conditions and Captcha/Page_Demo Bookie (BETA)/Register And Continue Button'))


下面是完整的错误日志

03-01-2019 01:39:17 PM Test Cases/H3. Sign Up/H3.5 Providing correct details (Profile and Contact page) without checking Terms and Conditions and Captcha

Elapsed time: 55.445s

Test Cases/H3. Sign Up/H3.5 Providing correct details (Profile andContact page) without checking Terms and Conditions and CaptchaFAILED. Reason: com.kms.katalon.core.exception.StepFailedException:Unable to verify object 'Object Repository/H3. Sign Up/H3.5 Providingcorrect details (Profile and Contact page) without checking Terms andConditions and Captcha/Page_Demo Bookie (BETA)/RegisterButton' to beNOT clickable (Root cause:com.kms.katalon.core.exception.StepFailedException: Web element withid: 'Object Repository/H3. Sign Up/H3.5 Providing correct details(Profile and Contact page) without checking Terms and Conditions andCaptcha/Page_Demo Bookie (BETA)/RegisterButton' located by 'By.xpath://*[@//div[@class='btn-group pull-right']//input ='//div[@class="btn-group pull-right"]//input']' not found) atcom.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:36)atcom.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:65)atcom.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:27)atcom.kms.katalon.core.webui.keyword.builtin.VerifyElementNotClickableKeyword.verifyElementNotClickable(VerifyElementNotClickableKeyword.groovy:96)atcom.kms.katalon.core.webui.keyword.builtin.VerifyElementNotClickableKeyword.execute(VerifyElementNotClickableKeyword.groovy:67)atcom.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:53)atcom.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyElementNotClickable(WebUiBuiltInKeywords.groovy:591)atcom.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$verifyElementNotClickable$4.call(UnknownSource) at H3.5 Providing correct details (Profile and Contact page)without checking Terms and Conditions and Captcha.run(H3.5 Providingcorrect details (Profile and Contact page) without checking Terms andConditions and Captcha:86) atcom.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194) atcom.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)atcom.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:321)atcom.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:312)atcom.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:291)atcom.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:283)atcom.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:222)atcom.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:106)atcom.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:97)at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(UnknownSource) atTempTestCase1551411555685.run(TempTestCase1551411555685.groovy:22)

任何人都可以帮助我或分享有关如何解决此问题的任何想法吗?

最佳答案

您应该使用以下 xpath 定位 input 元素:

//div[@class='btn-group pull-right']//input

或使用 css 选择器:

div.btn-group.pull-right input

关于testing - 找不到元素 : Trying to verify a disabled button,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54899776/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com