There are a lot of articles related to selenium, but this time I created a sample application that can be used for multi-browser tests etc. on Windows OS for the time being.
Windows10 Pro Eclipse IDE for Enterprise Java Developers JavaSE 11
Each browser version Chrome:84.0.4147 Firefox:78.0.2 InternetExplorer:11.959.18
-Clone from the following URL and place it in the workspace folder of eclipse https://github.com/ZumWalt22/seleniumExp.git
-Import the cloned project from eclipse Import the project by selecting the directory cloned in File> Import> General> Import existing project to workspace
・ IE browser preset When executing with IE, please make the following settings in advance with a browser Internet Options → Security tab Check "Enable Protected Mode (requires restart of Internet Explorer)" for Internet, Local Intranet, Trusted Sites, and Restricted Sites Uncheck the "Enable Enhanced Protected Mode" checkbox
Right-click on Project Explorer and click Run> 1. Run Java Application
At the command prompt, you will be asked which browser to run as shown below. Enter the number of the browser you want to run and press the Enter key
input target test browser 0:Chrome 1:IE 2:FireFox >
・ Enter "0" when running on Chrome ・ Enter "1" when running with IE ・ Enter "2" when running with FireFox
The Google site starts up, the "selenium" string is set in the search box, and the sample that executes the search works
When the driver of selenum server and each browser is changed, when it is executed by OS other than Windows Please refer to the information below and replace the file as appropriate.
Download from the URL below https://www.selenium.dev/downloads/ Click the "Selenium Server (Grid)" link to download
Download the driver from the URL below https://sites.google.com/a/chromium.org/chromedriver/downloads
On line 78 of the "seleniumEx.java" file, modify the path of the second argument of the following method to the path of the above location. System.setProperty("webdriver.chrome.driver", "selenium/chrome/83.0/chromedriver.exe");
Download the driver from the URL below https://www.selenium.dev/downloads/
On line 99 of the "seleniumEx.java" file, modify the path of the second argument of the following method to the path of the above location. System.setProperty("webdriver.ie.driver", "selenium/ie/3.15/IEDriverServer.exe");
Download the driver from the URL below https://github.com/mozilla/geckodriver/releases
On line 113 of the "seleniumEx.java" file, modify the path of the second argument of the following method to the path of the above location. System.setProperty("webdriver.gecko.driver", "C:/pleiades/workspace/seleniumExp/selenium/firefox/0.26/geckodriver.exe");
Try starting Selenium2 in IE. https://qiita.com/tsuttie/items/372f5d4cad37650711f1
It was surprisingly easy to get started with Selenium https://qiita.com/kazokmr/items/0dc6b67e5a90ffc27db6
Recommended Posts