diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..39155b9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Project exclude paths +/venv/ \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..5c98b42 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..55acc6a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..2e2a21e --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/python_google.iml b/.idea/python_google.iml new file mode 100644 index 0000000..74d515a --- /dev/null +++ b/.idea/python_google.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Drivers/chromedriver b/Drivers/chromedriver new file mode 100755 index 0000000..13d2eb1 Binary files /dev/null and b/Drivers/chromedriver differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..d07f850 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# My Python Selenium Demo on Google page + +## Step 1: Ensure correct dependencies are installed + +See the attached *requirements.txt* + +Quickly check if you can navigate to Google by scripting some navigational code. See *test_search.py* + +### NOTES +If you're facing ChromeDriver issues, use the [DriverManager library](https://stackoverflow.com/questions/60806988/selenium-error-this-version-of-chromedriver-only-supports-chrome-version-81-m) so it automatically installs the latest driver. + + diff --git a/Tests/test_search.py b/Tests/test_search.py new file mode 100644 index 0000000..a7ff6f0 --- /dev/null +++ b/Tests/test_search.py @@ -0,0 +1,22 @@ +from selenium import webdriver +from webdriver_manager.chrome import ChromeDriverManager +import time + +# webdriver manager installs +driver = webdriver.Chrome(ChromeDriverManager().install()) + +driver.implicitly_wait(10) +driver.maximize_window() + +driver.get("https://www.google.com/") + +driver.find_element_by_name("q").send_keys("Google") + +driver.find_element_by_name("btnK").click() + +time.sleep(2) + +driver.close() +driver.quit() + +print("Test Completed") \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3bb947f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,13 @@ +certifi==2020.4.5.1 +chardet==3.0.4 +colorama==0.4.3 +configparser==5.0.0 +crayons==0.3.0 +html-testRunner==1.2.1 +idna==2.9 +Jinja2==2.11.2 +MarkupSafe==1.1.1 +requests==2.23.0 +selenium==3.141.0 +urllib3==1.25.9 +webdriver-manager==2.5.2