tools exist problems. Then, as an example of a traditional test case written by a tester, demonstrates how to use Selenium to write an automated test script file for it. Then, it introduces how to develop the Selenium Automation test framework based on XML. Finally, a brief
1. Installing the JDKJDK1.7Download path: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.htmlPunch ' Next ', OK. Configure environment variables when installation is complete:Java_home = E:\Java\Java\jdk1.7.0_15PATH =%java_home%\binCLASSPATH =.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jarCMD command-line input:java-version, returns the following result, indicating that the installation was successful2. Download Eclipse:http://www.eclipse.org/download/Once the
compatibility-test your application to see if it works well on different browsers and operating systems, test system functions-Create regression tests to verify software functionality and user needs, support automatic recording actions, and automatically generate. NET, Perl, Python , and test scripts in different lang
browser BOT in the browser. These commands can be divided into two types --Action)AndAssertion):
The operation simulates the interaction between the user and the web application. For example, clicking a button and entering a form are common user operations. You can use the selenium command to automate these operations.
Assertions verify the expected results of a command. Common assertions include verifying that the page content or current
SeleniumThe Ultimate Automated test Environment Setup (II.)Selenium+eclipse+pythonThe previous example of the selenium+eclipse+junit+testng Automated test environment, on the basis of the previous article, the following example Selenium+eclipse+python
judgment method encapsulation, cyclic judgment page elements appear after the operation, this can greatly improve the success rate of the operating elements.Iv. How to improve the execution speed of selenium scripts?1. Use sleep less, try not to implicitly_wait2. Multi-use explicit wait method3. Get a computer with good performanceFive, use cases in the operation of the process often appear unstable situat
):
The operation simulates the interaction between the user and the web application. For example, clicking a button and entering a form are common user operations. You can use the selenium command to automate these operations.
Assertions verify the expected results of a command. Common assertions include verifying that the page content or current location is correct.
You can find a complete list of available commands on the
Directory1 Working with browsers1.1 Open a browser with Webdriver1.2 Maximize browser Close Browser1.3 Setting the browser window size1.4 Opening the test page1.5 new window for processing browser popup2 page element positioning3 How to manipulate page elements3.1 Webelement related methodsProcessing of 3.2 iframe3.3 Input box (text field or textarea)3.4 Drop-down selection box (select)3.5 Single option (Radio Button)3.6 Multiple options (checkbox)3.
test.3. Speed control: Controls the speed at which the case is run.4. Run All: Runs all cases in a test case set.5. Run: Runs the currently selected test case.6. Pause/Resume: Pause and resume test case execution.7. Single-Step: You can run one line of commands in a case.8. Recording: After clicking, start recording y
.
Selenium client driverDownload a zip package, decompress it to/usr/local/with the unzip selenium-java-2.8.0.zip, there is/usr/local/selenium-2.8.0/selenium-java-2.8.0.jar package in the decompressed path, add this package when writing test in eclipse
Between the above thre
differentiate 32-bit/64-bit:Http://selenium-release.storage.googleapis.com/index.html
Select the appropriate version and download it.
Find a folder that's easy to find and use when you start the Chrome browser and IE.
Note : Browser test drivers such as Chromedriver and Iedriverserver are both Google browsers and IE browsers that invoke the system, so drivers and browser clients must match each other (and
Selenium is a browser automation library. Most often used for testing web-applications, Selenium May is used for any task this requires automating interaction with The browser.Selenium is a browser Automation test library, most of the time we use it to test the Web application,Sele
, with the corresponding client library files for different languages. Similar to the concept of database dialect package, if you want to use Java operation database, for different databases, you need to import different database driver jar files, MySQL has MySQL dialect package, DB has db dialect package.
The client library file obtains a selenise command and passes it to selenium Server to perform a specified operation or to
The first thing to do is:
1, ECLIPSE+JDK
2, Selenium-ide (http://release.seleniumhq.org/)
3. Firefox
4, Selenium-java-2.53.1.jar (as if not necessary)
5, Selenium-server-standalone-2.53.1.jar
Selenium-ide using methods, selenium code conversion Java, and Eclipse creation I h
When selenium 1.x is used, the getEval () method is often used to execute a js script to process the page to deal with some problems encountered. Of course, selenium webdriver also provides the following method: executeScript ()
The following shows how to obtain the characters displayed in the account input box on the 51.com homepage and print the output.
/*** This class is about Execute javascript * @ au
/wKioL1j2DUPyp9RyAABIWks3_Cg729.png-wh_500x0-wm_ 3-wmp_4-s_2637081708.png "title=" Python installation succeeded. png "alt=" wkiol1j2dupyp9ryaabiwks3_cg729.png-wh_50 "/>Ok , Get here python The installation was successful. But to do the selenium test, you also need to install setuptools(to install other plug-in modules),directly run the line of sight download a good installation package, follow the prompts
Automation test basics-Selenium browser operations, basics-seleniumSelenium mainly provides methods for operating various elements on the page, but it also provides methods for operating the browser itself, such as the browser size, browser back-up, forward button, and so on. I. Control the browser window size. Sometimes we want to open it in a browser size so that the accessed page can run in this size. Fo
? Article source:Pinterest: Http://www.jianshu.com/p/b01de206a0d7
In the past we executed selenium scripts, and if we were to improve the execution speed of our scripts, we might consider using htmlunit or more headless browsers that use PHANTOMJS, but these tools are not good for JavaScript support. For the support of the web is not good, occupy more resources,
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.