Forum Discussion

startapprentice's avatar
startapprentice
New Contributor
7 years ago

java.lang.reflect.InvocationTargetException TestComplete 12.41

Hi, 

 

I am trying to automate a Java Web Start Application (jnlp) and struggling to even login using TestComplete 12.41. 

I am get the following error message when TestComplete tries to login using either script or via Keyword Tests. 

 

Message:
java.lang.reflect.InvocationTargetException
Level:
SEVERE
Stack Trace:
null
java.awt.EventQueue.invokeAndWait(Unknown Source)
java.awt.EventQueue.invokeAndWait(Unknown Source)
javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.sun.javaws.Launcher.executeApplication(Unknown Source)
com.sun.javaws.Launcher.executeMainClass(Unknown Source)
com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
com.sun.javaws.Launcher.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
null
java.awt.Dialog.show(Unknown Source)
java.awt.Component.show(Unknown Source)
java.awt.Component.setVisible(Unknown Source)
java.awt.Window.setVisible(Unknown Source)
java.awt.Dialog.setVisible(Unknown Source)
java.awt.event.InvocationEvent.dispatch(Unknown Source)
java.awt.EventQueue.dispatchEventImpl(Unknown Source)
java.awt.EventQueue.access$500(Unknown Source)
java.awt.EventQueue$3.run(Unknown Source)
java.awt.EventQueue$3.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
java.awt.EventQueue.dispatchEvent(Unknown Source)
java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.run(Unknown Source)

 

 

 

I can login to the application manually, but not via Testcomplete. 

 

Does anyone have any ideas or insight into how to I can resolve this. 

 

Any any help would be highly appreciated. 

 

Thanks

5 Replies

  • cunderw's avatar
    cunderw
    Community Hero

    Without seeing your script or keyword tests and how you're running the application it will be very hard to determine the problem, can you provide screenshots of these?

     

    Do any actions work on the application? 

    • startapprentice's avatar
      startapprentice
      New Contributor

      Hi, 

      As requested this is the script which I have written

       

      function launnchApp() {
      var app = TestedApps.Application.Run();
      }

       

      function login() {
      Aliases.jp2launcher.LoginDialog.RootPane.null_layeredPane.Panel.CurvesPanel.Panel.LoginTextField.loginField.SetText("username");
      Aliases.jp2launcher.LoginDialog.RootPane.null_layeredPane.Panel.CurvesPanel.Panel.PasswordTextField.passwordField.SetText("password");
      Aliases.jp2launcher.LoginDialog.RootPane.null_layeredPane.Panel.CurvesPanel.Panel.Button.Click();
      }

      • cunderw's avatar
        cunderw
        Community Hero

        So I've seen issues before with custom java classes for text fields where SetText causes issues. Can you try using keys there instead?

         

        Unrelated, but I would definitely take a closer look at name mapping and aliases. As it looks now it appears you have gone with keeping the default auto namemapping. This is great for exploring / seeing your object hierarchy, but will not be reliable if changes are made to your application. You aliases should also be more human friendly. RootPane.null_layeredPane.Panel.CurvesPanel.Panel is unneeded for your aliases as you will never by interacting directly with these objects.