(Python root has been configured to path), will not be configured to seeSelenium2+python Automation 1-Environment constructionFirst article2. Ensure that the driver file name is Chromedriver.exe, and if the name is followed by a version number, change the file name.3.Chrome version v57.0+chromedriverv2.24Four, the version of the matching tableVersion of Chrome s
statements (file--defualt setting--------and inspections------Encoding specified for file--and Settings UTF8 ), try the above two ways, still can't solve, crash cure happened to see a post, said #coding = UTF8 This sentence must be written in the first line, after the test, sure enough success!! It seems that Python's use is poor ~ later to strengthen Python.Encoding conversion, be sure to write in the first line!!! Head Write!!! First line!! More important things to say a few times ~At this po
, parameterize the implementation, so import the Main method testweb.py6. Global variables and use case completionride case Fill rule, perform method index to specified ExcelAdd a New resource--a name- select robot Format fileConfirm ~ Configuration under Variables and values Import global variable file-select the created file Using the Created variables7. Assertions the Case method to return the actual and expected results, and then ride the self-contained assertion should contain determine if
)Application_cacheReturns a Applicationcache Object to interact with the browser app cacheCurrent_urlGets the URL of the current page.: Usage:Driver.current_urlCurrent_window_handleReturns the handle of the current window.: Usage:Driver.current_window_handleDesired_capabilitiesReturns the drivers current desired capabilities being usedFile_detectorLog_typesGets a list of the available log types: Usage:Driver.log_typesMobileNameReturns the name of the underlying browser for this instance.: Usage:
before.Webdriverwait (DR, 10)Scans 1 page changes every 500 milliseconds in 10 seconds, ending when the specified element appears. Dr does not explain that the handle of the front operation Webdriver.firefox ()Is_displayed ()Whether the element is visible to the userClass Actionchains (Driver)Driver: Performing a user action instance webdriverGenerates the user's behavior. All actions are stored in the actionchains object. behavior that is stored through the perform (). Move_to_element (menu)Mo
ObjectiveThe environment has been set up in the front, which begins with the formal learning of Selenium's webdriver framework. We usually say selenium automation, in fact, it is not similar to QTP and other GUI-like visualization tools, we want to learn is the Webdriver framework of the API.This article mainly tells how to use Python to invoke the API of the Webdriver framework, to do some general operatio
. Verification of SeleniumHow do you know selenium is properly installed?1. Make sure the Firefox browser is installed on your computer2.cmd window Enter the following command>python>from Selenium Import Webdriver>webdriver. Firefox ()3. If you can start the browser, the environment installation OK.VI. Browser1. If you plan to use the Firefox browser, then do not install more than 47 (SELENIUM2 is not compatible with more than 47)2. If you plan to use
to enter the console for the interpretation of the Python program run, which can be completely replaced by batch processing.The contents of the batch file are as follows:@echo off CD c: \Zzpythontestpython Auto. py PauseBatch FileThen each time only need to click on the Auto.bat file to achieve the effect ~Check the E-drive, and sure enough, the E:\jenkins\workspace\CHECKSTYLE directory is established:Open the Build.xml file, and sure enough to achie
, in the browser's address bar type: http://localhost:8080/. then enter. Enter the following screen. This means that Tomcat is installed correctlyIv. Environment of JeninsThe 1.Jenkins package is divided into two types:One is the Setup.exe client package (this double-click with QQ, do not say)One is a war package2.war bag put under WebApps3. Start JenkinsRestart Tomcat:startup.bat First, then enter http://localhost:8080/jenkins/in the browserV. Configuring Jenkins1. Create a new job2. Enter the
the matching text to the right is matched with an exp expression, as in the following example:Forward negation defines:The sequential negative match (?!), which represents the exp that does not match later, is shown in the following example:To define backwards:The reverse order must match (? text must be fixed long! , examples are as follows:Backward negation defines:Reverse negation match (?Balance groups and recursionIn regular expressions, the balance group and recursion belong to something
From Zoomeye to Bugscan, to Tangscan, large poc/exp platforms are becoming more and more, and various scanners are emerging. The threshold for web security is getting higher, and the infiltration of automation has become a trend. I have always dreamed that in the future, when infiltration, the first to open their own various automation tools, input targets, and then drink coffee, brush know, and finally onl
positioning of the page, and the method encapsulated by the business operation code associated with those elements.4. Code reuse, which reduces the amount of test script code.5. Clear hierarchy, while supporting the development of multiple writing automation scripts, such as how many pages each person writes, does not affect others.6. It is recommended that both the page class and the business logic approach give a meaningful name to make it easy for
into Send_keys (Hzy). This is called by loop until all the contents of the file are read.Second, login parameterizationNow according to the above ideas, the Automation script user, the name of the password parameterized, through the Python document we found that Python read the file: The entire file read, read-line, fixed byte read.Did not find a good way to rea
With the development of the test industry, now whether in the search for work or in the actual work, the need to master automation is more and more common, here to record some of the knowledge of the entry, hope that the reader can have some help! Good da, get to the point, this article mainly records how to use Python to invoke the API of the Webdriver framework, do some regular operations on the browser,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.