I’ve been looking at some low-level stuff recently. Driver translates as driver, meaning driver. If you compare webdriver to a driver, it is very appropriate. We can compare WebDriver driving a browser to a taxi driver driving a taxi. There are three roles when driving a taxi: · Passenger: He/she tells the taxi driver where […]
Tag: webdriver
selenium/webdriver operating principle and mechanism
I’ve been looking at some low-level stuff recently. Driver translates as driver, meaning driver. If you compare webdriver to a driver, it is very appropriate. We can compare WebDriver driving a browser to a taxi driver driving a taxi. There are three roles when driving a taxi: Passenger: He/she tells the taxi driver where to […]
Test development (automated testing selenium (WebDriver API))
A simple web automation demonstration Baidu Dilireba. What operations will be involved in such a user behavior?1. Open the browser 2. Enter the keyword [Dilraba] in the input boxPS: Of course, there may also be an operation involved here, press Enter to perform the operation.In other words: click the “Baidu Click” button.It just means that […]
Test—–selenuim webDriver
Article directory 1. Page navigation 2. Element positioning 3. Browser operation 4. Get element information 5. Mouse operation 6. Keyboard operation 7. Element waiting 8. Drop-down box 9. Pop-up box 10.Scroll bar 11.frame processing 12.Verification code processing (cookie) 1. Page navigation First, import the corresponding package: from selenium import webdriver Then instantiate: driver = webdriver.Edge() […]
Selenium+Webdriver realizes automated login
I recently did a job where I needed to automatically log in to a website and implement a crawler. I would like to summarize and share the relevant technologies here. Environment preparation First we need to install the python environment, chrome browser, selenium package and chromedriver. The first two are relatively basic, so I won’t […]
What code frameworks does Selenium WebDriver have?
Selenium WebDriver itself is a library for automated web application testing that can use various coding frameworks and design patterns to organize and manage test code. Here are some common coding frameworks: 1. Page Object pattern: Page Object pattern is a commonly used design pattern that is used to encapsulate page elements and operations into […]
python webdriver test framework data-driven json file driver method
Introduction: The data-driven excel driving method means that the data is configured in excel. When the main program is called, the data taken out from excel is used as a parameter each time to perform operations. What needs to be mastered is the operation of excel and the flexibility to find the target data. Test […]
Use webdriver-manager to solve the problem of automation failure caused by mismatch between browser and driver
1.Foreword WhenweuseSeleniumforUIautomatedtesting,theautomatedtestoftencannotbeexecutedbecausethebrowserdriverdoesnotmatchthebrowserversion.Weneedtomanuallydownloadthecorrespondingdriverversionandreplacetheoriginaldriver.WemayalsoencounterWhentestingacrossoperatingsystems,andafterthebrowserisautomaticallyupgraded,itwillalsocausemismatchwiththedriver. Inordertosolvethisproblem,youcanusewebdriver-manager,whichcanhelpusautomaticallyidentifythesysteminformationandcorrespondingbrowserinformationinthecurrentrunningenvironment,andautomaticallydownloadthecorrespondingbrowserdriver. 2.Introduction Thewebdriver-managerlibraryprovidesawaytoautomaticallymanagedifferentbrowserdrivers. Themainideaistosimplifythemanagementofbinarydriversfordifferentbrowsers. Currentlysupports: ChromeDriver EdgeChromiumDriver GeckoDriver IEDriver OperaDriver Install: pipinstallwebdriver_manager 3.Example Originalcode: #!/usr/bin/envpython #-*-coding:utf-8-*- fromseleniumimportwebdriver driver=webdriver.Chrome() driver.get(‘https://www.baidu.com/’) Afterrunning,anerrorisreportedanditisfoundthatthisversionofChromeDriverdoesnotmatchthecurrentbrowserversionandcannotbeexecuted. Updatethecode(importwebdriver-manager,runthescript,webdriver-managerwillcheckthecurrentlyusedbrowserversionandautomaticallydownload/updatethematchingbrowserdriver,sothatthebrowserversionanddriverwillalwaysmatcheachother.) #!/usr/bin/envpython #-*-coding:utf-8-*- fromseleniumimportwebdriver fromwebdriver_manager.chromeimportChromeDriverManager driver=webdriver.Chrome(executable_path=ChromeDriverManager().install()) driver.get(‘https://www.baidu.com/’) 4.More TheauthorusesSelenium3intheexample,andwebdriver-manageralsosupportsSelenium4. 1.Chrome #selenium3 fromseleniumimportwebdriver fromwebdriver_manager.chromeimportChromeDriverManager driver=webdriver.Chrome(ChromeDriverManager().install()) #selenium4 fromseleniumimportwebdriver fromselenium.webdriver.chrome.serviceimportServiceasChromeService fromwebdriver_manager.chromeimportChromeDriverManager driver=webdriver.Chrome(service=ChromeService(ChromeDriverManager().install())) 2.Chromium #selenium3 fromseleniumimportwebdriver fromwebdriver_manager.chromeimportChromeDriverManager fromwebdriver_manager.core.utilsimportChromeType driver=webdriver.Chrome(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install()) #selenium4 fromseleniumimportwebdriver fromselenium.webdriver.chrome.serviceimportServiceasChromiumService fromwebdriver_manager.chromeimportChromeDriverManager fromwebdriver_manager.core.utilsimportChromeType driver=webdriver.Chrome(service=ChromiumService(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install())) 3.Brave #selenium3 […]
Java Selenium WebDriver web page filling
1. Windows environment installation and configuration 1. Install chrome browser In the “About chrome” interface, check the browser version number 2. Download chromeDriver Download the corresponding version of the driver at https://registry.npmmirror.com/binary.html?path=chromedriver/ (if the browser version is too new, it is recommended to download the closest version). Unzip the downloaded compressed package, and remember the […]
How Selenium Chrome Webdriver Gets Youtube Hover Text
Introduction Youtube is a very popular video sharing platform. Sometimes we may want to crawl some video information, such as title, playback volume, number of likes, etc. But some information is not directly displayed on the webpage, but we need to hover the mouse over an element to see it, such as the duration of […]