1
votes

The following are 2 test cases at the bottom of my code.

Click correct answer 1
    Selenium2Library.Capture Page Screenshot
    Selenium2Library.Select Frame   xpath=//iframe[@title="QUIZ : QA VSTEST"]
    Selenium2Library.click element  xpath = //div[contains(@class,"ItemHeader") and descendant::div[text()="${Question1} "]]/..//div[@data-value="${Quiz1x}"]


Click correct answer 2
    [Documentation]     Capture Page Screenshot is recorded here as I use more than 1 libraries. Normally I do not need this command here.
    [Tags]  BugMute
    Selenium2Library.Unselect Frame
    Selenium2Library.Capture Page Screenshot
    Selenium2Library.Select Frame   xpath=//iframe[@title="QUIZ : QA VS TEST"]
    Selenium2Library.click element  xpath = //div[contains(@class, "ItemHeader") and descendant::div[text()="What describes best Testing "]]/..//div[@data-value="${Quiz2x}"]

I run the code from the command line using

pybot --exclude BugMute  itqa.robot

where itqa.robot is the name of my file. I do not understand why the test case "Click correct answer 2" shows as run in the log. I have the exclude command with the tag BugMute. This tag is in the test case.

My log file show that test case run (it failed but it doesn;t matter)

KEYWORD Click correct answer 2

Documentation: Capture Page Screenshot is recorded here as I use more than 1 libraries. Normally I do not need this command here. Tags: BugMute Start / End / Elapsed: 20161023 15:15:45.277 / 20161023 15:15:46.192 / 00:00:00.915 00:00:00.015 KEYWORD Selenium2Library . Unselect Frame

Documentation: Sets the top frame as the current frame. Start / End / Elapsed: 20161023 15:15:45.277 / 20161023 15:15:45.292 / 00:00:00.015 00:00:00.217 KEYWORD Selenium2Library . Capture Page Screenshot etc

Shouldn't the intepreter skipped the entire test case Click correct answer 2 ?

1
I tested your code and the Tag BugMute test was successfully excluded. I wonder why you see your Click correct answer 2 referred as KEYWORD. - Helio
Thank you so much. My bad, I had wrong heading. - Angelos Mavrogiannakis
If by chance you know how I can set up my pycharm editor with the exclude command it will be also great. I run for now on command line. - Angelos Mavrogiannakis
Sorry, but when I use PyCharm, I just go to its console and send the robot --exclude WhatEverTag path_to_my_test_suite.robot. - Helio
So is the Question answered now? - Psytho

1 Answers

2
votes

Notice that in the log it says "KEYWORD Click correct answer 2". You have this block of code in the *** Keywords*** section of your test file rather than the *** Test Cases *** section.