'Get Request' is deprecated.... and exceptions

Get Request’ is deprecated. Please use GET On Session

When attempting to change to the new GET On Session all our negative tests fail. We have various test that check responses are not 200.

How can we port these tests because GET On Session throws exceptions.

Sounds like you’d just need to pass the argument expected_status

By default this keyword fails if a status code with error values is returned in the response, this behavior can be modified using the expected_status and msg parameters, read more about it in Status Should Be keyword documentation. In order to disable this implicit assert mechanism you can pass as expected_status the values any or anything .

link to documentation >


Cool thanks, I’ll give that a try, I “just” need to update 1000s of tests :slight_smile:

I know the pain (I had quite a few tests to update myself), but that change to expected_status was introduced in 2021, so I guess guess you haven’t run theses tests for quite a while.

FYI this functionality changed with v0.8.0 of requests library, I guess if you need to run the tests urgently you could install an older version of requests library, run your tests, let the project progress, and let that buy you some time to maintain the test cases.


1 Like