python 2.7 - Automatic failing/non-execution of interdependent tests in Robot Framework -


If I have to say about 100 test cases, then which test case 24, 38 and 99 are dependent is. So, is it possible that when the 99th test case is being executed, you can find out the status of the test case previously executed (say 24th or 38th test case)? In my case, 99th Test case depends on status of 38th and 24th Test case and in this case, if either fails in either 24 or 38th, I have implemented the 99th test case at all and found in this way For the time I want to save a lot. Please, explain if possible with some examples. thank you in advanced!

"itemprop =" text ">

Once the robot starts running, there is some way to leave a test based on certain conditions is not. I think it is one of the robots' weaknesses, but the designer is not an inherent way to rely on another for testing.

However, the robot is very extensible, and an attribute that was introduced in version 2.8.5 makes it easy to write a keyword that fails if another test fails. This facility is a qualification for someone. With this, a library can keep track of / failed status of each test. With that knowledge, if any of your keywords are not immediately successful then some other tests fail to make.

The basic idea is, pass cache / (failing the position as the end of each exam special code _end_test ). After this, use this value to determine whether immediately or unsuccessful.

Here is an example of using such a keyword:

  *** settings *** | Library | / Path / to / dependencyLibrary.py *** Test case *** | Examples of failed tests. | Unsuccessful This test has failed. Example of a Dependent Exam | | [Setup] | Examination case requirement. Examples of failed tests. | Logs | Hello, world  

Here is a library definition:

ROBOT_LISTENER_API_VERSION = 2 ROBOT_LIBRARY_SCOPE = "Global "Def __init __ (self): self.ROBOT_LIBRARY_LISTENER = self self.test_status = {} DEF require_test_case (self, name): key = name.lower () (not in key self.test_status) if:. Builtin (failed) ("required test case not found: '% s'"% name) if (self.test_status [key]! = "PASS"): BuiltIn (). Failed ("required test case failed: '% s'"% name) is true Returning _end_test (self, name, attrs) def: self.test_status [name.lower ()] = attrs ["status"]

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -