set a global variable code robotframework

robotframwork want to set a global variable, there are several ways that I know of:

1. In the code by providing the SET GLOBAL VARIABLE 

2. Set up a file in an external use, set the Variables, fill you want to use global variables

 

The second Case

1. level show

Under case under python3 directory, there are folders, as well as pub.txt

 

2.pub Methods

*** Settings ***
Library           ../jCacheTest.py

*** Keywords ***
delkey
    [Arguments]    ${key}    ${compareResult}=1
    @{result}    keydel    ${key}
    Run Keyword If    ${compareResult}==1    Should Be Equal As Integers    ${result[0][1]}    1

*** Variables ***
${NOKEY}    SET GLOBAL VARIABLE    zhangjun-nokey
${type_error}   str(WRONGTYPE Operation against a key holding the wrong kind of value)
${SpecialKey}     zset*%(1.

 The reference 3.case

 Mainly the introduction of the right path, directly call the variable name on it

Settings *** *** 
Documentation XXX 
Resource ../pub.txt # path should pay attention, because the pub in the use of class layer, is a layer on all directory 

methos_ method name 
    # get key content of the following is your The method, however 
    @ {Result} zset_zrevrange $ {NOKEY}. 1. 1 
    # return value 
    Should of Be Equal of As Numbers $ {Result [0] [0]}. 4 
    Should of Be Empty $ {Result [0] [. 1]} 
    Keydel $ {NOKEY}

  

 

Guess you like

Origin www.cnblogs.com/chongyou/p/12092825.html