User:Casey.boydston/sandbox

Overview: This guide explains the necessary settings for developing iTest web based provisioning procedures = iTest Test Setup =




 * 1) Click on the Steps tab if not already there.


 * 1) Insert New Step into your test


 * 1) Change Action to Call


 * 1) Click the box at the end of the Description box




 * 1) Project:  Set Project From Table


 * 1) Procedure:  Set Procedure From Table


 * 1) Command Text:  Set Command Text From Table


 * 1) Click OK.




 * 1) Click on the Parameters tab


 * 1) Prov_csv:  Under the value column set the path to your config file.


 * 1) Click on Steps tab to return steps view.

'For ProvisionViaCsv Only  This is so you can use the DelAdtDevices procedure '


 * 1) Right Click procedure call => Insert => Insert Analysis Rule


 * 1) Change the procedure Regex to query with a description of get(“provInfoLists”)


 * 1) Change the procedure assert to store with a description of provInfoLists

= Setup web session in topology = 'Create a topology if none exists  Refer to iTest help or the iTest wiki if not familiar '
 * Add session profile to topology


 * Profile name (exp: WEB_10.59.62.115)


 * Session Type: Web


 * Check: Inherits properties from a session profile


 * Base Profile: project://SDVT_Assets/SessionProfiles/GenericSessions/TA5K/TA5K_Web_Basic.ffsp


 * Base URL: aka ip address


 * HTTP credentials: Username and Password

=Building CSV file Part 1 = Create a new csv file from a similar file or cookie cutter file.

The standard variable table header at this time: +type,vartype,var,creation,req,convert,isinarray,endvalue,label,descript,inputtype

''Note a csv is a comma delimited file. It contains one or more tables used by iTest to configure settings. Refer to the Provisioning PVTs in the iTest wiki.

'' Check to see if there is a cli procedure already created


 * If yes:


 * Utilize existing variable names


 * Examine existing itest procedures to see if they are needed


 * Create variable names based on similar procedures


 * Examine the TA_Config_Sample.csv found under the VerifyItemCSV’s folder


 * If no other example exists create name based on target id


 * If no:


 * Create variable names based on similar procedures


 * Examine the TA_Config_Sample.csv found under the VerifyItemCSV’s folder


 * If no other example exists create name based on target id

= Get Familiar with manually provisioning system =
 * Open a web based session.


 * Examine if multiple cards have the same settings to configure.


 * Navigate to the provisioning page for wanted settings.


 * Issue show table commands and look for embedded counters.


 * Complete provisioning of settings.


 * Complete deletion of settings.

''Note pages that are slow to load.  Note if counters reset when changing pages.  Note selection boxes that are dependent on earlier provisioning.  Note difference between creating and editing settings.  Note if no counter exists in table you can pull a table and then compare it to the next pull to see if table is loaded.  Note that if a counter exists when comparing a table to a previous pulled table it will not be a reliable way of checking for page load status.  Note how many rows are in each table and if the table has multiple pages.  Note that you may need to create some dummy settings in order to populate your table enough to determine how many rows are present and if it is a multi-page table.  Note: If you are designing a multi-platform compatible procedure you should check each platform to ensure that the navigation tabs are present. Often one platform will not have the exact same tabs. ''


 * '''Gotcha: If a setting is dependent on another setting then the provisioning and verifying will be fine, but when you begin deleting you will have issues.  Generally you will configure multiple settings and then delete said settings in same order as created meaning when you delete the first setting the second one is automatically removed.  To work around this you must add checks to see if you have already removed the provisioning or set your provTypeLookup.csv to do multiple provisions from one table and then only delete the settings that come before or after.  Exp:  You create both an evc and a evcmap with the same table, but you will only delete the evcmap.

'''


 * '''Gotcha: Check to see if target id’s are the same on different cards.  Best way to check is to copy and paste into notepad ++ then compare since sometimes the difference will not be immediately be noticeable.  Example:  id=cardpageTab_A or id=cardPageTab_A

'''


 * '''Gotcha: Examine the response from show table.  Sometimes a table will display the text "initialValue" to indicate that a table is still loading.  Sometimes this can be used to check if a table has completed loading, but if you are working on a procedure to configure a multi-platform setting the other device may not display this text.  Additionally, this text sometimes shows up even after the table has completely loaded.

'''


 * '''Gotcha: Look for disabled options that only appear after page is loaded.  Be warned these will sometimes no longer be disabled after a new release of firmware.

'''


 * '''Gotcha: Attempt to load a page as fast as possible.  Start from the Status page and then click on the navigation tabs as quickly as possible until you are at the desired location.  Verify it displays the correct data.  On some pages I have seen a page display page number two data for page number one.  Exp:  Igmp settings  page.  A work around if you find a page like this is a refresh within iTest.

'''


 * '''Gotcha: When creating a setting you set a field, but when you verify the field it displays info in a different way.   Exp:  setting selection boxes to GPON, but after you apply changes and go back to verify settings it displays remote devices.

'''

= iTest procedure development Part 1 = 'Decide if you will need a procedure in iTest to accomplish provisioning.  If No: Move on to Building CSV file part 2 '

1. Start in iTest by using a previously developed procedure that is very similar. Change procedure names, variable names, global variables, and paths.

2. Change target id’s so you navigate to the page you need.

3. Build procedure down to the part where you begin processing information in your tcl session.

4. In order to run the procedure you will need to simulate data flowing in. You do this by expanding main and setting up a procedure call and specifying what data should be present.

5. Run the procedure to populate.

6. Fix timing issues in navigation. Common fixes for timing issues * Hard coded sleep command.

* Describe a target then use analysis rules.

7. After correcting any navigation issues you will notice that your procedure will still fail. Do not worry since you have not finished the procedure yet.

8. Examine any show tables you are using.

9. Edit the response filters to remove any header rows.

10. Under step properties select response filters.

How to setup response filters *Often you will select: Exclude lines containing matches of the pattern.

*Often you will select: Regex.

*Often you will use this pattern: header1\s+header2\s+

*You may need more than one filter if there are multiple header rows.

*Often there are two show tables if it is a multi-page table. Both will need to be set up the same.

11. Run the procedure again and ensure the response reflects the filters.

= Designing tcl script = ''You generally will have two tcl commands. The first will populate variables and the second will actually do the work. They are both the same tclSession. ''
 * 1) Set up your variables in the first tcl command window.


 * 1) Run the procedure again.


 * 1) After completion look under the response tab and click details.


 * 1) Select all and copy.
 * 2) Then paste into a new notepad ++ document based off of a cookie cutter tcl file.


 * 1) Save your documents as filename.tcl in a specific directory. Exp:  C:\\temp


 * 1) Design your algorithm to parse though the data from the table and evaluate it.


 * 1) Open a cmd window.

''Note if you find that you have to return the results of more than one search you can create a truth table to help determine the most efficient way of returning said data. Additionally, this helps to insure you are preparing for any possible test case. ''
 * 1) Run script

'Two ways to run you script. '
 * First Method


 * In the cmd window type tclsh


 * Copy and paste your entire script in.


 * Benefit: Easier way to locate errors.


 * Drawback: Time consuming using copy and paste.


 * Second Method


 * In the cmd window cd C:\\yourfolder


 * Type tclsh filename.tcl


 * Benefits: Faster execution of script with no need to clear certain variables after execution.


 * Drawbacks: Harder to pinpoint errors sometimes.

'''**Gotcha: Evaluate what data the user will provide. Sometimes you may have to decide if information is required or optional.

'''

'''**Gotcha: Often you will need to determine what the page number and row number will be on a previously none-existing setting. You will need to determine how a page sorts info and create an algorithm that will match this. Additionally, under rare occasions you may have to delete a setting before you can create a new one so you will have to establish a triggering variable to use and will also have to emulate said changes in your data to return the correct page and row.

 **Gotcha: If you do not have the tcl interpreter refer to Active TCL Download Page found in the iTestWiki.

'''

'''After your script is operating correctly and providing correct responses you will need to add the AddManual and ReturnManual commands. '''
 * 1) Use the AddManual command like a set command for any data you wish to return from the tcl interpreter.


 * 1) Then add the line: ReturnManual FALSE "none" your_procedure_call_name


 * 1) Copy your tcl script into the 2nd tclSession in iTest.

= iTest Procedure development Part 2 =
 * Run the procedure again to view the return values.

'**Gotcha: The iTest tcl interpreter is not the same as the tcl interpreter you used when creating your script. For that reason you may have some issues with running your code in iTest. You may have to work around certain iTest specific variations. '

=Building CSV file Part 2 = You will have these standard tables in many csv files, but others can be added as needed.


 * Gotcha: On most tables you will have an index.  It is recommended that the index count up in increments of five or ten to allow for additional steps being added without re-numbering.

Action

Additional processing that is done on both new and current provisions.

Variable description table

Where variables are created

Variables created via iTest procedure table

Where the call to the itest procedure or procedures are issued which returns the information from iTest.

Build your “Variables created via iTest procedure table”.

+type,var,procretvar,uri,proc,procargs,argList,canFail,multiple

Use this to populate variables from the tcl script you wrote.

Build your sequence table based on information you know at this time.

Most should begin with PageNav and if multi-page table TableNav.

Use run variables in your sequence table to decide if a step should be executed.

[eval {if {condition(s)} {set temp true} else {set temp false}; set temp $temp}]
 * Gotcha : a good form for starting a run variable is:

Often with delete.csv you will need to adjust these sequences so that a run variable is present on each step.

Build your pageNav and tableNav tables based on each web pages specifics

Build your run and edit tables to the point where they converge and then become the same actions required for each. This is not always possible, but does happen often.


 * Gotcha: Be careful of create, clear, and apply buttons they can sometimes use the same target id and cause strange behavior.    Ideally there would only be one button for creating and editing.  Sometimes they will use the same target id for cancel, refresh, and retrieve buttons on the same page that can cause some issues.

Build the action table to modify settings that will need to be set whether creating or editing a system.

Build any additional tables you may need. Exp: A table to set a specific setting only when something is true.

=Modifying ProvTypeLookup and VerifyTypeLookup files =
 * Set up the ProvTypeLookup.csv and VerifyTypeLookup.csv files.


 * If a cli or snmp version exists add to that table the new web version.


 * Else setup a new table that will be used to reference your provisioning file.

=References =