I was trying to test a simple login form with different cases. I used python,selenium,python’s unittest library for testing and i am able to get test done by unittest library but how can i generate test reports for this ? I tried with HTMLTestRunner but it has bugs and i found it was written for python 2x version. A lot
Tag: testing
Two identical AutomationID using xpath python with appium
In in our mobile app, there are two boxes with the same AutomationId. For automated testing i need to find the first of the two elements by xpath. I tried following code, bt it didn’t work: Thanks! Answer You can handle the following way Description : First, get the all identical elements through “find_elements” this will give you as an
How to run script as pytest test
Suppose I have a test expressed as a simple script with assert-statements (see background for why), e.g How would I include this script in my pytest test suite — in a nice way? I have tried two working but less-than-nice approaches: One approach is to name the script like a test, but this makes the whole pytest discovery fail when
What is the difference between `assert_frame_equal` and `equals`
I’m curious to find the difference between assert_frame_equal and equal. Both are for checking the equality of two data. It applies for assert_series_equal and assert_index_equal. So what is the difference between equals and testing functions? So far I found was testing functions gives little more flexibility to compare the values, like check_dtpye options etc., and differs from returning values Is
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 single
What are the differences between setUpClass, setUpTestData and setUp in TestCase class?
More specifically, what are the use cases for each? What I’ve understood so far: setUpClass This method runs once, before all the tests in a test class setUpTestData This method runs once if the DB has transaction support. Otherwise it runs before each test. setUp This method runs before each test in a test class. From the understanding I mentioned
How to test a Django on_commit hook without clearing the database?
The on_commit function has been added to Django 1.9 to be able to trigger an action (e.g. a Celery task) after the current transaction has committed. They mention later in the docs that one should use TransactionTestCase to test features that rely on that function. However, unlike TestCase (which uses transactions and rolls them back), TransactionTestCase empties the whole database
What is the proper way of testing throttling in DRF?
What is the proper way of testing throttling in DRF? I coulnd’t find out any answer to this question on the net. I want to have separate tests for each endpoint since each one has custom requests limits (ScopedRateThrottle). The important thing is that it can’t affect other tests – they have to somehow run without throttling and limiting. Answer
Installed app in Django not found when running tests
I have a pretty simple Django app, that I am trying to run unit tests on. In my tests.py file I am trying to import the parent apps views file. I tried from . import views but got an error: I read that when a relative path does not work, you can try using an absolute path so I tried
Artificially creating memory usage in Python
I’m trying to create a pure memory intensive script in Python for testing purposes but every script that I try also increases my cpu. I’ve read this post and I also tried, among others: in order to copy an array to another array but once again I had cpu variations as well. UPDATED So, how can I cause a standard