Forum Discussion

tsuarezc's avatar
tsuarezc
Occasional Contributor
3 years ago
Solved

Listeners

Hi,

To not show password in the JDBC WsdlDataSourceTestStep, I create a TestRunListener, calling beforeRun(...) I am able to set the password, it only works when run a test case.
1. I want to do the same implementation when running the standalone test step, i.e. using a listener for a test step. How can I do it?
2. I want to do some actions when a project is saved but calling the Project listener method beforeSave => does not work

need to know how to configure the listener.xml for ProjectListener interface and some example of groovy script implementation
and also implementation of test step listener

 

thank you

  • There is an enhancement for special encryption of DB passwords in the project file (RIA-3363).

7 Replies

  • aaronpliu's avatar
    aaronpliu
    Frequent Contributor

    tsuarezc 

    you may take a look "Events" (Right Click on project, and select Events).

    It list out all of available events and provide some sample code. You can select proper event and implement it by yourself

     

     

    Thanks,

    /Aaron

    • tsuarezc's avatar
      tsuarezc
      Occasional Contributor

      I don't want to use the approach "Events", it only works at the project level. I need to create listeners and actions for ReadyAPI that will be used for all users from my team.

      1. Decrypt and send the password to the JDBC Datasource steps (I already created a listener for TestRun, but need to create a new one when an isolated test step run).

      2. When the user clicks on "Save Project" I need to avoid that the password is saved in plain text, I will save it encrypted. 

      ReadyAPI shadows the password in JDB Datasource steps but when you save the project the password is saved in plain text (it is unacceptable for our company)

  • nmrao's avatar
    nmrao
    Champion Level 3
    Please try SubmitListener.beforeStep.

    beforeRun for test case, so is the behaviour.
    • tsuarezc's avatar
      tsuarezc
      Occasional Contributor

      I made code for TestRunListener (They are not triggered when you run a separate test step.)

      Need to create code for a test step, and also for Project.beforeSave() (ProjectListener)

    • tsuarezc's avatar
      tsuarezc
      Occasional Contributor

      This only will work for a specific project, I do not want this. I want to create a listener for ReadyAPI (all projects)

      • nmrao's avatar
        nmrao
        Champion Level 3
        Sorry, but which reply you are talking about?