Python Selenium Assertion Unicode – Assertion error

I have a problem with assertion in python + selenium. I have done test automation and it works fine till today. I got assertion error when I try to assert page title, below is a code

@step('I see main page') def step_impl(context): page_title = context.mubi_start_page.get_page_title() print(page_title) assert page_title.strip() == u'Mubi: Porównywarka OC AC - znajdź OC do 54% taniej!' 

Ane here is an output in the console

When I see main page                          # steps/mubi_steps.py:4 0.024s   Traceback (most recent call last):     File "/home/grru/.local/lib/python2.7/site-packages/behave/model.py", line 1329, in run       match.run(runner.context)     File "/home/grru/.local/lib/python2.7/site-packages/behave/matchers.py", line 98, in run       self.func(context, *args, **kwargs)     File "steps/mubi_steps.py", line 8, in step_impl       assert page_title.strip() == u'Mubi: Porównywarka OC AC - znajdź OC do 54% taniej!'   AssertionError      Captured stdout:   Mubi: Porównywarka OC AC - znajdź OC do 54% taniej! 

Any idea how to solve this issue?

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.