简体   繁体   English

无法在 Jmeter webdriver Sampler 4.6.0 中使用 SendKeys("1") 在文本框中输入整数值

[英]Unable to enter the integer value in textbox using SendKeys("1") in Jmeter webdriver Sampler 4.6.0

In jmeter selenium webdriver sampler 4.6.0, using the sendKeys("1") or Javascript, unable to enter the integer value in textbox using java or groovy.在 jmeter selenium webdriver sampler 4.6.0 中,使用 sendKeys("1") 或 Javascript,无法使用 java 或 groovy 在文本框中输入整数值。 could you please check the screenshot你能看看截图吗

在此处输入图像描述

Jmeter 5.4.3 or 5.5 Selenium Webdriver Sampler 4.6.0 or 4.7.0 Java language Jmeter 5.4.3 或 5.5 Selenium Webdriver Sampler 4.6.0 或 4.7.0 Java 语言

Just switch to groovy只需切换到groovy

在此处输入图像描述

When you choose java from the "Language" dropdown it is not real "java", it's Beanshell interpreter which is not 100% Java compatible and doesn't support Java features like Generics and this is the cause of the error you're getting.当您从“语言”下拉列表中选择java时,它不是真正的“java”,它是Beanshell 解释器,它不是 100% Java 兼容的,并且不支持 Java 功能,如泛型,这就是您遇到错误的原因。

Moreover it's recommended to use Groovy for any form of scripting since JMeter 3.1 .此外,自 JMeter 3.1 以来,建议将 Groovy 用于任何形式的脚本编写 See Apache Groovy: What Is Groovy Used For?请参阅Apache Groovy:Groovy 的用途是什么? article for more information.文章了解更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM