`
J0119
  • 浏览: 1792 次
  • 性别: Icon_minigender_2
  • 来自: 上海
最近访客 更多访客>>
社区版块
存档分类
最新评论

Introduction to Automation Testing

 
阅读更多

Environment Required

TOOLS: JDK,ANT,Eclipse

  • 1. Install ANT
    Download:  http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.2-bin.zip   

    a.     First decompression the apache-ant-1.9.2-bin.zip into your hard disk , I put it in ” D:\apache-ant-1.9.2”
    b.     Make a new environment variable, name “ANT_HOME”. Value “D:\apache-ant-1.9.2” (see picture new_variable.jpg)
    c.     Put  %ANT_HOME%/bin;   into the beginning of your system variable ; (see system_variable.jpg)
    d.     To verify whether it is successfully installed,  open your DOC window, and put  ant - version  to verify if you have installed successfully or not
  • 2. Coding
   webDriver + testNG
    run in different browser:
                      public void Test_InternetExplorer(String webSite) throws Exception {			 
				System.setProperty("webdriver.ie.driver", ".\\lib\\IEDriverServer.exe");
				DesiredCapabilities capabilities = DesiredCapabilities
						.internetExplorer();
				capabilities
						.setCapability(
								InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
								true);
				driver = new InternetExplorerDriver(capabilities);
				baseUrl = webSite;
				testElementsExists(driver);
		 
			}

			 @Test
			@Parameters({ "firefox_dir", "webSite" })
			public void Test_Firefox(String firefox_dir, String webSite)
					throws Exception {
		 
				System.setProperty("webdriver.firefox.bin", firefox_dir);

				driver = new FirefoxDriver();

				baseUrl = webSite;
				testElementsExists(driver);
		 
			}

			@Test
			@Parameters({ "webSite" })
			public void Test_Chrome(String webSite) throws Exception {
			 
				System.setProperty("webdriver.chrome.driver", "./lib/chromedriver.exe");
				driver = new ChromeDriver();
				baseUrl = webSite;
				driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
				 testElementsExists(driver);
		 
			}

 

  • 3. testng.xml setting
    a. every test case should be added into testng.xml, so that when you right click on ant.xml to run the cases.
    b. every test case is included like this:
           	  <test name="Test basic elements  " preserve-order="true"> 
	          <classes>
		  <class name="script.TestBasicElements"/>
                  </classes>
	          </test>

    the 'name' is the one that will appear in left of test results page. 
    classes means all the classes that you write should be run.
    <class name="path"> this paths is important, only you write correctly, can it be found. 
  • 4. Run Script Method
   a. through the eclipse :   Importing the project in eclipse, run ant build script. The XML
   b. throught the DOC window:   -  cd e:\workspace\MMR     -ant
  • 5. see the results
   to see the results here: /test-output/Report.html
   if the test Cases are all passed, the it should be Green ,or there will be error info in the red test cases, then you can click the cases, and check the error. 

 

 

分享到:
评论

相关推荐

    Effective Software Test Automation

    One expert’s solution to software test automation is to develop testing tools instead of purchasing commercial tools developed with the current inadequate infrastructure. This book is written for ...

    Software.Testing.2nd.Edition (Sams)软件测试(英文版)

    Introduction About the Second Edition Who Should Use This Book? What This Book Will Do for You Software Necessary to Use This Book How This Book Is Organized Conventions Used in This Book...

    testing java microservices

    Chapter 1 An introduction to microservices Chapter 2 Application under test Chapter 3 Unit-testing microservices Chapter 4 Component-testing microservices Chapter 5 Integration-testing microservices ...

    INTRODUCTION TO PYTHON SCRIPTING FOR MAYA ARTISTS.

    This guide provides an extensive introduction to Python scripting specifically tailored for Maya users, aiming to equip beginners with the foundational knowledge required to leverage Python ...

    Selenium.Testing.Tools.Cookbook.2nd.Edition.178439251

    This book is an incremental guide that will help you learn and use the advanced features of the Selenium toolset including the WebDriver API in various situations to build a reliable test automation....

    Software Quality Assurance A Self-Teaching Introduction

    Covers important topics such as black, white, and gray box testing, test management, automation, levels of testing, quality models, system and acceptance testing and more Covers video game testing and...

    Mastering.SoapUI.178398080X

    Introduction to SOA Testing Chapter 2. Functional Testing in Detail Chapter 3. Performance Testing of SOA Applications in Detail Chapter 4. Security Testing in Detail Chapter 5. Test Automation in ...

    Learning.VMware.vRealize.Automation.1785885839.epub

    The book starts off with an introduction to the distributed architecture that has been tested and installed in large scale deployments. Implementing and configuring distributed architecture with ...

    ActiveX programming with visual c++

    Part I: Introduction to ActiveX Chapter 1 - What is ActiveX? Chapter 2 - What Can ActiveX Do for You? Part II: ActiveX Automation Servers Chapter 3 - Creating ActiveX Automation Servers Using MFC ...

    how google test software

    Chapter 1 Introduction to Google Software Testing 1 Quality≠Test 5 Roles 6 Organizational Structure 8 Crawl, Walk, Run 10 Types of Tests 12 Chapter 2 The Software Engineer in Test 15 The Life of an ...

    A.Practical.Guide.to.Continuous.Delivery.epub

    Manage the introduction of Continuous Delivery into your enterprise Architect software to facilitate Continuous Delivery of new capabilities Table of Contents Part I: Foundations Chapter 1: Continuous...

    Automating.Junos.Administration.Doing.More.with.Less.1491928883.epub

    With this practical guide, network engineers will learn how to program Juniper network devices to perform day-to-day tasks, using the automation features of the Junos OS. Junos supports several ...

Global site tag (gtag.js) - Google Analytics