Highlight feature of Qxf2’s Page Object Model framework

Are you lost with locating the web elements while debugging your test script?  The highlight feature of Qxf2’s Page Object Model framework helps you to debug locators by giving a visual clue. This blog post will guide you with the steps involved in using the highlight feature of Qxf2’s Page Object Model framework in your test script.

The highlight feature in our framework will give you a visual clue of the test flow. On enabling the highlight feature, the web elements under test will be highlighted during test execution. A locator might match with exactly a single web element on a web page. It might match with multiple web elements as well like in the case of reading data from a table. The highlighting feature has been implemented for both scenarios.

Steps to invoke the highlight feature in your test script are:

  1. Fork and clone the Qxf2’s Page Object Model framework and follow the setup instructions detailed out in the Readme.md file. To jump start with creating your new project with our framework, you can refer to this blog post: How to start using the Qxf2’s framework with a new project
  2. Edit your test script to turn on or off the highlight feature as needed. Call the turn_on_highlight() method to enable the highlighting feature. Similarly, call the turn_off_highlight() method to disable the highlighting feature of the framework in your test script. The test script namely, test_example_form.py in our framework has been updated to include this feature
  3. Run your test script and you will have a visual highlighting that shows the flow of your test. A sample run of our test script namely, test_example_form.py is as follows:
    Open Git Bash and execute pytest -k example_form command. You will see the visual highlighting of the web element under test as in the image below.‌

Test result showing highlighting of web element


I hope this post helps you with debugging your test script!


I have done my Masters in Software Engineering and am currently working with Qxf2 Services. I have always looked forward to working with the various phases of the software development life cycle. I have been involved with the development and testing of applications inclined to the Banking domain. I am a very curious person. This curiosity has helped me to explore, learn a lot of new technologies and keep myself updated. Testing thrills me. I enjoy every bit of testing. Qxf2 has motivated me into blogging my work. I am an avid reader. I love travel and connecting with nature. My love for music instills a lot of positive energy and keeps me motivated!

Be First to Comment

Leave a Reply

Your email address will not be published.