首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >java.lang.IllegalArgumentException @$Proxy21在Java initElements中的错误

java.lang.IllegalArgumentException @$Proxy21在Java initElements中的错误
EN

Stack Overflow用户
提问于 2017-12-06 12:46:53
回答 1查看 214关注 0票数 0

我突然开始面对下面的错误:

io.appium.java_client.pagefactory.DefaultElementByBuilder.checkDisallowedAnnotationPairs(DefaultElementByBuilder.java:46) at io.appium.java_client.pagefactory.DefaultElementByBuilder.assertValidAnnotations(DefaultElementByBuilder.java:87)的java.lang.IllegalArgumentException:如果您使用@$Proxy21注释,那么您也不能在io.appium.java_client.pagefactory.DefaultElementByBuilder.assertValidAnnotations(DefaultElementByBuilder.java:87)上使用“@$Proxy23”注释

下面的代码用于init元素:

代码语言:javascript
复制
  PageFactory.initElements(new AppiumFieldDecorator(appiumDriver, 6, TimeUnit.SECONDS), this);

它运转得很好&没有发生任何重大变化,但它现在失败了。

Appium版本: 1.7.1

我的POM.xml

代码语言:javascript
复制
   <dependencies>

    <dependency>
        <groupId>com.github.fge</groupId>
        <artifactId>json-schema-validator</artifactId>
        <version>2.0.0</version>
    </dependency>


    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson.version}</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${jackson.version}</version>
    </dependency>

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>${selenium.java.version}</version>
    </dependency>


    <dependency>
        <groupId>com.vimalselvam</groupId>
        <artifactId>cucumber-extentsreport</artifactId>
        <version>${cucumber.extentsreport.version}</version>
    </dependency>

    <dependency>
        <groupId>io.appium</groupId>
        <artifactId>java-client</artifactId>
        <version>${appium.java-client.version}</version>
        <!--<version>5.0.0-BETA5</version>-->
    </dependency>

    <!-- https://mvnrepository.com/artifact/log4j/log4j -->
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j.version}</version>
    </dependency>

    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>${cucumber-java.version}</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.jayway.jsonpath/json-path -->
    <dependency>
        <groupId>com.jayway.jsonpath</groupId>
        <artifactId>json-path</artifactId>
        <version>${json-path.version}</version>
    </dependency>


    <dependency>
        <groupId>org.monte.screenrecorder</groupId>
        <artifactId>MonteScreenRecorder</artifactId>
        <version>10</version>
        <scope>system</scope>
        <systemPath>${basedir}/lib/monte-screen-recorder-0.7.7.jar</systemPath>
    </dependency>


    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
    </dependency>

    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>${cucumber-junit.version}</version>
    </dependency>

    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-core</artifactId>
        <version>${cucumber-junit.version}</version>
    </dependency>


    <dependency>
        <groupId>com.googlecode.json-simple</groupId>
        <artifactId>json-simple</artifactId>
        <version>${json-simple.version}</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver -->
    <!--<dependency>-->
    <!--<groupId>org.seleniumhq.selenium</groupId>-->
    <!--<artifactId>selenium-chrome-driver</artifactId>-->
    <!--<version>3.3.1</version>-->
    <!--</dependency>-->
    <!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
    <!--<dependency>-->
        <!--<groupId>org.springframework</groupId>-->
        <!--<artifactId>spring-context</artifactId>-->
        <!--<version>${spring-context.version}</version>-->
    <!--</dependency>-->
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-library</artifactId>
        <version>${hamcrest-library.version}</version>
        <scope>test</scope>
    </dependency>



    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-jvm-deps</artifactId>
        <version>1.0.5</version>
        <scope>test</scope>
    </dependency>

    <!--Exploratory Cucumber-TestNG Fusion-->
    <!--<dependency>-->
        <!--<groupId>info.cukes</groupId>-->
        <!--<artifactId>cucumber-testng</artifactId>-->
        <!--<version>1.2.4</version>-->
        <!--<scope>compile</scope>-->
        <!--<exclusions>-->
            <!--<exclusion>-->
                <!--<groupId>junit</groupId>-->
                <!--<artifactId>junit</artifactId>-->
            <!--</exclusion>-->
        <!--</exclusions>-->
    <!--</dependency>-->


    <!--<dependency>-->
        <!--<groupId>info.cukes</groupId>-->
        <!--<artifactId>cucumber-spring</artifactId>-->
        <!--<version>${cucumber-spring.version}</version>-->
        <!--<scope>test</scope>-->
    <!--</dependency>-->

    <!--<dependency>-->
        <!--<groupId>org.springframework</groupId>-->
        <!--<artifactId>spring-context</artifactId>-->
        <!--<version>4.3.8.RELEASE</version>-->
        <!--<scope>test</scope>-->
    <!--</dependency>-->
    <!--<dependency>-->
        <!--<groupId>org.springframework</groupId>-->
        <!--<artifactId>spring-test</artifactId>-->
        <!--<version>4.3.8.RELEASE</version>-->
        <!--<scope>test</scope>-->
    <!--</dependency>-->

    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-picocontainer</artifactId>
        <version>1.2.5</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit5-engine</artifactId>
        <version>5.0.0-ALPHA</version>
    </dependency>
    <dependency>
        <groupId>com.relevantcodes</groupId>
        <artifactId>extentreports</artifactId>
        <version>2.41.2</version>
        <scope>test</scope>
    </dependency>

    <!--<dependency>-->
        <!--<groupId>org.testobject</groupId>-->
        <!--<artifactId>testobject-appium-java-api</artifactId>-->
        <!--<version>0.1.0</version>-->
    <!--</dependency>-->

    <dependency>
        <groupId>com.vimalselvam</groupId>
        <artifactId>cucumber-extentsreport</artifactId>
        <version>2.0.4</version>
    </dependency>

    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports</artifactId>
        <version>3.0.2</version>
    </dependency>

    <dependency>
        <groupId>com.browserstack</groupId>
        <artifactId>browserstack-local-java</artifactId>
        <version>0.1.0</version>
    </dependency>

    <dependency>
        <groupId>report.donut</groupId>
        <artifactId>donut</artifactId>
        <version>1.1</version>
    </dependency>

    <!--<dependency>-->
        <!--<groupId>com.browserstack</groupId>-->
        <!--<artifactId>automate-testassist</artifactId>-->
        <!--<version>0.7.2-SNAPSHOT</version>-->
    <!--</dependency>-->

    <!--<dependency>-->
        <!--<groupId>com.browserstack</groupId>-->
        <!--<artifactId>browserstack-integration</artifactId>-->
        <!--<version>LATEST</version>-->
    <!--</dependency>-->

</dependencies>

我不知道为什么我突然开始犯这个错误。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-12-06 14:43:23

确保使用最新的客户端库,即5.0.4,因为您使用的是Appum1.7.1。

.m2\repository中清除maven缓存,从零开始安装依赖项。

也可能是在定义某些元素时混合了不兼容的注释的情况。检查这里是否有工作实例

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47674653

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档