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