Forum Discussion

took's avatar
took
New Contributor
15 years ago

Java WebStart & custom controls

Hi,



our application is launched via Java WebStart and the UI is implemented using custom UI controls (extending basic Swing components). I tried to search the web site and forums for the information but couldn't find it so decided to post.



So my questions are: does TestComplete support



1) Launching AUT via Java WebStart?



2) Manipulating custom Java components in AUT UI?



Thanks in advance,

Sampsa

3 Replies

  • Hi Sampsa,




    1) Launching AUT via Java WebStart?



    Please see our answer in the following SQAforums thread:

    http://www.sqaforums.com/showflat.php?Cat=0&Number=553708&an=0&page=0&gonew=1#UNREAD




    2) Manipulating custom Java components in AUT UI?



    It depends on the way the components are implemented. If they just draw their contents within a single window, TestComplete will not be able to recognize the image parts as individual controls. However, there are some other approaches which can help you. Please see the "Retrieving Data From Java Objects" help topic

    ( http://www.automatedqa.com/support/viewarticle.aspx?aid=6759 ) for more information.


  • took's avatar
    took
    New Contributor
    Thanks,



    the Java WebStart issue seems to be solvable then if we build up an external system to download the JNLP file.



    Regarding the custom controls, I guess I'll give it a try.



    --

    Sampsa

  • Hi Sampsa,




    the Java WebStart issue seems to be solvable then if we build up an external system to download the JNLP file.



    There is no need to create an external system. You can use the following script routine to download the file:




    function Test()

    {

      // Specify the source and destination file names

      var strFileURL = "http://www.mywebsite.com/file_to_get";

      var strHDLocation = "c:\\temp\\filename";

      // Download the file

      var objHTTP = new ActiveXObject("MSXML2.XMLHTTP");

      objHTTP.open("GET", strFileURL, false);

      objHTTP.send();

      while((objHTTP.readyState != 4) && (objHTTP.readyState != 'complete')) {

        Delay(100);

      }

      if (200 != objHTTP.Status) {

        Log.Error("The " + strFileURL + " file was not found. HTTP status: " + objHTTP.Status);

        return;

      }

      var objADOStream = new ActiveXObject("ADODB.Stream");

      objADOStream.Open();

      objADOStream.Type = 1; //adTypeBinary

      objADOStream.Write(objHTTP.ResponseBody);

      objADOStream.Position = 0;    //Set the stream position to the start

      var objFSO = new ActiveXObject("Scripting.FileSystemObject");

      if (objFSO.FileExists(strHDLocation)) objFSO.DeleteFile(strHDLocation)

      objADOStream.SaveToFile(strHDLocation);

      objADOStream.Close();

    }