selenium—在java代码中使用jmeter插件webdriver时,是否存在预期条件的noclassdeffounderror?

vql8enpb  于 2021-07-03  发布在  Java
关注(0)|答案(1)|浏览(337)

问题
J计 version 5.3 jmeter插件webdriver version 3.3 我在jmeter插件webdriver.jar的pom中找到了 <selenium.version>3.141.59</selenium.version> 在此版本中包含 ExpectedConditions 3.141.59级-驾驶员
这是我的密码

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

import java.time.Duration;
import java.util.UUID;

        WDS.sampleResult.sampleStart();
        final String targetStory = "story";
        final String token = "11111";

        final String defectContentString = "story$" + UUID.randomUUID().toString().substring(9);
        WDS.log.info("We Start To Test");

            WDS.browser.get("http://localhost:9090/#/agile/work-list/backlog?" +
                    "type=project&id=59&name=%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E9%A1%B9%E7%9B%AE&category=GENERAL&" +
                    "organizationId=1&redirectFlag");

            WDS.log.info("Wait to Load");

            WebDriverWait wait = new WebDriverWait(WDS.browser, Duration.ofSeconds(30).getSeconds());
            wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector(".sprintIssueItem")));

        WDS.sampleResult.sampleEnd();

有人能帮我,谢谢

wfsdck30

wfsdck301#

确保jmeter安装的“lib”文件夹下至少有以下库:

selenium-api-3.14.0.jar
selenium-chrome-driver-3.14.0.jar
selenium-firefox-driver-3.14.0.jar
selenium-ie-driver-3.14.0.jar
selenium-java-3.14.0.jar
selenium-remote-driver-3.14.0.jar
selenium-support-3.14.0.jar

将jmeter-plugins-webdriver-.jar添加到“lib/ext”文件夹是不够的,因为这样您就没有所有的依赖关系,因为它只提供webdriver sampler和配置元素,而没有提供所需的selenium java客户机库
安装jmeter插件(并最终使其保持最新)的推荐方法是jmeter插件管理器,它不仅为您提供jmeter插件,还可以下载所有必需的.jar

相关问题