robotframework Excel Library关键字

Keywords

Keyword Arguments Documentation
Add New Sheet newsheetname
Creates and appends new Excel worksheet using the new sheet name to the current workbook.

Arguments:

New Sheet name (string) The name of the new sheet added to the workbook.

Example:

Keywords Parameters
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls
Add New Sheet NewSheet
Add To Date sheetname, column, row, numdays
Using the sheet name the number of days are added to the date in the indicated cell.

Arguments:

Sheet Name (string) The selected sheet that the cell will be modified from.
Column (int) The column integer value that will be used to modify the cell.
Row (int) The row integer value that will be used to modify the cell.
Number of Days (int) The integer value containing the number of days that will be added to the specified sheetname at the specified column and row.

Example:

Keywords Parameters      
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls      
Add To Date TestSheet1 0 0 4
Check Cell Type sheetname, column, row
Checks the type of value that is within the cell of the sheet name selected.

Arguments:

Sheet Name (string) The selected sheet that the cell type will be checked from.
Column (int) The column integer value that will be used to check the cell type.
Row (int) The row integer value that will be used to check the cell type.

Example:

Keywords Parameters    
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls    
Check Cell Type TestSheet1 0 0
Create Excel Workbook newsheetname
Creates a new Excel workbook

Arguments:

New Sheet Name (string) The name of the new sheet added to the new workbook.

Example:

Keywords Parameters
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls
Create Excel NewExcelSheet
Get Column Count sheetname
Returns the specific number of columns of the sheet name specified.

Arguments:

Sheet Name (string) The selected sheet that the column count will be returned from.

Example:

Keywords Parameters
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls
Get Column Count TestSheet1
Get Column Values sheetname, column, includeEmptyCells=True
Returns the specific column values of the sheet name specified.

Arguments:

Sheet Name (string) The selected sheet that the column values will be returned from.
Column (int) The column integer value that will be used to select the column from which the values will be returned.
Include Empty Cells (default=True) The empty cells will be included by default. To deactivate and only return cells with values, pass ‘False‘ in the variable.

Example:

Keywords Parameters  
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls  
Get Column Values TestSheet1 0
Get Number Of Sheets  
Returns the number of worksheets in the current workbook.

Example:

Keywords Parameters
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls
Get Number of Sheets  
Get Row Count sheetname
Returns the specific number of rows of the sheet name specified.

Arguments:

Sheet Name (string) The selected sheet that the row count will be returned from.

Example:

Keywords Parameters
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls
Get Row Count TestSheet1
Get Row Values sheetname, row, includeEmptyCells=True
Returns the specific row values of the sheet name specified.

Arguments:

Sheet Name (string) The selected sheet that the row values will be returned from.
Row (int) The row integer value that will be used to select the row from which the values will be returned.
Include Empty Cells (default=True) The empty cells will be included by default. To deactivate and only return cells with values, pass ‘False‘ in the variable.

Example:

Keywords Parameters  
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls  
Get Row Values TestSheet1 0
Get Sheet Names  
Returns the names of all the worksheets in the current workbook.

Example:

Keywords Parameters
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls
Get Sheets Names  
Get Sheet Values sheetname, includeEmptyCells=True
Returns the values from the sheet name specified.

Arguments:

Sheet Name (string) The selected sheet that the cell values will be returned from.
Include Empty Cells (default=True) The empty cells will be included by default. To deactivate and only return cells with values, pass ‘False‘ in the variable.

Example:

Keywords Parameters
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls
Get Sheet Values TestSheet1
Get Workbook Values includeEmptyCells=True
Returns the values from each sheet of the current workbook.

Arguments:

Include Empty Cells (default=True) The empty cells will be included by default. To deactivate and only return cells with values, pass ‘False‘ in the variable.

Example:

Keywords Parameters
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls
Get Workbook Values  
Modify Cell With sheetname, column, row, op, val
Using the sheet name a cell is modified with the given operation and value.

Arguments:

Sheet Name (string) The selected sheet that the cell will be modified from.
Column (int) The column integer value that will be used to modify the cell.
Row (int) The row integer value that will be used to modify the cell.
Operation (operator) The operation that will be performed on the value within the cell located by the column and row values.
Value (int) The integer value that will be used in conjuction with the operation parameter.

Example:

Keywords Parameters        
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls        
Modify Cell With TestSheet1 0 0 * 56
Open Excel filename, useTempDir=False
Opens the Excel file from the path provided in the file name parameter. If the boolean useTempDir is set to true, depending on the operating system of the computer running the test the file will be opened in the Temp directory if the operating system is Windows or tmp directory if it is not.

Arguments:

File Name (string) The file name string value that will be used to open the excel file to perform tests upon.
Use Temporary Directory (default=False) The file will not open in a temporary directory by default. To activate and open the file in a temporary directory, pass ‘True‘ in the variable.

Example:

Keywords Parameters
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls
Open Excel Current Directory filename
Opens the Excel file from the current directory using the directory the test has been run from.

Arguments:

File Name (string) The file name string value that will be used to open the excel file to perform tests upon.

Example:

Keywords Parameters
Open Excel ExcelRobotTest.xls
Put Date To Cell sheetname, column, row, value
Using the sheet name the value of the indicated cell is set to be the date given in the parameter.

Arguments:

Sheet Name (string) The selected sheet that the cell will be modified from.
Column (int) The column integer value that will be used to modify the cell.
Row (int) The row integer value that will be used to modify the cell.
Value (int) The integer value containing a date that will be added to the specified sheetname at the specified column and row.

Example:

Keywords Parameters      
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls      
Put Date To Cell TestSheet1 0 0 12.3.1999
Put Number To Cell sheetname, column, row, value
Using the sheet name the value of the indicated cell is set to be the number given in the parameter.

Arguments:

Sheet Name (string) The selected sheet that the cell will be modified from.
Column (int) The column integer value that will be used to modify the cell.
Row (int) The row integer value that will be used to modify the cell.
Value (int) The integer value that will be added to the specified sheetname at the specified column and row.

Example:

Keywords Parameters      
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls      
Put Number To Cell TestSheet1 0 0 34
Put String To Cell sheetname, column, row, value
Using the sheet name the value of the indicated cell is set to be the string given in the parameter.

Arguments:

Sheet Name (string) The selected sheet that the cell will be modified from.
Column (int) The column integer value that will be used to modify the cell.
Row (int) The row integer value that will be used to modify the cell.
Value (string) The string value that will be added to the specified sheetname at the specified column and row.

Example:

Keywords Parameters      
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls      
Put String To Cell TestSheet1 0 0 Hello
Read Cell Data By Coordinates sheetname, column, row
Uses the column and row to return the data from that cell.

Arguments:

Sheet Name (string) The selected sheet that the cell value will be returned from.
Column (int) The column integer value that the cell value will be returned from.
Row (int) The row integer value that the cell value will be returned from.

Example:

Keywords Parameters    
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls    
Read Cell TestSheet1 0 0
Read Cell Data By Name sheetname, cell_name
Uses the cell name to return the data from that cell.

Arguments:

Sheet Name (string) The selected sheet that the cell value will be returned from.
Cell Name (string) The selected cell name that the value will be returned from.

Example:

Keywords Parameters  
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls  
Get Cell Data TestSheet1 A2
Save Excel filename, useTempDir=False
Saves the Excel file indicated by file name, the useTempDir can be set to true if the user needs the file saved in the temporary directory. If the boolean useTempDir is set to true, depending on the operating system of the computer running the test the file will be saved in the Temp directory if the operating system is Windows or tmp directory if it is not.

Arguments:

File Name (string) The name of the of the file to be saved.
Use Temporary Directory (default=False) The file will not be saved in a temporary directory by default. To activate and save the file in a temporary directory, pass ‘True‘ in the variable.

Example:

Keywords Parameters
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls
Save Excel NewExcelRobotTest.xls
Save Excel Current Directory filename
Saves the Excel file from the current directory using the directory the test has been run from.

Arguments:

File Name (string) The name of the of the file to be saved.

Example:

Keywords Parameters
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls
Save Excel Current Directory NewTestCases.xls
Subtract From Date sheetname, column, row, numdays
Using the sheet name the number of days are subtracted from the date in the indicated cell.

Arguments:

Sheet Name (string) The selected sheet that the cell will be modified from.
Column (int) The column integer value that will be used to modify the cell.
Row (int) The row integer value that will be used to modify the cell.
Number of Days (int) The integer value containing the number of days that will be subtracted from the specified sheetname at the specified column and row.

Example:

Keywords Parameters      
Open Excel C:\Python27\ExcelRobotTest\ExcelRobotTest.xls      
Subtract From Date TestSheet1 0 0 7

原文地址:https://www.cnblogs.com/Yanss/p/12172920.html

时间: 2024-10-08 19:37:43

robotframework Excel Library关键字的相关文章

RobotFramework --Resources创建关键字文件

RIDE是robotframework的图形操作前端,我们在RIDE上进行测试用例设计和编写测试脚本,并执行自动化测试.下面来全面的认识下这个操作工具. 在右边编辑页面有三大模块,Edit,TextEdit,Run Edit页签     测试项目和测试套件的Edit是一样的   之前我们导入相关的库就是在Edit页签下导入库 导入外部文件: Add Library: 导入测试库,主要是\Lib\site-packages这个目录下面的库 Add Resource:导入相关资源,跟项目相关的一些资

robotframework 自定义library

作用说明:本例中自定义的library作用就是从Redis中获取短信验证码. 1.在D:\I_python\Python27\Lib\site-packages(这个路径一定要在系统path路径中)下面创建一个CustomRedisClient文件夹 2.在该文件夹下创建两个文件,分别是__init__.py以及getcodefromredis.py(其中需要先安装redis和regex) 代码如下 getcodefromredis.py: 1 #-*- coding:utf-8 -*- 2 '

贯穿RobotFramework框架 - 关键字(一) 最全面的疏理

在RF中,关键字是一个非常重要的存在.想做任何事情,都是通过关键字来实现的. 这篇文章对RobotFramework中的关键字做个整理.大概分为以下几点内容: 1.什么是关键字 2.关键字来自哪里.有哪些类型 3.如何使用关键字 4.如何定义用户关键字 5.资源文件使用 1.什么是关键字 总结一句话:一个关键字实现了单一的功能. 使用一个关键字,就等于是去使用了一个功能. 例如,在生活中,做饭使用了厨房,睡觉使用了床,出行使用了公交等等. 一样的道理 ,那在RF中,输出文本使用了关键字:log:

Delphi常用关键字用法详解

absolute: ? 1 2 3 4 5 6 7 8 9 10 //它使得你能够创建一个新变量, 并且该变量的起始地址与另一个变量相同. var Str: string[32]; StrLen: Byte absoluteStr; //这个声明指定了变量StrLen起始地址与Str相同. //由于字符串的第0个位置保存了字符串的长度, 所以StrLen的值即字符串长度. begin Str := 'abc'; Edit1.Text := IntToStr(StrLen); end; abstr

ThirdParty Library

(1)LibXL: C++ Excel Library to read/write xls/xlsx files

[从产品角度学EXCEL 02]-EXCEL里的树形结构

这是<从产品角度学EXCEL>系列第三篇. 前言请看: 0 为什么要关注EXCEL的本质 1 excel是怎样运作的 或者你可以去微信公众号@尾巴说数 获得连载目录. 本文仅由尾巴本人发布于特定网站.不接受任何无授权转载,如需转载,请先联系我,非常感谢. 2 EXCEL里的树形结构 这段时间,上海街边的树上陆陆续续长出了嫩芽,放眼望去有各种层次的绿色,格外好看.我们今天的话题,恰好也与树有关.只不过,树都是往天空伸展枝叶的,而我们这里讨论的‘树’,却是由根部出发,逐行逐行往下延展.伸展. 还记

Delphi 关键字详解

absolute//它使得你能够创建一个新变量, 并且该变量的起始地址与另一个变量相同. var   Str: string[32];   StrLen: Byte absolute Str; //这个声明指定了变量StrLen起始地址与Str相同. //由于字符串的第0个位置保存了字符串的长度, 所以StrLen的值即字符串长度. begin   Str := 'abc';   Edit1.Text := IntToStr(StrLen); end; abstract//它允许你创建抽象的方法

delphi关键字

转自:http://www.cnblogs.com/zengyou/p/5842909.html absolute: 1 2 3 4 5 6 7 8 9 10 //它使得你能够创建一个新变量, 并且该变量的起始地址与另一个变量相同. var  Str: string[32];  StrLen: Byte absoluteStr; //这个声明指定了变量StrLen起始地址与Str相同. //由于字符串的第0个位置保存了字符串的长度, 所以StrLen的值即字符串长度. begin Str :=

【转】Delphi 关键字详解

absolute //它使得你能够创建一个新变量, 并且该变量的起始地址与另一个变量相同. var Str: string[32]; StrLen: Byte absolute Str; //这个声明指定了变量StrLen起始地址与Str相同. //由于字符串的第0个位置保存了字符串的长度, 所以StrLen的值即字符串长度. begin Str := 'abc'; Edit1.Text := IntToStr(StrLen); end; abstract //它允许你创建抽象的方法, 包括有抽