SIkuliXIDE; Mojave; Robot Framework: How to skip execution of some tests

Asked by Melvin Raymond

I am currently running inline Test Cases from the SikuliX IDE with Robot Framework. I am working on a third test case and have created some new functions in Jython so I can create this third Test Case.

What I want to accomplish is to not execute Test 1 and Test 2, so I can get my new functions working in Robot Framework with Test 3 so I don't have to watch all my Tests execute. I could potentially set up a single Test Case framework but was hoping to find a way to not execute the first 2 Test Cases so I can focus on just the last one.

I looked at Tags and Exclude but didn't seem to figure out how to work that into the SikuliX IDE on the RFW.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Melvin Raymond
Solved:
Last query:
Last reply:
Revision history for this message
Melvin Raymond (fribian) said :
#1

OK, I've solved this one on my own. I found some videos by Raghav Pal out on Automation Step by Step that were very helpful. I was on the right track with Tags. So if you're using Robot Framework in SikuliX or even Eclipse, there are Tags and some built in Tags that work to filter out and sub divide the Robot Framework output. so first of all you can set a Default Tags in your *** Settings *** area. Then you can set Set Tags and Remove Tags on each Test Case however you like. See my example code below where I have done the following:

I used the one below to set a tag for the entire Suite (in the *** Settings *** area)
Set Default. regression

I used the tags below to set each Test Case to filer or prevent execution (on each Test Case)
Set Tags smoke
Set Tags. decimalplaces
Remove Tags. decimal places
Set Tags. significant figures

So, look at Robot Framework below and you can see how they were used.

runScript("""
robot
*** Variables ***
${TESTAPP} "/Applications/Vernier Graphical Analysis.app"
${MOVERIGHT} 1
${MOVELEFT} 2
${MOVEUP} 3
${MOVEDOWN} 4
${dataread} 0
${FILE_MENU_ICON} "1555692283641-1.png"
${NEW_EXPERIMENT} "1555962157452.png"
${OPEN} "1555962265203.png"
${SAVE} "Save.png"
${SAVE_AS} "Save_as.png"
${EXPORT} "Export.png"
${SENSOR_DATA_COLLECTION} "1555691564522.png"
${DATA_SHARING} "1555691823466.png"
${MANUAL_ENTRY} "1552920539474-1.png"
${DONT_SAVE} "1555522339410.png"
${VIEW_OPTIONS} "1554417637341.png"
${TABLE} "1555540656731.png"
${GRAPH_AND_TABLE} "1557338044306.png"
 ${TABLE_LOCATOR} "1554927130857.png"
${CELL_LOCATOR} "1555018341756.png"
${COPY} "1555082199999.png"
${PASTE} "1555082795597.png"
${2.000} "1556290290889.png"
${31.500} "1556290326549.png"
${55.670} "1556290373423.png"
${888.901} "1556290403890.png"
${2.000000000} "1557259340497.png"
${31.5} "1557259376082.png"
${55.67000} "1557259785433.png"
${888.901000} "1557260595486.png"
${55.7} "1557260805979.png"
${6e+1} "1557260970245.png"
${8.889e+2} "1557349532033.png"
${2.000e+0} "1557349591857.png"
${DATA_SET_1} "DATA_SET_1.png"
${COLUMN_X} 1
${COLUMN_Y} 2
${OVERFLOW} "OVERFLOW.png"
${T_VIEW} 1
${GT_VIEW} 2
${APP_REGION} Region(766,367,1030,710)
${T_X_REGION} Region(820,467,120,50)
${T_Y_REGION} Region(920,467,120,50)
${GT_X_REGION} Region(1570,467,120,50)
${GT_Y_REGION} Region(1670,467,120,50)
${COLUMN_OPTIONS} "COLUMN_OPTIONS.png"
${ADD_MANUAL_COLUMN} "ADD_MANUAL_COLUMN.png"
${ADD_CALCULATED_COLUMN} "ADD_CALCULATED_COLUMN.png"
${DECIMAL_PLACES_RADIO} "DECIMAL_PLACES-1.png"
${SIGNIFICANT_FIGURES_RADIO} "SIGNIFICANT_FIGURES-1.png"
${SPINNER} "SPINNER.png"
${APPLY} "APPLY.png"
${OPTIONS_EXIT} "1555713139282.png"
${COLUMN_OPTIONS_WINDOW} "COLUMN_OPTIONS_WINDOW.png"
${CHECKBOX_OFF} "CHECKBOX_OFF.png"
${CHECKBOX_ON} "CHECKBOX_ON.png"

*** Settings ***
Library ./inline/GA4
Suite Setup Suite Setup Actions
Suite Teardown Suite Teardown Actions
Test Teardown Test Case Tear Down
Default Tags regression

*** Test Cases ***
Test Manual Copy and Paste to Cell
    [Documentation] Test Case to do a manual copy and paste to cell (Table view)
    Set Tags smoke
    Log Executing Manual Copy and Paste to Cell Test (Table view)
    InitTableViewManual_KW
    write to selected cell ${CELL_LOCATOR} 2
    grid movement ${MOVEDOWN} 1
    write to selected cell ${CELL_LOCATOR} 31.5
    grid movement ${MOVEDOWN} 1
    write to selected cell ${CELL_LOCATOR} 55.67
    grid movement ${MOVEDOWN} 1
    write to selected cell ${CELL_LOCATOR} 888.901
    grid movement ${MOVEUP} 3
    cut copy paste ${CELL_LOCATOR} ${COPY}
    grid movement ${MOVERIGHT} 1
    grid movement ${MOVEDOWN} 3
    cut copy paste ${CELL_LOCATOR} ${PASTE}
    ${dataread} = read from selected cell ${CELL_LOCATOR}
    compare expected value to clipboard ${dataread} 2

Test Manual Default Decimal Place values (Table view)
    [Documentation] Test Case verifies data in cells for Default Decimal Place 3
    Set Tags decimalplaces
    Remove Tags decimalplaces
    Log Executing Manual Decimal Place values Test
    InitTableViewManual_KW
    write to selected cell ${CELL_LOCATOR} 2
    grid movement ${MOVEDOWN} 1
    write to selected cell ${CELL_LOCATOR} 31.5
    grid movement ${MOVEDOWN} 1
    write to selected cell ${CELL_LOCATOR} 55.67
    grid movement ${MOVEDOWN} 1
    write to selected cell ${CELL_LOCATOR} 888.901
    grid movement ${MOVEDOWN} 1
    grid movement ${MOVEUP} 1
    verify selected cell ${888.901}
    grid movement ${MOVEUP} 1
    verify selected cell ${55.670}
    grid movement ${MOVEUP} 1
    verify selected cell ${31.500}
    grid movement ${MOVEUP} 1
    verify selected cell ${2.000}

Test Manual Decimal Place Values Test (Table View)
    [Documentation] Test verifies Decimal Place setting
    Set Tags decimalplaces
    Remove Tags decimalplaces
    Log Executing Manual Decimal Place values Test
    Log Filling the Data Table with some values
    InitTableViewManual_KW
    write to selected cell ${CELL_LOCATOR} 2
    grid movement ${MOVEDOWN} 1
    write to selected cell ${CELL_LOCATOR} 31.5
    grid movement ${MOVEDOWN} 1
    write to selected cell ${CELL_LOCATOR} 55.67
    grid movement ${MOVEDOWN} 1
    write to selected cell ${CELL_LOCATOR} 888.901
    grid movement ${MOVEDOWN} 1
    grid movement ${MOVEUP} 1
    Log Selecting Decimal Place from Column Options dialog
    Column_Options_TView_Default_KW
    select displayed precision ${DECIMAL_PLACES_RADIO} ${SPINNER} 9 ${APPLY} ${OPTIONS_EXIT}
    grid movement ${MOVEUP} 3
    verify selected cell ${2.000000000}
    Column_Options_TView_Default_KW
    select displayed precision ${DECIMAL_PLACES_RADIO} ${SPINNER} 1 ${APPLY} ${OPTIONS_EXIT}
    grid movement ${MOVEDOWN} 1
    verify selected cell ${31.5}
    Column_Options_TView_Default_KW
    select displayed precision ${DECIMAL_PLACES_RADIO} ${SPINNER} 5 ${APPLY} ${OPTIONS_EXIT}
    grid movement ${MOVEDOWN} 1
    verify selected cell ${55.67000}

Test Significant Figure Values Test (Table View)
    [Documentation] Test Significant Figures settings
    Set Tags significantfigures
    Log Executing Manual Significant Figure values Test
    Log Filling the Data Table with some values
    InitTableViewManual_KW
    write to selected cell ${CELL_LOCATOR} 2
    grid movement ${MOVEDOWN} 1
    write to selected cell ${CELL_LOCATOR} 31.5
    grid movement ${MOVEDOWN} 1
    write to selected cell ${CELL_LOCATOR} 55.67
    grid movement ${MOVEDOWN} 1
    write to selected cell ${CELL_LOCATOR} 888.901
    grid movement ${MOVEDOWN} 1
    grid movement ${MOVEUP} 1
    Log Selecting Significant Figures from Column Options dialog
    Column_Options_TView_Default_KW
    select displayed precision ${SIGNIFICANT_FIGURES_RADIO} ${SPINNER} 9 ${APPLY} ${OPTIONS_EXIT}
    verify selected cell ${888.901000}
    Column_Options_TView_Default_KW
    select displayed precision ${SIGNIFICANT_FIGURES_RADIO} ${SPINNER} 3 ${APPLY} ${OPTIONS_EXIT}
    grid movement ${MOVEUP} 1
    verify selected cell ${55.7}
    Column_Options_TView_Default_KW
    select displayed precision ${SIGNIFICANT_FIGURES_RADIO} ${SPINNER} 1 ${APPLY} ${OPTIONS_EXIT}
    verify selected cell ${6e+1}

Test Scientific Notation Test (Graph Table View)
    [Documentation] Test verifies a couple of cells with Scientific Notation
    Set Tags scientificnotation
    Log Executing Scientific Notation Test Test
    Log Filling the Data Table with some values
    select experiment type ${MANUAL_ENTRY}
    initialize table ${TESTAPP} ${TABLE_LOCATOR}
    write to selected cell ${CELL_LOCATOR} 2
    grid movement ${MOVEDOWN} 1
    write to selected cell ${CELL_LOCATOR} 31.5
    grid movement ${MOVEDOWN} 1
    write to selected cell ${CELL_LOCATOR} 55.67
    grid movement ${MOVEDOWN} 1
    write to selected cell ${CELL_LOCATOR} 888.901
    grid movement ${MOVEDOWN} 1
    grid movement ${MOVEUP} 1
    Column_Options_TGView_Default_KW
    toggle scientific notation ${COLUMN_OPTIONS_WINDOW} ${CHECKBOX_ON} ${CHECKBOX_OFF} ${APPLY}
    verify selected cell ${8.889e+2}
    grid movement ${MOVEUP} 3
    verify selected cell ${2.000e+0}

*** Keywords ***
Suite Setup Actions
    Log Suite Setup Actions done below
    start my application ${TESTAPP}
    define application region

Suite Teardown Actions
    Log Suite Teardown Actions done below
    stop my application ${TESTAPP} ${DONT_SAVE}

Test Case Tear Down
    Log Test Teardown Actions done below
    file menu ${FILE_MENU_ICON} ${NEW_EXPERIMENT} ${DONT_SAVE}

InitTableViewManual_KW
    select experiment type ${MANUAL_ENTRY}
    view options ${VIEW_OPTIONS} ${TABLE}
    initialize table ${TESTAPP} ${TABLE_LOCATOR}

Column_Options_TView_Default_KW
    column options context menu ${T_VIEW} ${DATA_SET_1} ${COLUMN_X} ${T_X_REGION} ${OVERFLOW} ${APP_REGION}
    select column context ${COLUMN_OPTIONS} ${OPTIONS_EXIT}

Column_Options_TGView_Default_KW
    column options context menu ${GT_VIEW} ${DATA_SET_1} ${COLUMN_X} ${GT_X_REGION} ${OVERFLOW} ${APP_REGION}
    select column context ${COLUMN_OPTIONS} ${OPTIONS_EXIT}

""")

Revision history for this message
Melvin Raymond (fribian) said :
#3

So for the above Robot Framework, it will run everything but the decimalplaces Test Cases and it will filter the output by "regression", "smoke", "significantfigures", and "scientificnotation", but will skip executing the "decimalplaces" Test Cases.

Revision history for this message
RaiMan (raimund-hocke) said :
#4

ok, and where do you think there is a problem?

Revision history for this message
Melvin Raymond (fribian) said :
#5

Thanks for the reply RaiMan. I solved it. The original problem was I did not understand how to skip tests in Robot Framework. But once I figured it out with Tags I posted the solution here for those that might have the same question. There is no problem now, so this could be closed. I now have some understanding how to use Tags to skip tests I don't wish to execute.

Revision history for this message
RaiMan (raimund-hocke) said :
#6

thanks for the clarification.

this thread is tagged as solved, which means closed