If the worksheet is protected without a password, the password argument is ignored (so unprotection will succeed).
Workbook Is Protected
Description:
Check if the current workbook is protected
In:
-
Out:
whether the workbook is protected (true/false)
Example(s):
| workbook is protected |
Worksheet Is Protected
Description:
Check if the current worksheet is protected (with or without password)
In:
-
Out:
whether the worksheet is protected with a password (true/false)
Example(s):
| worksheet is protected |
Worksheet Is Protected With Password
Description:
Check if the current worksheet is protected with a password
In:
-
Out:
whether the worksheet is protected with a password (true/false)
Example(s):
| worksheet is protected with password |
Script Table Excel – Testing on Worksheet
Addresses can be in the format $A$1, A1 or a name
||Cell With Text
Description:|Find a cell containing text. Search is case insensitive.
In:|scope (Partial or Full), text to search
Out:|address of the first cell with the sought text.
Example(s):|\| $cell= \| Cell with \| full \| Text \| Costs Per Month \| \| $cell= \| Cell with \| partial \| Text \| Month \|
Note:|if the scope starts with Part then a partial match is done, other wise a full match.
Click Button
Description:
Click a button
In:
Name or caption of the button
Out:
whether the operation succeeded (true/false)
Example(s):
| Click button | Button 1 | | Click Button | Calculate Cost Per Year |
Throws an EvaluateException if Excel returns an error (#DIV/0!, #N/A, #NAME?, #NUM!, #REF!, #VALUE!)
Formula Of Cell
Description:
Get the formula of a certain cell
In:
cell address
Out:
formula of the cell
Example(s):
| check | Formula of cell | square | =B13^2 |
Last Cell
Description:
Get the address of the bottom right cell of the sheet
In:
-
Out:
The last cell on the worksheet (in $A$1 format)
Example(s):
| $last= | last cell |
Offset By Rows And Columns
Description:
Get the address of the range that is offset a number of columns and rows from the input range
In:
cell range, rows, columns
Out:
The offset range
Example(s):
| check | offset | A1 | by | 3 | rows and | 4 | columns | $E$4 |
Set Value Of Cell To
Description:
Set the value of a certain cell
In:
cell address, value
Out:
whether setting the value succeeded (true/false)
Example(s):
| Set value of cell | $A$1 | to | 23 |
Text Of Cell
Description:
Get the text in a certain cell
In:
cell address
Out:
value of the cell
Example(s):
| check | Text of cell | $B$13 | 347.2222 |
Note:
Different from Value Of Cell in that it returns the displayed text, not the actual value
Value Of Cell
Description:
Get the value of a certain cell
In:
cell address
Out:
value of the cell
Example(s):
| check | Value of cell | $B$13 | ~=347.22 |
Query Table: Excel Query
The query table fixture Excel Query allows you to extract a certain range on a worksheet, and compare these against an expected set of table values. It takes as parameter a reference to a script fixture where the correct worksheet was selected, a range to be extracted, and whether the first row is expected to contain headers (UseHeaders or something else). The page Query Based Excel Testing shows the details.