See the forum someone wrote the Java test code of the daily design, to share with you how I usually test the testThe. Code is primarily based on the Python language. Daily debugging based on Webdriver is very handy in Python interactive mode,Open Python has interactive mode:Web-side Example:
From seleniu
image module to intercept specific areas, the code is as follows:Idea: Save Web Programs--navigate to verification code coordinates--and then verify code location fromFrom PIL import imageimport pytesseractfrom Selenium import webdriverurl= ' http://xxxxx.com ' driver = webdriver
SELENIUM2 provides a compatibility interface to the previous RC code, and if your previous code was written with RC, and now you want to get rid of every time you start the server, you only need to make a few changes. The code is as follows:public class TESTWB extends Selenesetestcase {@Beforepublic void SetUp () throws Exception {
Look at Selenium's website documentation, there are some small points in the automation use case design is very reliable. Learn a lot and can be used to optimize your code.1. Test Type:Testing Static ContentTesting LinksFunction TestsTesting Dynamic ElementsAjax TestsAssert vs. VerifyThe difference between assert and verify: If the assert is wrong, the subsequent content will be stopped, verify if wrong, it will be recorded and then proceed with the s
Automatic Test Based on selenium 2
Press: Machinery Industry Press
Subtitle: from entry to proficiency
Publishing year:
Page: 210
Pricing: 39.80
Frame loading: Flat Loading
ISBN: 9787111467830
Introduction
This book shows developers and testers how to use selenium for Web automation testing. This book introduces selenium, the main character of automated
This article mainly describes the Python Selenium Cookie Bypass Verification Code Implementation login sample code, now share to everyone, the need for friends can refer to
Previously, the method of using cookies to bypass verification codes for login was described. This is not redundant and will add analysis and another way to implement login.
1. Introduction o
import webdriver from selenium. webdriver. common. keys import Keys import selenium. webdriver. support. ui as ui import reimport timeimport osimport codecsimport MySQLdb # Open the Firefox browser and set the waiting time driver = webd
: husky said Meow from selenium import webdriverimport osimport pytesserimport sys, timefrom PIL import Image, ImageEnhance # shift + tab multiple line indent (left) reload (sys) PostUrl = "http://yjsymis.hrbeu.edu.cn/gsmis/indexAction.do" driver = webdriver. firefox () driver. get (PostUrl) I = 0 while 1: # sb log on to the system. Even if you cannot log on to all the messages, You need to log on twice or
# coding = Utf-8%%%%%%%%%%%%%%%% prevent garbled (can be added without adding)The From selenium import Webdriver%%%%%%%%%%%%%% uses the Webdriver function in selenium, so the Webdriver is directed inBrowser = Webdriver. The Firefo
Java Selenium Smart Wait page load complete
We often encounter the use of selenium to manipulate an element on the page, you need to wait for the page to be completed after loading to operate. Otherwise, the element on the page does not exist, and an exception is thrown.
or encounter Ajax asynchronous loading, we need to wait for the element load to complete before the operation
The
Use the tess4j reason is the verification code picture address by the JS dynamic click on the link state generation, and time stamps, resulting in the conventional crawler to obtain the image address download method of verification Code and Web page display, so think of the use of screenshots to intercept the verification code picture, using TESS4J to identify, T
Original reprint: Http://www.blogjava.net/qileilove/archive/2014/06/05/414423.html preparation: selenium-server-standalone-2.* the file. The jar is copied to the JMETER Class Library installation directory%jmeter_home%/lib/, and you do not need to start selenium server. Jmeter JUnit Sampler Package The selenium test case into a. jar file and copy it to the%jmete
How to handle pop-up windows in selenium
Reading Table of Contents
Principle
To test the HTML of a page
Java Code
Principle
In the code, through set
To get a handle to all pop-up browsers, and then iterate through it using the Swithcto.window (Newwindow_handle) method. You can navigate to a new window
To test the HTML of a page
Python Selenium Cookie Bypass Verification Code implementation loginPreviously introduced the blog park through the cookie Bypass verification code to implement the method of login. This is not redundant and will add analysis and another way to implement login.1. Introduction of Ideas1.1, directly see the code, with de
This is my first time to send a blog, if there is a problem, please advise!This time is to help solve, if in peacetime automation encountered a verification code fill in the case, how we successfully login.
Ideas:
First we copy the verification code and save it as a picture, and then use TESSERACT-OCR this optical software to identify the TXT file, and then we just read the contents of the TXT
Sample Code for multi-window processing in selenium python browser, seleniumpython
This article focuses on the multi-window processing of selenium python browsers and shares the operation instance Code as follows:
#! /Usr/bin/python #-*-coding: UTF-8-*-_ author _ = 'zuoanvip '# during the test, multiple browser windows
For the general login site, there will be a verification code this thing, is generally for security considerations, in a security policy, this is a problem for us to do UI Automation testing, normal we can enter the user name, password to log in, if the popup verification code to deal with, It's a good choice to take a browser cookie.Recommended Chrome plugin Editthiscookie, you can directly see the current
Use selenium and coding platform (oneself also can not achieve verification code image resolution, docking code platform resolution image verification code) reality automatically login to the Amazon website, and modify the account binding mailbox and password and other operations.
Logic: Simulate the operation of the
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.