qmetry / qaf

Quality Automation Framework for web, mobileweb, mobile native and rest web-service using Selenium, webdrier, TestNG and Java Jersey
https://qmetry.github.io/qaf
MIT License
254 stars 138 forks source link

Getting error - java.lang.NoSuchFieldException: modifiers while running the scripts #422

Open parulbangar16 opened 2 years ago

parulbangar16 commented 2 years ago

QAF Version

ctsjv-qaf-automation

Steps To Reproduce

While running the scripts we are getting modifiers issue -

java.lang.NoSuchFieldException: modifiers at java.base/java.lang.Class.getDeclaredField(Class.java:2610) at com.qmetry.qaf.automation.util.ClassUtil.setField(ClassUtil.java:599)

cjayswal commented 2 years ago

The information provided here is not enough. Provide QAF version and execution environment details. You can find this details in report under environment-information. You can also provide details about test authoring used for instance, BDD or Java (Testng Test)

Looks like duplicate of #331

parulbangar16 commented 2 years ago

Please find more details below -

Regarding QAF -

<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>com.wellsfargo.ctsjv</groupId>
    <artifactId>ctsjv-qaf-automation-parent</artifactId>
    <version>10.0.0.1</version>

</parent> 

We were using the same framework in WellsFargo (Oracle Java 8 used) and it was working fine now we shifted to CPU and we are getting issues here - (Now RedHat java version 11 and RedHat Java version 8 we are using)

If we are running with Java 11 -

We are getting below mentioned error ; java.lang.NoSuchFieldException: modifiers at java.base/java.lang.Class.getDeclaredField(Class.java:2610) at com.qmetry.qaf.automation.util.ClassUtil.setField(ClassUtil.java:599)

If we change to Java 8 then we are getting complication issues -

java.lang.UnsupportedClassVersionError: com/cts/base/CSBaseTestCase has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Can you please help into this.

parulbangar16 commented 2 years ago

Please find the full pom.xml below -

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0
<parent>
    <groupId>com.wellsfargo.ctsjv</groupId>
    <artifactId>ctsjv-qaf-automation-parent</artifactId>
    <version>10.0.0.1</version>

</parent> 

<artifactId>SeleniumCTSGatewayAutomation</artifactId>
<packaging>jar</packaging>
<version>2.0.0-SNAPSHOT</version>

<!-- <artifactId>wf-eqe-automation-web</artifactId>
<packaging>jar</packaging>
<name>wf-eqe-automation-web</name>-->

<name>SeleniumCTSGatewayAutomation</name>

<properties>
    <jdk.source.version>1.8</jdk.source.version>
    <jdk.target.version>1.8</jdk.target.version>
    <eqe.version>3.3-SNAPSHOT</eqe.version>
</properties>
<build>
<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
            <source>${jdk.source.version}</source>
            <target>${jdk.target.version}</target>
        </configuration>
    </plugin>
    <plugin>
        <groupId>org.sonarsource.scanner.maven</groupId>
        <artifactId>sonar-maven-plugin</artifactId>
        <version>3.4.0.905</version>
</plugin> 
</plugins>
</build>

<dependencies>

    <dependency>
        <groupId>com.wellsfargo.ctsjv</groupId>
        <artifactId>ctsjv-qaf-automation</artifactId>
        <version>10.0.0-SNAPSHOT</version>
        <scope>compile</scope>
    </dependency>

    <!-- dependency for Acceptance BOT -->
    <dependency>
        <groupId>org.imgscalr</groupId>
        <artifactId>imgscalr-lib</artifactId>
        <version>4.2</version>
    </dependency>
    <dependency>
        <groupId>com.madgag</groupId>
        <artifactId>animated-gif-lib</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>com.qmetry</groupId>
        <artifactId>qaf-execution-recorder</artifactId>
        <version>0.0.1</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/lib/qaf-execution-recorder-0.0.1.jar</systemPath>
    </dependency>
    <!-- for run history listener -->
    <dependency>
        <groupId>commons-jxpath</groupId>
        <artifactId>commons-jxpath</artifactId>
        <version>1.3</version>
    </dependency>
 <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>7.1.0</version>
        <scope>test</scope>
    </dependency>
</dependencies>

parulbangar16 commented 2 years ago

This is TestNG

cjayswal commented 2 years ago

@parulbangar16 QAF version and execution environment details are still missing. You can find this details in report under environment-information.

Regardless of that you should contact to internal team who is maintaining ctsjv-qaf-automation library.

parulbangar16 commented 2 years ago

@cjayswal QAF report - dashboard.htm is not generating that is why we are not able to share the environment - information.

cjayswal commented 2 years ago

You should contact to internal team who is maintaining ctsjv-qaf-automation library for the issue. Report issue to internal team.