In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
I was exposed to selenium web automation when I was in the first company, but I didn't build my own environment and configuration. I almost forgot about it now. In order to pick it up again, I specially organized this blog post. The writing style is not good, purely for the sake of recording, so that I can understand it in the future. If there is any incorrect writing, please put forward it directly
Prepare:
Install Firefox (45.0.2) browser and install plug-ins Firebug, FirePath
Following the successful installation of Selenium IDE (2.9.1 https://addons.mozilla.org/en-US/firefox/addon/selenium-ide/),)
Install Virtual Studio2010, NUnit (2.5.10)
Http://docs.seleniumhq.org/download/ downloads C#Selenium-dotnet-2.53.0 package and IEWebdriver (IEDriverServer_Win32_2.42.0)
To create a C # project, select the Console Application template and reference all the dll files under .net40 (based on the actual. Net version) in the Selenium-dotnet package. The referenced dll is as follows
Namespace reference using
Through the above configuration, you can now simply use IEDriver to access Baidu. I put IEWebdriver under the AUTO folder under disk C, with the following code
(F 5 runs debugging, if there is an error prompt: Unexpected error launching Internet Explorer. Browser zoom level was set to 150%. It should be set to 100% (NoSuchDriver). The solution is to set the browser's zoom to 100% and maximize the Window maximize window)
7. You can also record a script using selenium IDE and run it with NUnit
Open the firefox browser, start selenium IDE in the upper right corner, record (open Baidu, search Taobao), choose to export the file to C#/NUnit/WebDriver, and save it to .cs file format.
8. When you add the recorded .cs file to the previously created project, there will be some errors. The .dll file under the NUnit installation path (lib and framework) needs to be referenced, and the namespace references using
9. Open NUnit and add project .exe (all under the Debug path by default). If there is an error as follows
The solution modifies the project properties-production, target platform, to AnyCPU. Re-produce the solution, add it to NUnit, check the case to run, and click Run. The success is shown in the following picture, ps. Script recorded with selenium IDE, the default is to use firefoxDriver, using Firefox does not need to download driver, the original support.
The first blog post of my life finally took 2 days to finish. I hope I can persevere and go further and further on the road of software testing.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.