qaf icon indicating copy to clipboard operation
qaf copied to clipboard

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

Open parulbangar16 opened this issue 3 years ago • 7 comments

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)

parulbangar16 avatar Aug 02 '22 07:08 parulbangar16

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

cjayswal avatar Aug 02 '22 18:08 cjayswal

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 avatar Aug 03 '22 08:08 parulbangar16

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"> <modelVersion>4.0.0</modelVersion> <groupId>com.wellsfargo.ctsjv</groupId> <artifactId>ctsjv-qaf-automation-parent</artifactId> 10.0.0.1

</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 avatar Aug 03 '22 12:08 parulbangar16

This is TestNG

parulbangar16 avatar Aug 03 '22 12:08 parulbangar16

@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.

cjayswal avatar Aug 05 '22 22:08 cjayswal

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

parulbangar16 avatar Aug 08 '22 05:08 parulbangar16

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

cjayswal avatar Aug 08 '22 19:08 cjayswal