diff --git a/prodigyqa/browseractions.py b/prodigyqa/browseractions.py index 0542768..0af6928 100755 --- a/prodigyqa/browseractions.py +++ b/prodigyqa/browseractions.py @@ -714,4 +714,17 @@ def __execute_script(self, script, web_elm=None): if isinstance(web_elm, dict): return self.driver.execute_script( script, - self.__find_element(web_elm)) + self.__find_element(web_elm) + + def get_element(self, locator: dict): + """return web element of a locator. + :param locator: dictionary of identifier type + and value ({'by':'id', 'value':'start-of-content.'}). + :type locator: dict + """ + self.locator_check(locator) + self.page_readiness_wait() + if isinstance(locator, dict): + return self.__find_element(locator) + else: + AssertionError("Invalid locator type") diff --git a/requirements.txt b/requirements.txt index fff0a0e..9908f28 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,11 +10,11 @@ opencv-python flake8==3.7.9 pycodestyle<2.6.0,>=2.5.0 pandas==0.24.2 -urllib3==1.25.7 +urllib3==1.25.9 requests>=2.21.0 -ipdb==0.12.2 +ipdb==0.13.2 pytest>=4.0.2 -pytest-html<2.1.0 +pytest-html<2.2.0 xlrd>=0.9.0 scrapy loguru diff --git a/setup.py b/setup.py index 2c9c463..8d57f0e 100644 --- a/setup.py +++ b/setup.py @@ -53,11 +53,11 @@ 'flake8==3.7.9', 'pycodestyle<2.6.0,>=2.5.0', 'pandas==0.24.2', - 'urllib3==1.25.7', + 'urllib3==1.25.9', 'requests>=2.21.0', - 'ipdb==0.12.2', + 'ipdb==0.13.2', 'pytest>=4.0.2', - 'pytest-html<2.1.0', + 'pytest-html<2.2.0', 'xlrd>=0.9.0', 'scrapy', 'nltk',