Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormDataBean with dependsOnField throws ClassCastException: cannot be cast to class [C ( #393

Closed
2 of 5 tasks
cjayswal opened this issue Dec 10, 2021 · 0 comments
Closed
2 of 5 tasks
Projects
Milestone

Comments

@cjayswal
Copy link
Member

QAF Version

Note: only the latest version is supported
3.0.1

Steps To Reproduce

1. Create form data bean with filed with dependency on other fileld
2. Call form.fillUiElements();

Expected behavior

Should fill dependent field based on filed it depends and depending value provided in @UiElement using dependsOnField and dependingValue

Actual behavior

java.lang.ClassCastException: class java.lang.Boolean cannot be cast to class [C (java.lang.Boolean and [C are in module java.base of loader 'bootstrap')
at com.qmetry.qaf.automation.data.BaseFormDataBean.checkParent(BaseFormDataBean.java:217)
at com.qmetry.qaf.automation.data.BaseFormDataBean.fillUiData(BaseFormDataBean.java:310)
at com.qmetry.qaf.automation.data.BaseFormDataBean.fillUiElements(BaseFormDataBean.java:83)
at com.example.qaf.test.Suite1.tc1(Suite1.java:36)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:756)
at org.testng.TestRunner.run(TestRunner.java:610)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:387)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1293)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1218)
at org.testng.TestNG.runSuites(TestNG.java:1133)
at org.testng.TestNG.run(TestNG.java:1104)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

Is the issue reproducible on runner?

  • QAS
  • Maven
  • Gradle
  • Ant
  • Eclipse

Test case sample

public class NewUserForm extends BaseFormDataBean {
...
	@UiElement(fieldLoc = "newsletter.loc", fieldType = Type.checkbox, order = 3)
	private Boolean newsletter=true;
	
	@UiElement(fieldLoc = "digester.loc", fieldType = Type.checkbox ,dependsOnField = "newsletter", dependingValue = "newsletter==true", order =5)
	private boolean digester;
	
	@UiElement(fieldLoc = "marketflash.loc", fieldType = Type.checkbox, dependsOnField = "newsletter", dependingValue = "true",  order = 5)
	private String marketflash;
}

public void tc1() {
		
	getDriver().get("https://qmetry.github.io/qaf/playground/useraccount-form.html");
		
	NewUserForm form = new NewUserForm();
	form.setNewsletter(true);
	form.setDigester(true);
	form.fillUiElements();
}
@cjayswal cjayswal added this to the 3.1.0 milestone Dec 10, 2021
@cjayswal cjayswal added this to Ready in QAF Dec 13, 2021
@cjayswal cjayswal moved this from Ready to Released in QAF Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
QAF
  
Released
Development

No branches or pull requests

1 participant