log.info "starting" // we use class to create objects of a class Planet p1 = new Planet() Planet p2 = new Planet() Planet p3 = new Planet() p1.name = "earth" p1.shape = "circle" p2.name = "jupiter" p2.shape = "…
本章将继续深入Groovy语言,首先学习Groovy脚本,包括从命令行编译和运行Groovy脚本,Groovy Shell,和Groovy Console.你将学会使用Groovy语言来建立域对象.控制器和服务.而且使用Groovy的方法并非只有一种.另外,对于建立类,可以使用Groovy作为脚本语言.例1:简单的Groovy脚本Hello.groovyprintln "Hello ${args[0]}, may Groovy be with you."执行以上代码:PS D:\tmp…
log.info "starting" // we use class to create objects of a class Planet p1 = new Planet() Planet p2 = new Planet() //Planet.name = "Pluto" illegal Planet.shape = "Circle" // static variable Planet.log = log p1.name = "ea…
log.info "starting" // we use class to create objects of a class Planet p1 = new Planet() Planet p2 = new Planet() Planet p3 = new Planet() //Planet.name = "Pluto" illegal Planet.shape = "Circle" p1.name = "earth" /…
Building test suites, Test cases and Test steps in SOAP UI Levels : test step level test case level test suite level project level Groovy script test step Write groovy code in groovy script test step log object in SOAP UI Info and error log log.error…
Various databases which are supported Drivers for database connection groovy.sql.Sql package SoapUI怎样支持对数据库的操作 Various databases which are supported Groovy可以支持各种不同的数据库:MySQL, SQLServer, Oracle Drivers for database connection 不同的数据库需要下载不同的JAR包来支持,下载后将…
Array: def x = new String[5] x[0] = "India" x[1] = "USA" x[2] = "Korea" x[3] = "Japan" x[4] = "China" log.info "Size of list is " + x.size() log.info "The first item in list is : "+x[0]…
TestService s = new TestService(log,context,testRunner) s.xyz() class TestService{ def log def context def testRunner public TestService(log,context,testRunner){ this.log=log this.context=context this.testRunner=testRunner } public void xyz(){ log.in…
try, catch and finally in db connection Forming groovy connection string and obtaining Connection Object Firing Select Query and obtaining results Foreach and rows functions Finding number of rows in result import groovy.sql.Sql // obtain the connect…
What is a web service? http://webservicex.net/ws/default.aspx WebService是一种跨编程语言和跨操作系统平台的远程调用技术. 跨编程语言 : 服务端程序采用java编写,客户端程序则可以采用其他编程语言编写,反之亦然! 跨操作系统平台 : 服务端程序和客户端程序可以在不同的操作系统上运行. 远程调用 : 一台计算机a上的一个程序可以调用到另外一台计算机b上的一个对象的方法. 譬如,银联提供给商场的pos刷卡系统,商场的POS机转…
Code example : package com.file.properties; import java.io.FileInputStream; import java.util.Properties; public class ReadProperties { Properties prop; public ReadProperties(String path) { prop = new Properties(); try{ FileInputStream fs = new FileIn…
Operator : While Loop : For Loop : Arrays : Code : public class FirstJavaClass { public static void main(String[] args) { int arr[] = new int[5]; arr[0]=78; arr[1]=980; arr[2]=98; arr[3]=9; arr[4]=765; System.out.println(arr[2]); System.out.println(…
Selenium IDE (Only support in Firefox): - Record and Run - UI interface - User extensions - Conversion of code Selenium RC: Multiple Browsers : IE, Chrome, Firefox, Opera, Safari Multiple Languages : Java, PHP, Ruby, Python, C#, Perl Multiple OS : Wi…
What is Selenium? Browser Automation Testings Tool: Mozilla IE 6,7,8 Google Chrome Opera 8,9,10 Safari Multiple Operating Systems: Windows Mac Linux/Unix Many More Mutiple Languages: Java (Famous) C# Ruby Python Perl Php Components of Selenium:…