如何单击:: element(Groovy,jmeter)?
要使提交按钮处于活动状态,我只需要在脚本中的上一步上模拟此复选框即可。
您能否让我知道,使用此元素之前的::指向 /打开此复选框的方法是什么?
//既不
// input [ @class ='checkbox'和 @name ='goomection']
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//input[@class='checkbox' and @name='Information']")));
WebElement checkbox_Information = driver.findElement(By.xpath("//input[@class='checkbox' and @name='Information']"));
checkbox_Information.click();
nor
// label [ @class ='checkbox -label'和 @for ='groundy'
]消息,例如:
响应消息:javax.script.scriptexception:javax.script.scriptexception:org.openqa.selenium.timeoutexception:预期条件失败:等待元素可单击: '复选框'和 @name ='信息'](用500毫秒间隔尝试30秒)
I work on client-side in JMeter with groovy and have this situation:
To make SUBMIT button active, I just need to emulate checking this checkbox on previous step in the script.
Could you please let me know, what are the ways to point to / switch on this checkbox, using this ::before element?
Neither
//input[@class='checkbox' and @name='Information']
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//input[@class='checkbox' and @name='Information']")));
WebElement checkbox_Information = driver.findElement(By.xpath("//input[@class='checkbox' and @name='Information']"));
checkbox_Information.click();
nor
//label[@class='checkbox-label' and @for='Information']"
could help - in both cases here are error messages, for example:
Response message:javax.script.ScriptException: javax.script.ScriptException: org.openqa.selenium.TimeoutException: Expected condition failed: waiting for element to be clickable: By.xpath: //input[@class='checkbox' and @name='Information'] (tried for 30 second(s) with 500 milliseconds interval)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您:
到目前为止您的代码,如果您谈论的是jmeter的 webdriver采样器您可以尝试:
确保可见复选框,不被弹出窗口覆盖和可单击
usu an 明确等待确保可以与
进行交互的复选框
,如果没有任何帮助,则可以使用 javascript ,类似:
The chance of getting a comprehensive response will be much hire if you:
So far if you're talking about JMeter's WebDriver Sampler you can try:
Ensuring that the checkbox is visible, not covered by popups and clickable
Usu an Explicit Wait to ensure that the checkbox can be interacted with
And if nothing helps as the last resort you can "click" the checkbox using JavaScript, something like: