I need to click on the Ok button on a page (HTML code snippet hereunder). The button itself does not have an Id and its XPath changes. It can be any of the following: The only stable locator I can find in the page is the noresultsfound Id of the div before the div that contains the button as a
Tag: automated-tests
How to test authenticated POST request with Pytest in Django
I want to test an authenticated post request on an API using Pytest. This is what I am doing so far: This doesn’t work because it gives me back a 401 (Unauthorized) instead of a 200. That makes sense since the fixture is a client and not an admin client. Yet if I pass in admin_client instead of client i…
TFS 2018 API (4.1 version) – Python : Can’t add an attachment in a result of a run using either 4.1 or 5.1 version
I have managed to send my test results from my automation python script to TFS 2018 by creating a run and adding results to it. Now, I am trying to upload the xml file I produce with the detailed results of the test execution using the Create Test Result Attachment API call . The version of our API is 4.1
parametrize and running a single test in pytest
How can I run a single test out of a set configured with parametrize? Let’s say I have the following test method: I have 3 parameters, and I generate a list of 15 different possible values for them, to test the function on. How can I run just one of them? except for the obvious way – giving a sing…
How to automate Google PageSpeed Insights tests using Python
Is there a way to automate checking Google Page Speed scores? Answer So I figured out how to do this using the Google Page Speed API buried in the documentation. The TL:DR explanation is you can use the following URL setup, replacing the bracketed values after enabling Google Pagespeed API in Cloud Console (a…
Django Test framework with file based Email backend server
I have formulated test cases in Django framework. Use Case: I am using API that register user by sending them an Email and when they click on the link provided in the Email their account get activated. In my settings.py I am using which points to the local directory. When running PyUnit test case from eclipse…