Can you re-run failed test cases in parallel using RobotFramework?

Asked
Active3 hr before
Viewed126 times

5 Answers

parallelusingfailedcases
90%

Disclaimer: I am neither an expert regarding the Robot Framework nor parallelization with Python, I simply found this possibility very use- (and learn-)ful and would like to share it whilst trying to explain how it works

Example_snippet/controller/utility/_parallel.js/ ${USER} test-user ... . .
$ {
   USER
}
test - user
   ...

   Login Test
Go To $ {
   HOMEPAGE
}
Wait Until Element Is Visible username
Input Text username $ {
   USER
}
Input Password password $ {
   PASSWORD
}
...
load more v
88%

Section names used to be space-insensitive, but that was deprecated in Robot Framework 3,1 and trying to use something like TestCases or S e t t i n g s causes an error in Robot Framework 3

Example_snippet/controller/utility/_parallel.js/ Copyright 2008-2015 Nokia Netw. . .
Copyright 2008 - 2015 Nokia Networks
Copyright 2016 - Robot Framework Foundation

Licensed under the Apache License, Version 2.0(the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http: //www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS"
BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License
for the specific language governing permissions and
limitations under the License.
load more v
72%

Parallel Testing With Robot Framework ,This post is the last in a series about Robot Framework, an automation test framework, In case you are not yet familiar with Robot Framework, you can take a look at the previous blogs about this topic:,We create a file

Example_snippet/controller/utility/_parallel.js/ import sys import time def wa. . .
import sys
import time

def wait_for_3s():
   time.sleep(3)

def wait_for_5s():
   time.sleep(5)

def wait_for_10s():
   time.sleep(10)

if __name__ == '__main__':
   actions = {
      'wait_for_3s': wait_for_3s,
      'wait_for_5s': wait_for_5s,
      'wait_for_10s': wait_for_10s
   }

action = sys.argv[1]
args = sys.argv[2: ]
actions[action]( * args)
load more v
65%

One solution could be to mark specific test cases failed during Suite Teardown, in which case the actual test cases will execute only the Request parts (and fail if request fails), register which requests were made together with the test case ID, and then let the Suite Teardown make the validations and retrospective fail the Test Cases that ended up failing,,The test suite should o my have P as the only test case

Example_snippet/controller/utility/_using.js/ --testlevelsplit. . .
--testlevelsplit
75%

If I re-execute the failed tests with the pabot --rerunfailed command then multiple instance of the same test is started for no reason, Other than that it runs the proper tests and creates a valid output

Example_snippet/controller/utility/_using.js/ *** Settings *** Library . . .
** * Settings ** *
   Library SeleniumLibrary
Test Setup Open Remote Chrome To Google
Test Teardown Close Browser

   **
   * Variables ** *
   $ {
      REMOTE_URL
   }
selenoid.acehu - dev.local / wd / hub
$ {
   URL
}
https: //google.com

   **
   * Keywords ** *

   Open Remote Chrome To Google
$ {
   DESIRED_CAPABILITIES
} = Create Dictionary
   ...browserName = chrome
   ...version = 74.0
   ...enableVideo = $ {
      False
   }
   ...enableVNC = $ {
      False
   }
   ...name = statrobot.chrome.dummy.$ {
      TEST NAME
   }

Open Browser $ {
   URL
}
Chrome remote_url = $ {
   REMOTE_URL
}
desired_capabilities = & {
   DESIRED_CAPABILITIES
}
Maximize Browser Window

   **
   * Test Cases ** *

   Simple failing test 1
Sleep 20 s
Fail Fail error 1

Simple failing test 2
Sleep 20 s
Fail Fail error 2

Simple passing test
Sleep 20 s