Windows Powershelltm is a new Microsoft command shell and scripting language that can be used as a platform for a variety of lightweight test automation. In this month's Test run column, I'll show you how to use Windows PowerShell to create a quick and easy UI test automation
Firefoxdriver (); Driver.manage (). window (). Maximize (); Open Open Source China Web site public static void Navigate () {driver.get ("http://www.oschina.net/");} Click Login public static void Login_click () {driver.findelement (By.xpath ("//*[@id = ' Osc_userbar ']/a[1]"). Click (); Enter the user name public static void Input_name () {driver.findelement (By.xpath ("//*[@id = ' f_email ']"). SendKeys ("Xxxxxxa");} Enter the password public static void Input_password () {driver.findelement (
source source code installation. WHL is the PIP after the package. Install using the PIP command. (It is only the source before the PIP is installed) In fact, the same source installation can also be installed in the Robotframe framework above. Just Pip is more convenient. There is software in the library that does not have to download the unzip compilation installed. 3. Finally, the open ride will prompt Wxpython not installed on the installation of the version of the hint 2.8. Pro-
Python in the HTTP protocol interface related libraries have URLLIB,URLLIB2 and Reqeusts library, which Reqeusts library for the most convenient, so I also mainly use the requests library to do the interface test HTTP protocol. Let's start by looking at what environment information is needed:First, install PythonThe Mac comes with Python installed, and that's not much to say.Second, install the virtual environment:We can install multiple versions of P
For a particular program, the process of developing automated capabilities to test the solution is not significantly different from the process of creating the program. Automated testing is a very young area, and it is undergoing a lot of progress, promotion and standardization processes. In this field, many new tools have emerged that interact with the "Tested Systems" (Sut,system Under test).
There are a
complete the dragThis API uses a called coordinates, of course, the android simulator coordinates are fixed, you can rely on experience to get the screen coordinates, but this is not reliable ...Here is a tool: MonkeyrunnerMonkeyrunner Recording mode can help you get to the android screen coordinatesFor Monkeyrunner, refer to: http://luwenjie.blog.51cto.com/925779/925659This test example is mainly to explain the role of drag, the actual need only one
put it in the root directory, and then set the property to always copyThree. Preliminary examinationusingOpenqa.selenium;usingOpenQA.Selenium.PhantomJS;usingSystem;namespacephantomjsdemo{classProgram {Static voidMain (string[] args) { varURL ="https://www.baidu.com"; varDriver =NewPhantomjsdriver (); Driver. Navigate (). Gotourl (URL); Driver. Findelement (By.id ("kw")). SendKeys ("ASP"); Driver. Findelement (By.id ("su")). Click (); Console.WriteLine (Driver.
page will display the corresponding location:We see the IFRAME, then put the mouse over the IFRAME and right-click the copy XPath:This allows us to navigate to the location of the IFRAME.Positioning to the next, we want to transfer to the IFRAME, Pycharm hint method is Switch_to_frame (), but this method is outdated, if you use this method, Pycharm will underline you, the latest method is Switch_to.frame ( ), the pass parameter is the location of the IFRAME is the code in the black sentence:dri
An Internet background automation combination test Framework Rf+sikuli+python scripthttp://www.jianshu.com/p/b3e204c8651awords 949 Read 323 comments 1 likes 0 First, * * Robotframework 1. * * Tool Description:Robotframework is used as a platform for organizing test cases and BDD keywords in tests, primarily managed using ride, which is not a tool, but just a fr
print >>sys.stderr, ' \ntimeElapsed:%s '% (self.stoptime-self.starttime), can be changed to print (Sys.stderr, ' \ntime Elapsed:%s '% ( Self.stoptime-self.starttime)) Save the htmltestrunner.py after each modification. In addition, in 3, open the local file requires FP =open (filename, ' WB '), do not use file again; Fp.close () Closed2. Verify that you added the successImporting htmltestrunner.py packages in Python interactive mode>>import Htmltestrunner>>Add success when the above message app
view:" + text);}return Getsuccessresult (Result);} catch (Final Uiobjectnotfoundexception e) {return new Androidcommandresult (Wdstatus.no_such_element, E.getmessage ());} catch (Final NullPointerException e) {//El is nullreturn new Androidcommandresult (Wdstatus.no_such_element, E.getmessage ());} catch (Final Exception e) {return new Androidcommandresult (Wdstatus.unknown_error, E.getmessage ());}}}In Uiautomator, it is sometimes necessary to find an item in a scrolling list, and this item is
not output ).
Sample Input
3 11 12 13 121 22 10 01 12 1 25 30 05 31 21 225 2131 2 32 4 521 50 0
Sample output
2.00Can not be reached!21.65 Train of Thought: Set DP [I] [J] to represent the smallest step number from the point I to the state of the automatic machine to J. Note that we construct an automatic machine based on an invalid path, therefore, we cannot reach the end of a certain path. Based on this, we can record our termination conditions.
#include
HDU-4511 Jam
. If you do not add "start/b", start the Appium service and stay in the Appium log state, will not return to execute the subsequent Python script.Third, stop Appium serviceWhen the use case finishes, close the current Appium service. The implementation is that the Python script calls bat to close the Appium service. The Python script passes the port of the Appium server into the bat, the bat script obtains its process PID based on the port number, and then gets the app name and closes through Ta
Write in front:
Appium environment is set up, Genymotion Simulator is also configured OK, then began to write the first demo
First, get the APK package name
Open cmd, enter the instruction AAPT dump badging D:\test\xxx.apk (full name of the APK, such as magic Diffuse camera apk). If the package name is obtained through Appium, it may not be accurate.
Package Name: com.manboker.headportrait
Ii. acquisition of Launcheract
Build your system environment: WINDOWS7 version 64-bit systemFirst, the Environment preparation
jdk8.0.151
Android-sdk_r20.3.4-windows
python3.5
appium1.4.16.1
Node-8.9.3
Second, the above tool installation processPlease self-Baidu, here skipThird, test the installation environment1.JDK environment, input java-version on cmd command line2.ANDROID-SDK environment, enter android at cmd command line, Open SDK Manager interface3.python
(Os.path.dirname (Os.path.realpath (__file__))) # Locate the current folderJpgpath = Os.path.join (Parpath, ' testdata ', ' 1.jpg ') # "TestData": the folder name where the file is stored, "1.jpg": File nameClass Testsendfile (UnitTest. TestCase):@classmethoddef setupclass (CLS):CLS.S = Requests.session ()# Instantiate the called ClassCls.login = Loginzentao (CLS.S) # Instantiate class Loginzentao as ObjectCls.send = SendFile (CLS.S) # Instantiate the Class SendFile () as an objectdef test_01 (
the action to get the page element, click the button, and enter the form.the Selenium offers 8 positioning methods:
Id
Name
Class name
Tag name
Link text
Partial link text
Xpath
CSS Selector
here are the 8 ways to locate in the code:
Findelement (By.id ())
Findelement (By.name ())
Findelement (By.classname ())
Findelement (By.tagname ())
Findelement (By.linktext ())
Findelement (By.partiallinktext ())
Findelement (By.xpa
Interface 2: LoginRequest Method: PostRequest URL:http://api.nnzhp.cn/api/user/login1. Open JMeter, right click on test Plan, select Add-threads-thread Group2, click on Thread Group, right-add sampler-http request3,http Request page, server name or IP field input: api.nnzhp.cn; mode selection Psot; path input:/api/user/loginClick Parameters, click the Add button, name Input: Username value input: xxx;passwd value input: XXX4, click on Thread Group, ri
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.