Forum Discussion

thomas_brossama_1's avatar
11 years ago

Automation for instant messaging application (Lync)

Hi,



Could you please recommend me a solution on how to automate the testing of an instant messaging application such as Lync 2010?



How do you configure TestComplete (installed on the master computer) to catch an event triggered by a remote test machine and verify it?



Can we control 2 or more hosts with TestComplete/TestExecute within the same test where the test sends a command to the application from the remote machine, and read the results on another machine?

Is there a way to control the timing? Shoud I use event listener?



How do you create it in Keyword?



Thank you in advance

Let me know if I need to move this topic to distributed testing.



Best regards,



Thomas Brossamain
  • Hi Thomas,

     


    Do you want to control this from your tested app's UI? In this case, you will need to set up the distributing test. To coordinate master and slave computers, you can use synchronization points or Network Suite variables. During this kind of synchronization, execution of the participating projects is paused until all of these projects have reached the same synchpoint. For your case, it may mean that all slave machines will stop test execution until they get a message from a master machine:




     


    Please refer to the "Synchronization Points" article for more information.


     

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Thomas,

     


    Do you want to control this from your tested app's UI? In this case, you will need to set up the distributing test. To coordinate master and slave computers, you can use synchronization points or Network Suite variables. During this kind of synchronization, execution of the participating projects is paused until all of these projects have reached the same synchpoint. For your case, it may mean that all slave machines will stop test execution until they get a message from a master machine:




     


    Please refer to the "Synchronization Points" article for more information.


     

  • Hi Tanya,



    I will try your proposal. I think this is what I am looking here.

    Thank you



    Best regards

    Thomas Brossamain
  • Hi again Tanya ,



    Is that possible to do this within the same slave project?

    I mean, I have create a slave project (Lync) that contains 1 test (Send Instant message).



    The test is executed locally on the same machine where TestComplete is installed.

    During the execution,the test shall start Lync both on the local computer and at the same time onto another computer remotely (RDP session)



    Therefore the test handled within the same slave project, 2 different sessions (1 local and 1 remote).

    The test continues where the application, started locally, sends an instant message to the remote machine. The test shall be able to read on the remote machine the received message sent by the local machine.



    Do I have to create anyway another slave project to perform my test?



    Thank you

    Best regards,
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Thomas,

     


    It looks like the following setup will work:


    1. Your local computer that sends messages should be master.


    2. The remote computer that receives messages will be slave.


    A project on the slave computer will launch Lync and wait for messages in Lync's window.


     

  • Hi again,



    If I use the local machine (ARE20305 - Which has TestComplete installed) as master, this does not work in a distributed environment.



    I get this message

    ARE20305 (ARE20305): The local computer cannot be used as a slave host. To solve the problem, please specify the network name or IP address of a remote computer in the Address column of the Hosts editor.



    Therefore How do you setup the local computer to be used in a Network Suite as master?

    I might not understand correctly here the concept.



    Here is the new setup I have considered after your post



    TC Project Suite (Stored in Local Machine)



      Slave project - Lync Master 

        - Keyword Test - SendIM with Synchronization point - WaitForIM

        - NetworkSuite - 2 Hosts:  Remote A (TestExecute), Remote B

        - Job 

            Task - SendIM from Lync Master project on Remote A

            Task - ReadIM from Lync Slave project on Remote B



      Slave Project - Lync Slave

        - Keyword Test - ReadIM with same Synchronization point - WaitForIM

        - NetworkSuite 

        - No Job



    What I understand from this is that haveing the 2 tests in the same slave project cannot be handle.

    Therefore by creating 2 different projects, I need to have 2 identical nameMapping files. One for each project. Why can't this be handled within the same project? Can I use a shared NameMapping file between projects?



    Another point: When executing the tests, both tests manage to reach the synchronization points (WaitForIM), but the execution does not go further. It keeps synchronizing. There is a hourglass icon  for each Host in the NetworkSuite (Run State tab). How can I pass this synchronization point?



    Thank you again for you help


     

  • Hi Tanya, Alexei,



    Thank you for your replies.



    I have finally managed to test in a distributed environment the Lync application (Sending/Recevieing IM between 2 remote clients).



    The solution I have found is more a workaround than the final solution. It needs improvement though.

    I understood that I was missing some concepts related to the distributed setup explained by Smartbear, although I think there are limitation.


    • mixing master, slave, remote, project and project suites terms  all together


    • unsure where the master ans slaves project files should be stored in TestComplete and on the remote test machines (physically)


    Therefore the solution I implemented as you have mentioned, can be run from a Project NetworkSuite, and from the ProjectSuite NetworkSuite using an additional Project dedicated to Regression test for all Projects under my Project Suite.



    Project Location: Local Machine with TestComplete installed (acts as Test controller)

    Project Suite name: Desktop_Application_Testing

    Projects (or Slave project):


    • Lync


    • Lync_Transmitter


    • Lync_Receiver


    • Other application such as MS_Office


    • Regression


    Lync and Other applications slave projects contain only tests that do not require interaction with other computers. Lync acts as the "Master" or Coordinator project for the distributed tests involving both Lync_Transmitter and Lync_Receiver projects.

    Lync_Transmitter and Lync_Receiver
    contain tests that includes under the NetworkSuite the same synchronization points and different steps waiting for other actions from other computers. (

    Sending/Recevieing IM between 2 remote clients)

    Lync project contains the Test Items "NetworkSuite\Jobs\Task" to be able to run both non-distributed and distributed tests sequentially.

    Regression contain no test at all, but only a NetworkSuite with the path to the ProjectSuite PJS file. This means that it will run all the slave projects sequentially stored in my ProjectSuite. There is only 1 Task with only the PJS filename specified. Ref discussion here for more info. Beforehand, each Project Test items have been selected to ensure which test should be run for regression.



    Host machine (Remote/Slave machines where the slave projects will be copied) with TestExecute installed


    • RemoteComputer1 (act as Transmitter) -> Lync_Transmitter copied on the machine


    • RemoteComputer2 (act as Receiver) -> Lync_Receiver copied on the machine

       


    So I am talking about "workaround" because the test I have created for Sending/Receiving IM does not use properly the Synchronization points made available. There are skipped.

    Therefore I have thought to add a timeout (Integer) as proposed in the description of SynchPoints with Keyword Driven test. But I got a failure/Warning that this Synchpoint did not work (NetworkSuite.Synchronize("SPC",10000) or NetworkSuite.SynchPoints.SPC.WaitFor(10000))

    I have filed a case to the customer support for this (Case #00045778).



    To bypass this, I have added manually delays together with the Synchronization points. It works, and both remoteComputers can interact with the Lync application. Now I am able to run the Project Lync with a mix of test items, both non-distributed and distributed tests by using only 3 machines (Test Controller and 2 remote machines). The best would be to use only 2 machines where the Test Controller could interact in the distributed tests as well.



    Now I come to a point I would like to run this distributed test "Sending/Receiving IM" into my Regression project. Since this project runs only tests towards remote machines, it means that I am trying to run a distributed test into another distributed environment.



    When starting the Regression project task, it runs all the tests only towards 1 remote machine (RemoteComputer1). The tests which do not require interactions with other test machines works fine, but when it comes to the test "Sending/Receiving IM" it shall start another remote machine (the Receiver), but TestComplete does not manage. The RunState does not display the other RemoteComputer2. The test fails.



    What is the problem? TestExecute does not support to start another host to run a distributed test?



    I have thought to isolate the distributed test involving interation between remote computers to its own ProjectSuite. So when running the Regression project, I can run in parallel 2 tasks, one for Desktop_Application and one for the Lync_Distributed_Tests. But this requires an additional machine to be used to run the Lync tests.



    Thank you for your help in advance

     

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Thomas,

     


    Let me post the reply you got from the Support Team:


     


    1. Just to make things simpler and clearer, I would create a single project suite with a single project in it. The Master project you sent us earlier is almost what we need. Just add two tests there (the "send message" and "receive message" tests) which are supposed to be executed on RemoteComputer1 and RemoteComputer2 and associate the ReceivingIM and SendingIM tasks with them. An important note: the value in the "Project file name" field, which is hidden by default, should be changed appropriately - the default value [File name of the current project suite] should be chosen there.


     


    2. For synchronizing "send message" and "receive message" tests I would rather use a Network Suite variable and the NetworkSuite.WaitForNetVarChange method. The idea is:


    - add a new Network Suite variable of the Boolean type to your network suite (let's name it e.g. MessageSentFlag);


    - modify your "send message" test so that right after sending a message it assigns the True value to the MessageSentFlag variable;


    - modify your "receive message" test so that it waits until the value of the MessageSentFlag variable equals True (use the NetworkSuite.WaitForNetVarChange method for this), and, only after that, perform some verification.