cancel
Showing results for 
Search instead for 
Did you mean: 

How to edit DBdatasource configuration

SOLVED
Highlighted
New Contributor

How to edit DBdatasource configuration

Hi,

I am looking for a solution for clearing sensitive data from the JDBC / DB Datasource steps connection configuration.
I have to replace all the DB connection passwords in all xml files in my composite project.

The following Save Script is working for JDBC steps but not for DB Datasource steps:

project.getProject().getTestSuiteList().each{suite->
        suite.getTestCaseList().each{testCase->
                testCase.getTestStepList().each{step->\
                        //clearing the JDBC steps pass (working)
                        if (step instanceof JdbcRequestTestStep) {
                                step.getJdbcRequestTestStepConfig().setPassword("")
                        }
                        //clearing the DB datasource step pass (not working)
                        if (step instanceof WsdlDataSourceTestStep) {
                                if (step.getDataSource() instanceof DBDataSource) {
                                        //TODO search for a way to clear a datasource pass
                                        step.getDataSourceStepConfig() setPassword("") 
                                }
                        }
                }
        }
}

 

This is a part of the test case xml file which contains the DB datasource step and I need to modify the highlighted part (or at least the <pass> property value) :

<con:config xsi:type="con:DataSourceStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <con:dataSource type="JDBC">
        <con:configuration>
          <driver>oracle.jdbc.driver.OracleDriver</driver>
          <connstr>${#Project#oracle_conn}</connstr>
          <pass>myFakePass</pass>
          <Connection>Oracle JDBC( QA )</Connection>
          <query>select * from myTable</query>
          <fetchSize/>
          <stored-procedure>false</stored-procedure>
        </con:configuration>
      </con:dataSource>
      <con:shared>true</con:shared>
      <con:restartShared>true</con:restartShared>
      <con:property>CSKEY</con:property>
      <con:startRow/>
      <con:endRow/>
      <con:recordsPerIteration>1</con:recordsPerIteration>
      <con:completeLastOperation>true</con:completeLastOperation>
      <con:trimValues>false</con:trimValues>
      <con:entitizeValues>false</con:entitizeValues>
      <con:restartOnRun>true</con:restartOnRun>
      <con:expandProperties>false</con:expandProperties>
    </con:config>

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Leader

Re: How to edit DBdatasource configuration

@Esox2 ,

 

1. In setup script set the value at Project or any desired Properties

2. Parameterize it in Config and fetch that value from Project level or wherever you have saved your password from setup script.

 


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

2 REPLIES 2
Highlighted
Community Leader

Re: How to edit DBdatasource configuration

@Esox2 ,

 

1. In setup script set the value at Project or any desired Properties

2. Parameterize it in Config and fetch that value from Project level or wherever you have saved your password from setup script.

 


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

Highlighted
New Contributor

Re: How to edit DBdatasource configuration

Actually your answer is completelly useless but thanks a lot for the answer !

New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Compete with community members in the TechCorner Challenge and get into the Leaderboard!

Rank Participant Points Earned
1 msiadak 12
2 nmrao 8
3 HimanshuTayal 3
Top Kudoed Authors