assertions

How to perform soft assertion in Python using Selenium Webdriver

How to perform soft assertion in Python using Selenium Webdriver Question: I have written my selenium script in Python and i am verifying every page by the text “Home”… I am verifying it by hard assertion ,how can i modify it by using soft assertion so that if test fails it does not stop my …

Total answers: 2

AttributeError: 'module' object has no attribute 'TestCase'

AttributeError: 'module' object has no attribute 'TestCase' Question: I have file with unittest named: test.py My code: import unittest class Test(unittest.TestCase): def myTest(self): a = 1 self.assertEqual(a, 1) if __name__ == ‘__main__’: unittest.main() When I press F5, I get an error: Traceback (most recent call last): File “/home/mariusz/Pulpit/test.py”, line 1, in <module> import unittest File …

Total answers: 3

How to change the message in a Python AssertionError?

How to change the message in a Python AssertionError? Question: I’m writing per the following, in which I try to produce a decent error message when comparing two multiline blocks of Unicode text. The interior method that does the comparison raises an assertion, but the default explanation is useless to me I need to add …

Total answers: 4