Questions tagged [pytest-selenium]
The pytest-selenium tag has no usage guidance.
pytest-selenium
16
questions
0
votes
2
answers
42
views
Selector for a button with no unique ID
I was writing test selectors for selenium in python for a website like Booking.com. For one example I had to automate selecting a button from a list of buttons. The format for the button is as under:
&...
0
votes
0
answers
56
views
Not able to connect my feature file to steps?
I am using pytest-bdd
I have created features file and written steps for it.
Code is also performing, But when I try to run code from feature file. It says Nothing Here.
Please Help ! Stuck in this ...
0
votes
1
answer
35
views
Passing different Xpaths every test session, using same tests with different apps on Android mobile
i have a problem with switching file with xpaths and test data for appPackage that is currently under tests:
tests.py
@pytest.fixture(params=brand_list)
def driver(request):
desired_caps = {
...
0
votes
1
answer
115
views
pytest-selenium installed but not available as plugin for pytest. What have I done wrong?
I've installed pytest-selenium, but I cannot use it with pytest.
def test_sanity(selenium):
E fixture 'selenium' not found
> available fixtures: cache, capfd, capfdbinary, caplog, ...
0
votes
0
answers
857
views
pytest-xdist: How to execute a method (where I initialize DB mocks for all the tests in that file) before the test methods are executed
I have a test suite that used to be executed with pytest and I used the method before_all_tests(request) in each test file to initialize the db mockups for those tests.
I wanted to use pytest-xdist to ...
1
vote
3
answers
2k
views
Pytest test discovery in subfolders
Hi I have the following project architecture, I am using selenium with pytest
From the terminal, when I am at the root folder, I can not run one
the tests inside the folder "\tests"
As far ...
2
votes
1
answer
1k
views
Pytest Selenium elem.send_keys() causing TypeError: object of type 'NoneType' has no len()
I am trying to send data to a login textbox but when I use 'send_keys' I get an error..
def wait_for_element(selenium, selenium_locator, search_pattern, wait_seconds=10):
elem = None
wait = ...
5
votes
1
answer
4k
views
how to pass firefox/chrome headless mode via command line to pytest
I need to run my selenium test cases remotely in headless mode.
Currently, I am running below py.test command
py.test --driver remote --host selenium.host --port 4444 --capability browserName ...
-1
votes
1
answer
259
views
Is there any way to get all the "inner html text" of a website and its corresponding coordinates using python selenium?
I'm able to get the div elements by using this code:
divs = driver.find_elements_by_xpath("//div")
and by looping through the divs and using .text attribute I'm able to get the text as well
code:
...
1
vote
0
answers
325
views
How to run pytest-selenium with xdist and use cli arg driver?
I am trying to run multiple tests in parallel using xdist and determine the webdriver based on the user's command line argument such as
--driver Remote/Chrome/etc
Ultimately, I am trying throw this ...
1
vote
2
answers
891
views
How to pass arguments to Selenium test functions in Pytest?
I wamt to make my tests more flexible. For example I have a _test_login_ that could be reused with multiple different login credentials. How do I pass them as arguments instead of hard-coding them?
...
4
votes
3
answers
3k
views
Testing a Flask app with pytest-flask + pytest-selenium (docker)
I am trying to test a Flask web app within a docker container, which is new for me. My stack is the following:
firefox
selenium
pytest-selenium
pytest-flask
Here is my Flask app file:
from flask ...
1
vote
2
answers
2k
views
remote selenium grid over https is not working
The company I work for requires / impresses that all our selenium test traffic be conducted through https when using the remote selenium grid server that we have hosted in AWS inside a docker instance....
1
vote
2
answers
1k
views
Storing global configuration data in a pytest/xdist framework
I'm building a test framework using python + pytest + xdist + selenium grid. This framework needs to talk to a pre-existing custom logging system. As part of this logging process, I need to submit API ...
1
vote
2
answers
2k
views
Using pytest-variables in a module outside a function
I am using Pytest and Pytest-variables with parametrized test functions to try and reduce duplication of code across test cases. I have this working with hard-coded strings within the test module: ...