Skip to main content

Rational Functional Tester: Creating and Reading Datapool cell value in RFT

Hello,

Hope this will help for my friends who is trying to use data pool for dynamic values.If you want to use any run time values in between scripts then you will be looking for the functions to read/write/create datapool cells dynamically.



/************ Dp row count *************************/


IDatapoolIterator  ite;

ite.dpCurrent().getEquivalenceClass().getRecordCount();


/***************** to set cell value **************/


IDatapoolIterator it;

((DatapoolCell) it.dpCurrent().getCell("RunTimeSheetForContainers")).setCellValue("Y");




/*********** to load CSV files (csv to Datapool)*******************************/

public IDatapoolIterator LoadCSV(String Sname)
      {
            File fname=getFileName(Sname);
            IDatapool dp=DatapoolUtilities.loadCSV(fname,",",true);
            IDatapoolIterator ii=dpFactory().open(dp, null);
            ii.dpInitialize(dp);
            return ii;
           
      }




/*********** appending a record *********************************/
public IDatapoolIterator appendrecord(IDatapoolIterator it,String[][] dat)
{
IDatapoolEquivalenceClass equivalenceClass = (IDatapoolEquivalenceClass) it.getDatapool().getEquivalenceClass(it.getDatapool().getDefaultEquivalenceClassIndex() );
                  IDatapoolRecord dpRecord = equivalenceClass.constructRecord();
            if(dat!=null)
                  for(int i=0;i<dat.length;i++)
            {
            //    System.out.println("\""+dat[i][0]+"\"\""+dat[i][1]+"\"");
            ((DatapoolCell) dpRecord.getCell(dat[i][0])).setCellValue(dat[i][1]);
           
            }
            equivalenceClass.appendRecord(dpRecord);
           
            return it;
           
      }


Comments

  1. Replies
    1. IEEE Final Year Project centers make amazing deep learning final year projects ideas for final year students Final Year Projects for CSE to training and develop their deep learning experience and talents.

      IEEE Final Year projects Project Centers in India are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation.

      corporate training in chennai corporate training in chennai

      corporate training companies in india corporate training companies in india

      corporate training companies in chennai corporate training companies in chennai

      I have read your blog its very attractive and impressive. I like it your blog. Digital Marketing Company in Chennai Project Centers in Chennai

      Delete

Post a Comment

Popular posts from this blog

Jenkins CLI examples

Automate Jenkins with the CLI or the REST API Jenkins is used a lot to automate your build process and make it a real continuous integration process. But you can even take it a step further and automate the configuration of Jenkins itself.  In this short instruction I will show two ways to do this: the CLI and the REST API. With these capabilities you can for example write programs to create, backup, restore, start and view Jenkins jobs.  Download the Try-it-out-yourself code to provision an Ubuntu VM with Jenkins installed. This way you can immediately try the examples below.  The CLI   The Jenkins CLI is distributed inside the jenkins.war, but you have to download it before you can use it. Suppose your Jenkins url is: http://localhost:8080/jenkins Then the CLI can be downloaded like this:  wget http://localhost:8080/jenkins/jnlpJars/jenkins-cli.jar Note In the remainder of this document I assume the Jenkins url is http://localhost:8080/jenkins. You shoul

Jenkins Matrix Jobs

For many similar different combination build setup. Example Diff OS v/s Diff platform Configuration Matrix CHROME IE Test Module1 Test Module2 Test Module3 Test Module4 Plugin required:  matrix-project Wiki:  https://wiki.jenkins-ci.org/display/JENKINS/Matrix+Project+Plugin Location to download plugin: http://updates.jenkins-ci.org/download/plugins/ Install Plugin: Jenkins>Manage jenkins> Manage Plugin> Advansed> Browse and install Result Look like: Configuration: