We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
There are currently no instructions in the Test Runners section for Python. I would like to contribute the following:
Install pytest dependency
pip install pytest
Now, run test using:
pytest
Save the script to test_web_form.py file
test_web_form.py
import unittest from selenium import webdriver from selenium.webdriver.common.by import By class TestWebForm(unittest.TestCase): def setUp(self): self.driver = webdriver.Chrome() def tearDown(self): self.driver.quit() def test_eight_components(self): self.driver.get("https://www.selenium.dev/selenium/web/web-form.html") title = self.driver.title self.assertEqual(title, "Web form") self.driver.implicitly_wait(0.5) text_box = self.driver.find_element(by=By.NAME, value="my-text") submit_button = self.driver.find_element(by=By.CSS_SELECTOR, value="button") text_box.send_keys("Selenium") submit_button.click() message = self.driver.find_element(by=By.ID, value="message") value = message.text self.assertEqual(value, "Received!") if __name__ == "__main__": unittest.main()
Run the file with using:
python test_web_form.py
The text was updated successfully, but these errors were encountered:
@Ankit3794, thank you for creating this issue. We will troubleshoot it as soon as we can.
Triage this issue by using labels.
If information is missing, add a helpful comment and then I-issue-template label.
I-issue-template
If the issue is a question, add the I-question label.
I-question
If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.
help wanted
After troubleshooting the issue, please add the R-awaiting answer label.
R-awaiting answer
Thank you!
Sorry, something went wrong.
I'm looking to try to move this test runners section to a new page with #1479
No branches or pull requests
Feature and motivation
There are currently no instructions in the Test Runners section for Python. I would like to contribute the following:
Pytest
Install pytest dependency
pip install pytest
Now, run test using:
pytest
Unittest
Save the script to
test_web_form.py
fileRun the file with using:
python test_web_form.py
The text was updated successfully, but these errors were encountered: