Thursday, February 9, 2017

Creating First Script in OpenScript

Steps To Create First Script
1)Create Repository (Folder Structure)
2)Create web script
3)Record code for word search in google
4)Playback
5)Review the results

1) Repository
Repository is a storage area where we can place all our automation files which includes test scripts, databanks, object libraries, jar files and function libraries etc...

Creation of Repository
It is like a normal folder creation. Create a Root folder with name MyScripts under this create sub folders like FunctionLibrary,TestScripts,Jars,Databanks,ObjectLibraries (You can give any name for these folders as per you convenience)

Folder Structure
   MyScripts                     (Root Folder)
-> FunctionLibrary (Sub Folder)
-> TestScripts         (Sub Folder)
-> Jars                     (Sub Folder)
-> Databanks          (Sub Folder)
-> ObjectLibraries  (Sub Folder)

Place the above folder structure in Location : C:\OracleATS\OFT

Attach Repository to OpenScript
Goto Tools->Manage Repositories->Add, Browse Root Folder and Provide Name





















click OK.

Repository Creation and attached to the openscript is completed.

2)Create web script(will update)

Monday, February 6, 2017

Function Library

Function Library is used to create reusable functions and we can use these functions across the scripts.

Creation of Functional Library
  • Go to File -> New -> Select Web (under Functional Testing Section)
  • Click Next
  • Select My Repositories -> Default and Give Script name (It can be any name)
  • Select Create Script as Function Library check box and click Next
  • Provide Package and Class name and click Finish then Function Library will be created.

Data Table

In Open Script Data tables can be used to store test data and pass to the test script.

Creation of Data Table
          Go to Script -> Script Properties -> Modules -> Check Data Table from Modules list. Next go to View and select Data table then Data Table added to your script.

Syntax
          String empid=datatable.getValue(i, "Emp Id").toString().trim() or
          String empid=datatable.getValue(“Sheet1”, i, "Emp Id").toString().trim();

Next Topic : Function Library

Friday, May 6, 2016

In detail about Assets View

Generally OpenScript consists of 4 types of Assets

1) Databanks
                Databanks can be .csv file or database using this we can store our test data and pass to the script.

Creation of Databank

Select Assets Tab -> Select Databanks ->Click Add ->Select CSV file ->Select My Repositories -> Default ->databanks then give File name (It can be any name) in File: text box and click OK. Your databank file will be created.

2) Object Libraries
                Object Library is a file where we can store all the xpaths of our application under test. Xpaths will be stored in this file in the form of name value pairs. Using object libraries we can avoid duplication of the xpaths and reuse the existing xpaths for same web elements.

Creation of Object Libraries

Select Assets Tab -> Select Object Libraries -> Click Add -> Select My Repositories -> Default then give File name (It can be any name) in File: text box and click OK. Your Object Library will be created.

3) JAR Files
                 If you want add any jar files for your script you can add in this section.

4) Scripts
                 If you want to add any child scripts and functional Libraries to your script you can add in this section. We can discuss more about functional libraries and child scripts in coming posts.

Next Topic : Data Tables

Views in OpenScript

Views in OpenScript

Each script has three views in OpeScript as follows.
  • Tree View
  • Java Code View
  • Assets View

Tree View
                In this view we can see the nodes for each statement in the java code view. So using this Tree view we can understand the action of each statement in the java code view.
Java Code View
                In this view we can see the java code generated by the OpenScript. If we want to edit the java code as per our requirement we can do editing in java code view.
Assets View
                In This View we can add the assets to script if required. Generally OpenScript consists 4 types of Assets as follows.
  • Databanks
  • Object Libraries
  • Jars
  • Scripts
Next Topic : In Detail About Assets View