RF operation execl

I. Introduction

        On a blog written some RIDE to use interface test is a simple demo, in which we can find the data transfer is written dead inside, parametric if required on the need for transmission from the outside. I use excel to save the data to be transmitted, then I need to operate with rf to excel.

Second, the specific steps

        1, with the mounting robot framework excel library, robotframework-excellibrary: pip install robotframework-ExcelLibrary

        2, introduced ExcelLibrary RIDE library, the successful introduction of the black, as shown:

 

        3, I am here simply to write about my actions:

 

        Ⅰ, open excel files, with the back here is the absolute path to your local xls file. Note: Do not use xlsx file, be wrong.

        Ⅱ, 2 to 5 lines which are acquired excel file column (column) data representing the parameters Sheet page name and columns, the columns of the latter is represented by the index (index starts from 0), I have here is 2, which is to excel in the first three;

        Ⅲ, line 6 represents the number of rows with data acquisition excel current;

        Ⅳ, 9 to 13 lines with the FOR loop data to traverse it; wording is: FOR, note that front English colon, with the latter is a parameter representative of loop out data; IN RANGE representatives are circulated from the back of the range ; $ {count_row} is because traversing the index is 0, so I wrote a single 1 in front, so that you can skip the data field in the first row;

 

         Ⅴ, so that the data can traverse each line a.

Three, ExcelLibrary method Summary:

        Today, I put all the methods ExcelLibrary which made a sort of personal understanding there may be errors, for reference only:

method

Required parameters

Parametric form

Method Description

Add New Sheet

[newsheetname]

String

Add a new page Sheet

Add To Date

[ sheetname | column | row | numdays ]

String | int | int | int

Increase date

Check Cell Type

[ sheetname | column | row ]

String | int | int

Checking cell type

Create Excel Workbook

[newsheetname]

String

Create a new page Sheet

Get Column Count

[ sheetname ]

String

Gets the column of the total number of columns, the subscript is zero

Get Column Values

[ sheetname | column | includeEmptyCells=True ]

String | int | default=True

Obtaining data for each column

Get Number Of Sheets

 

 

Get all page number Sheet

Get Row Count

[ sheetname ]

String

Gets the number of rows row

Get Row Values

[ sheetname | row | includeEmptyCells=True ]

String | int | default=True

Obtaining data for each row

Get Sheet Names

 

 

Get the name of the page Sheet

Get Sheet Values

[ sheetname | includeEmptyCells=True ]

String | default=True

Get Data Sheet page

Get Workbook Values

[ includeEmptyCells=True ]

default=True

Get Data Sheet page

Modify Cell With

[ sheetname | column | row | op | val ]

String | int | int | operator | int

Modify Cell

Open Excel

[ filename | useTempDir=False ]

String | default=False

Open excel

Open Excel Current Directory

[ filename ]

String

Open excel file from the current directory

Put Date To Cell

[ sheetname | column | row | value ]

String | int | int | int

Date written to the cells,

Put Number To Cell

[ sheetname | column | row | value ]

String | int | int | int

Cell number is written to the

Put String To Cell

[ sheetname | column | row | value ]

String | int | int | String

Write the string to the cells,

Read Cell Data By Coordinates

[ sheetname | column | row ]

String | int | int

Reading cell data by the subscript (0,0)

Read Cell Data By Name

[ sheetname | cell_name ]

String  | String

Reading cell data, the coordinates (A, 2)

Save Excel

[ filename | useTempDir=False ]

String  | default=False

Save excel file

Save Excel Current Directory

[ filename ]

String 

In the current directory

Subtract From Date

[ sheetname | column | row | numdays ]

String | int | int | int

Date specified cell subtracting the number of days

PS: limited capacity, and he is still under study, to be a note, I hope you will be able to communicate together. 
----------------
Disclaimer: This article is CSDN blogger original article "MokWing", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/weixin_38374974/article/details/82704169

Guess you like

Origin www.cnblogs.com/czb529514/p/11585897.html