Forum Discussion

thomas_brossama_1's avatar
11 years ago

How to test the Checkpoint Endpoint Security agent?

Hi,



I would like to test the agent Endpoint Security from Checkpoint  (version E80.50) and the feature "Scan".







Could you please indicate me the way to follow when it comes to test such "application/service/agent"?



I would like to build a keyword driven test which


  • Open the tray automatically and check that all blades are compliant/ON


  • Run a scan of the system


First, How do you open an agent with a test which opens from the Icon Tray? I could not find a solution. Opening the process cptray.exe does not work.



Secondly, what I am unsure today is how long could take a scan and how TC can understand this.

What are the means given by TC to ensure that the scan is running, has finished and has been succesfull?

Are Events the key of this?



Thank you for your help in advance



Best regards
  • Hi Thomas,



    To click the item in the tray you may use approach from here: http://support.smartbear.com/viewarticle/8787.

    As for how long to wait for the scan to complete - you should look for some criterion (e.g. how do you determine that the scan is complete if you start it manually? Or you may ask developers whether they expose some flag/method that can help you) and than delay the test until either the criterion is met or some reasonable time interval is elapsed.
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Thomas,



    To click the item in the tray you may use approach from here: http://support.smartbear.com/viewarticle/8787.

    As for how long to wait for the scan to complete - you should look for some criterion (e.g. how do you determine that the scan is complete if you start it manually? Or you may ask developers whether they expose some flag/method that can help you) and than delay the test until either the criterion is met or some reasonable time interval is elapsed.
  • Hi Alexey,



    Thank you for the quick answer! Great!



    Your suggestion about accessing to the icon tray worked. I managed to build the test verifying the status of the system regarding anti malware, firewall...etc.



    This works in a non-distributed environment (on the same machine where TC is installed).

    However in a distributed environment, the behaviour of the test changes.

    When using an automatic RDP session, I can t explain why, but the Endpoint Security process (cptray.exe) is not running. Therefore the test fails.

    Whereas using a manual RDP session, the same test passes.

    Is this related to a configuration option in RDP in Windows or TestExecute/TC that selects the services to start up the RDP session?

    Do you have any explanation?



    For the testing of scanning feature, I am not able to ask any developer to help me out, since I am using a SW version we bought from Symantec. I need to find out how to set the criterion in my test, how to interpret it into a keyword



    Thank you again

    Best Regards,
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3


    Hi Thomas,



    > Is this related to a configuration option in RDP in Windows or TestExecute/TC that selects the services to start up the RDP session? [...]



    Unfortunately, I am afraid that this is question more for Support (you may raise a support case if they not answer here). The only idea that I have is to check what account is used for the RDP session and what account is used to start the scanning service (as I think it is responsible to spawn a UI process when the user logs in). Maybe if you allow cptray.exe to interact with the desktop (checkbox in the service properties) this will solve the problem with the icon not showed in the tray...



    > I need to find out how to set the criterion in my test [...]

    I believe that TestComplete will be able to identify some label like 'running...', 'executing...', etc. displayed in the Endpoint Security panel while the scan is running. In the worst case if the only criterion is the animated icon in the tray, you may try approach from here: http://support.smartbear.com/viewarticle/54656/


  • Hi again,



    I could not figure out how to solve this.

    When all the icons are not shown in the taskbar, the Endpoitn Security icon does not appear.

    Therefore I found a workaround where I ensure that on the taskbar always show the icons and noticifications to the user (under Control Panel\All Control Panel Items\Notification Area Icons in Windwos 7)

    Thus when running Distributed testing, I am able to find the needed icon. I updated the the function RightClickTrayIcon in VB script to suit to my test.




    Function RightClickTrayIcon(itemName, menuItemName)



    Set tray =



    Sys.Process("explorer").Window("Shell_TrayWnd", "", 1).Window("TrayNotifyWnd", "", 1).Window("SysPager", "", 1)



    ' Get the button to click on



    Set icon = tray.Window("ToolbarWindow32", "User Promoted Notification Area", 1)



    ' Right-click the application icon



    icon.ClickItemR(itemName)



    ' Select an item from the context menu



    icon.PopupMenu.Click(menuItemName)



    End Function




    With regards to the criterion to figure out whether the scanning is finished. A window is displayed by Endpoint Security about the Current status of the Scanning. Therefore, I use the properties of the Progression Bar object displaying "Scanning In Progress(x%)". Once I get the Caption text of the Progression Bar to 100% Completed, the test ends.

    This is done with a Checkpoint Properties. This works fine if I wait with a defined delay (like 1h).



    However, If I do not want to set a fixed delay, I do not manage to build the step/loop where it checks when this Checkpoint Property has been passed. The Checkpoint Property throws an error I can t manage to catch in Keyword.

    So Is there a trick in Keyword to check a property object during a period of time (1h for example) until the condition set up has been verified?

    How to do you catch the error thrown by the Checkpoint Property everytime you run it?



    I would like to create a test like this below in Keyword where the Checkpoint Properties does not throw an error in the logs and make the test failing



    IsScanningCompleted = False

    AddDelay = 0



    While IsScanningCompleted <> True AND AddDelay < 1h



      if Checkpoint(Object.property.Value) <> True then

            AddDelay = AddDelay + 10000

            Delay (AddDelay)

      else

        IsScanningCompleted = True

      end if



    end while



    If AddDelay => 1h then

      Log(Issue with Scanning)

      StopScanning

    else

      Log(Scanning Successfull)

    end if




    Thank you for your help again :)


    Best Regards



     


  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Thomas,



    I am not very good with Keyword Tests as I prefer a coding approach, but I think that you need to implement it this way:



    (By definition, ) checkpoint is designed to verify if the condition is met and in general I like SmartBear's approach when they log verification result automatically.

    When you need to wait for some property to get the certain value, you may get this value, compare it with the expected one, delay for some time if the value does not match the expected one and repeat the loop.

    In terms of Keyword Tests, I think that in your scheme:

    While IsScanningCompleted <> True AND AddDelay < 1h



      if Checkpoint(Object.property.Value) <> True then

            AddDelay = AddDelay + 10000

            Delay (AddDelay)

      else

        IsScanningCompleted = True

      end if




    you should:

    a) Create a test variable (e.g. with the vProgressPercent name);

    b) replace the 'if Checkpoint(...) line with something like this:

      -- Set Variable operation that sets vProgressPercent variable with the Object.property.Value value

      -- If...Then operation that checks if the value of the vProgressPercent variable equals to '100%' (or whatever criterion you use);



    Then, after the main While loop you can use the Property checkpoint that will either report success if scan completed or post an error if the scan did not complete within one hour.



    Please let me know if the above description is not clear enough.