Thursday 29 June 2017

Run SOAPUI project via gradle command.

1. Create a SOAPUI project and save it as xml file
2. install gradle and set path for the same
3.  install eclipse
4. install gradle add on over eclipse ( via eclipse market place)
5. create a gradle project
6. open build.gradle and paste below code

/*
 * This build file was generated by the Gradle 'init' task.
 *
 * This generated file contains a sample Java Library project to get you started.
 * For more details take a look at the Java Libraries chapter in the Gradle
 * user guide available at https://docs.gradle.org/3.5/userguide/java_library_plugin.html
 */

// Apply the java-library plugin to add support for Java Library
apply plugin: 'java-library'


// In this section you declare where to find the dependencies of your project
repositories {
    // Use jcenter for resolving your dependencies.
    // You can declare any Maven/Ivy/file repository here.
    jcenter()
}


dependencies {
    // This dependency is exported to consumers, that is to say found on their compile classpath.
    api 'org.apache.commons:commons-math3:3.6.1'

    // This dependency is used internally, and not exposed to consumers on their own compile classpath.
    implementation 'com.google.guava:guava:21.0'

    // Use JUnit test framework
    testImplementation 'junit:junit:4.12'
}


public class SoapUITask extends Exec  {
String soapUIExecutable = 'C:/Program Files (x86)/SmartBear/SoapUI-5.3.0/bin/testrunner.bat'
   String soapUIArgs = ''

   public SoapUITask(){
       super()
       this.setExecutable(soapUIExecutable)
   }

   public void setSoapUIArgs(String soapUIArgs) {
       this.args = "$soapUIArgs".trim().split(" ") as List
   }

}



 // execute SOAPUI
task executeSOAPUI(type: SoapUITask){
    soapUIArgs = '"G:/testsoap-soapui-project.xml"'
}




** Replace couple of path in the above code/

open command window @ build.gradle location
>gradle executeSOAPUI


Thats all.

First selenium programme with python

prerequisites:

1.python software
2.install selenium over python
3.download chrome driver
4.IDE for python code: pycharm


FacebookTest.py

from selenium import webdriver
driver = webdriver.Chrome("C:/forSelenium/chromedriver.exe")
driver.get("http://www.facebook.com")

Installing selenium client libraries over python


To write a simple selenium programme in python, we need selenium to be added over python ( this is entirely different when you compare with java with selenium )

Here you go

1. open command window in python installation location. ( if not found search for pip.exe then you can easily find out the location)

2. pip.exe install -U selenium





Thats all .

other option:
open command window
C:\Users\Owner\AppData\Local\Programs\Python\Python36-32\Scripts\pip.exe install -U slenium