Reflection Error Message Everytime I Run The Test | Selenium Forum
Y
youralok Posted on 06/03/2019

Hi,

I am getting the following error everytime I run the test. Though it is not stopping or failing any test, but am not sure how to get rid of it. I tried to explore online, but could not get resolution to my scenario:

 

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.Shree_Automate_Feb2019.driver.driverScript.executeKeywords(driverScript.java:69)
at com.Shree_Automate_Feb2019.suiteA.SurveyTaking.surveyTaking(SurveyTaking.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:583)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
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)
Caused by: java.lang.IllegalMonitorStateException
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Unknown Source)
... 31 more


A
Ashish Thakur Replied on 07/03/2019

Please debug the program and check it

You are passing some wrong parameters

The stack trace does not show any relevant error


Y
youralok Replied on 07/03/2019

With your help on wrong parameters point, when I did some changes to my test steps, I realized the problem.
I have written a keyword wait and passing the time in the Data and when I have this in test steps, it is working and throwing that exception, else it is working without any error.
Any other alternative to use the wait keyword or anyway to resolve this exception?


A
Ashish Thakur Replied on 09/03/2019

Please check the driverScript.java, line number 69 and SurveyTaking.java line number 27 for the errors


Y
youralok Replied on 19/03/2019

I think we can close this ticket now.