I am utilizing Python+pytest and Helium to create my exams.
Every time I run a check individually, it really works 100% of instances. Nonetheless, if I attempt to run greater than 5-6 exams collectively, some are failing, some are passing. The errors are random and by no means the identical(from “LookUp” errors to “NoSuchWindowException” and different). I already checked the solutions from comparable questions requested:
- no preconditions are altered
- no dependencies between my exams
- no alteration of knowledge that’s utilized in one other check
- i am not utilizing xdist, I’m solely attempting to run them sequentially
- I created completely different buildings and organized the exams in a number of methods attempting to slim down if a standard factor exists – nothing confirmed up. It doesn’t matter what I embody or exclude, simply after I attempt to run 5+ exams, this behaviour is reproduced.
I am at all times beginning the exams with start_chrome(URL) and finish them with kill_browser().
My finest guess is that in some way, within the background, the situations are overlapping or one thing much like this, however I don’t know the place to begin the debug course of.
I am fairly new to this, any assistance is welcomed.
I am working my exams utilizing python3 -m pytest.
Right here is my pip record output if it helps:
attrs 21.4.0
chromedriver 2.24.1
distlib 0.3.4
filelock 3.6.0
helium 3.0.8
iniconfig 1.1.1
packaging 21.3
pip 21.2.4
platformdirs 2.5.1
pluggy 1.0.0
py 1.11.0
pyparsing 3.0.7
pytest 7.1.1
selenium 3.141.0
setuptools 58.1.0
six 1.16.0
tomli 2.0.1
urllib3 1.26.9
virtualenv 20.13.4
Edit per remark:
listed here are a number of the errors:
- AttributeError: module 'locators' has no attribute 'checkbox_terms_and_conditions'
- AttributeError: module 'locators' has no attribute ‘set_date’
- motion = . at 0x7f80dcba6ee0>
-
- def carry out(self, motion):
- from helium import Config
- end_time = time() + Config.implicit_wait_secs
- # Attempt to carry out `motion` a minimum of as soon as:
- outcome = self._perform_no_wait(motion)
- whereas result's None and time() < end_time:
- outcome = self._perform_no_wait(motion)
- if outcome shouldn't be None:
- return outcome
- > elevate LookupError()
- E LookupError
Please notice that every 2 runs have completely different errors, largely LookUpError, NoSuchWindow,or AttributeError for locators file.
in my exams, I take advantage of an import assertion for the file that incorporates my net parts locators, like ids, css class, xpath and many others.
every folder of exams has its personal “locators” file. I’m unsure if that is the perfect technique, any assistance is welcomed; thanks.