-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Updated python docs/examples for browsers section #1854
New issue
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated python docs/examples for browsers section #1854
Conversation
👷 Deploy request for selenium-dev pending review.Visit the deploys page to approve it
|
PR Reviewer Guide 🔍
(Review updated until commit cd1fc7e)
Possible Bug
The test test_logs uses a hardcoded assertion that may not always be valid. Consider parameterizing the test or handling different possible messages.
Code Duplication
The tests in test_edge.py are almost identical to those in test_chrome.py. Consider abstracting common functionality to a shared module or class to follow DRY principles.
Hardcoded Path
The test test_full_page_screenshots uses a hardcoded path for saving screenshots which might not work in all environments. Consider using a configurable path or a temporary directory.
Platform Dependency
Several tests use @pytest.mark.skipif to conditionally skip tests on non-Windows platforms. Ensure that this is clearly documented, and consider providing alternative tests for other platforms if possible.
PR Code Suggestions ✨Latest suggestions up to cd1fc7e
Previous suggestionsSuggestions up to commit c0cabc1
|
Persistent review updated to latest commit cd1fc7e
Hi @harsha509,
Do you have any suggestion on how to test in Windows? I have a mac. 3 python examples tests failed. I believed I was able to resolve one of the failures (the error was pretty clear as to what was going on), but it would be best to fully confirm.
Same failures, looks like I should not have passed in the second argument "True" in add_argument (
Same failures, looks like I should not have passed in the second argument "True" in add_argument (
options.add_argument('-silent', True)
). Quite possibly the other two are failing because they are trying to use the same instance of IE? Relevant: https://www.selenium.dev/documentation/ie_driver_server/. I'll look into this more and find a way of running it myself.
Resolved the failure due to the "true" argument being passed in. The other failures are due to the use of the force_create_process_api value being set. According to the docs: "Windows Registry HKLM_CURRENT_USER\Software\Microsoft\Internet Explorer\Main path should contain key TabProcGrowth with 0 value."
I think the solution could be to have the test with force_create_process_api set to true to be skipped, as it could fail, if the value of the key above isn't set to 0. I will push that update, please let me know if it is not acceptable.
Same failures, looks like I should not have passed in the second argument "True" in add_argument (
options.add_argument('-silent', True)). Quite possibly the other two are failing because they are trying to use the same instance of IE? Relevant: https://www.selenium.dev/documentation/ie_driver_server/. I'll look into this more and find a way of running it myself.
Resolved the failure due to the "true" argument being passed in. The other failures are due to the use of the force_create_process_api value being set. According to the docs: "Windows Registry HKLM_CURRENT_USER\Software\Microsoft\Internet Explorer\Main path should contain key TabProcGrowth with 0 value."
I think the solution could be to have the test with force_create_process_api set to true to be skipped, as it could fail, if the value of the key above isn't set to 0. I will push that update, please let me know if it is not acceptable.
Updated and ready for review.
Hi @harsha509 ,
The tests that were failing before, passed on the last run. The tests that failed, were not touched by me and they were timeouts. Could the checks be run again?
Thanks.
b44fc0e to
1e0dc7b
Compare
Could I get a review please?
Moved or added examples in python docs for browsers (for all missing examples)
68b325f to
4f4aefd
Compare
Looks like this has been failing its checks consistently. Updating to a draft, so I can figure out the issue. I'll update this PR once I have seen them all pass consistently.
Could you please resolve conflict in this PR?
Closing this PR as someone else implemented the same stuff already.
Uh oh!
There was an error while loading. Please reload this page.
User description
Moved or added examples in python docs for browsers (for all missing examples)
Thanks for contributing to the Selenium site and documentation!
A PR well described will help maintainers to review and merge it quickly
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, and help reviewers by making them as simple and short as possible.
Description
Added and moved all relevant python code examples for the browsers section.
Motivation and Context
It will allow python users to see examples of working code so they can more easily and efficiently work with selenium.
Types of changes
Checklist
PR Type
Documentation, Enhancement
Description
Changes walkthrough 📝
5 files
test_chrome.py
Add Chrome browser tests for various featuresexamples/python/tests/browsers/test_chrome.py
test_edge.py
Add Edge browser tests for various featuresexamples/python/tests/browsers/test_edge.py
test_firefox.py
Add Firefox browser tests for various featuresexamples/python/tests/browsers/test_firefox.py
test_internet_explorer.py
Add Internet Explorer browser tests for various featuresexamples/python/tests/browsers/test_internet_explorer.py
test_safari.py
Add Safari browser test for Technology Previewexamples/python/tests/browsers/test_safari.py
20 files
chrome.en.md
Update Chrome documentation with Python exampleswebsite_and_docs/content/documentation/webdriver/browsers/chrome.en.md
chrome.ja.md
Update Chrome documentation with Python examples (Japanese)website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md
chrome.pt-br.md
Update Chrome documentation with Python examples (Portuguese)website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md
chrome.zh-cn.md
Update Chrome documentation with Python examples (Chinese)website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md
edge.en.md
Update Edge documentation with Python exampleswebsite_and_docs/content/documentation/webdriver/browsers/edge.en.md
edge.ja.md
Update Edge documentation with Python examples (Japanese)website_and_docs/content/documentation/webdriver/browsers/edge.ja.md
edge.pt-br.md
Update Edge documentation with Python examples (Portuguese)website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md
edge.zh-cn.md
Update Edge documentation with Python examples (Chinese)website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md
firefox.en.md
Update Firefox documentation with Python exampleswebsite_and_docs/content/documentation/webdriver/browsers/firefox.en.md
firefox.ja.md
Update Firefox documentation with Python examples (Japanese)website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md
firefox.pt-br.md
Update Firefox documentation with Python examples (Portuguese)website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md
firefox.zh-cn.md
Update Firefox documentation with Python examples (Chinese)website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md
internet_explorer.en.md
Update Internet Explorer documentation with Python exampleswebsite_and_docs/content/documentation/webdriver/browsers/internet_explorer.en.md
internet_explorer.ja.md
Update Internet Explorer documentation with Python examples (Japanese)website_and_docs/content/documentation/webdriver/browsers/internet_explorer.ja.md
internet_explorer.pt-br.md
Update Internet Explorer documentation with Python examples(Portuguese)website_and_docs/content/documentation/webdriver/browsers/internet_explorer.pt-br.md
internet_explorer.zh-cn.md
Update Internet Explorer documentation with Python examples (Chinese)website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md
safari.en.md
Update Safari documentation with Python exampleswebsite_and_docs/content/documentation/webdriver/browsers/safari.en.md
safari.ja.md
Update Safari documentation with Python examples (Japanese)website_and_docs/content/documentation/webdriver/browsers/safari.ja.md
safari.pt-br.md
Update Safari documentation with Python examples (Portuguese)website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md
safari.zh-cn.md
Update Safari documentation with Python examples (Chinese)website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md