Friday, 29 August 2014

JYTHON


  • Jython programs can import and use any Java class. 
  • Except for some standard modules, Jython programs use Java classes instead of Python modules. 
  •  Jython includes almost all of the modules in the standard Python programming language distribution, lacking only some of the modules implemented originally in C. 
  •  For example, a user interface in Jython could be written with Swing, AWT or SWT. Jython compiles to Java bytecode (intermediate language) either on demand or statically.
     Jython Architecture : 









Saturday, 16 August 2014

TestNG Multi-Browser and Parallel Test Run

I ll give simple example about TestNG and parallel running

1- Create Java Project
2- Add TestNG library
3- Write your test class and annotations
4- Configure your TestNG.xml file


My simple test class below :
 package browserTestNG;  
 import org.openqa.selenium.WebDriver;  
 import org.openqa.selenium.firefox.FirefoxDriver;  
 import org.openqa.selenium.ie.InternetExplorerDriver;  
 import org.testng.annotations.AfterClass;  
 import org.testng.annotations.BeforeClass;  
 import org.testng.annotations.Parameters;  
 import org.testng.annotations.Test;  
 public class MultiBrowser {  
   public WebDriver driver;  
    @Parameters("browser")  
    @BeforeClass  
    // Passing Browser parameter from TestNG xml  
    public void beforeTest(String browser) {  
    // If the browser is Firefox, then do this  
    if(browser.equalsIgnoreCase("firefox")) {  
      driver = new FirefoxDriver();  
    // If browser is IE, then do this     
    }else if (browser.equalsIgnoreCase("ie")) {  
      // Here I am setting up the path for my IEDriver  
      System.setProperty("webdriver.ie.driver", "C://webdrivers/iedriver_64/IEDriverServer.exe");  
      driver = new InternetExplorerDriver();  
    }  
    // Doesn't the browser type, lauch the Website  
    driver.get("http://www.google.com.tr");  
    }  
    // Once Before method is completed, Test method will start  
    @Test public void login() throws InterruptedException {  
     }   
    @AfterClass public void afterTest() {  
       driver.quit();  
     }  
 }  

My testng.xml configuration file below :


















If you run this code you will see both Firefox and Internet Explorer parallel running







Friday, 15 August 2014

Robot Framework Installation on Windows

Robot Framework Overview



-  Robot Framework (FR) a test automation framework developed in Python
-  Allow us to use keyword driven, data driven, behaviour driven
-  Provide report  of the test execution results in HTML format.
-  Provides support for Selenium for web testing, Database testing, Java GUI testing, ..
-  Allows user to create custom libraries.

Sample Report:




Installation Steps:
(my system is  x64)

    -  Download Java JRE
    -  Download Python here
    -  Download wxPython here
    -  Download python extension here





  -  Add Python scripts folder to Windows path,




  -  Download Robot Framework here
  -  Download RIDE (Robot Framework IDE)  here
  -  Download Selenium Library  here
  -  run "ride.py"









Saturday, 2 August 2014

Appium Installation II

First of  I installed wmWare  and Mac OS X Maverics in my virtual machine for the installation here  

Need to install XCode from Apple Store

Need to install Appium for MacOS ( don t try to open it directly from image file ) from here

Install Java JDK

 from the appium website follow below commands, before start you need to check permissions (chmod)

 dont use sudo command when you install !

  
if eveything successful  you can appium 
  
  

Appium - I





  • You can use any language you like when you write testcases (because of jsonwire protocol)
  •  No need to change or modify appplication code which we test
  • Open source tool we can test mobile hybrid and native applications 
  • Appium is an HTTP server which is written in node.js