Twist

Collaborative Test Automation

This is a public Product  public

Twist Community

Welcome to your online Twist community.

Take a look around; if you need help getting started with Twist, are looking for tips using Twist in new and interesting ways or want to share cool Twist uses with other users your at the right place. 

To participate in this community you should take advantage of the following activities:  Join the Discussion by Posting a Topic, or view the Twist Instructional Videos.

Resources for logging defects, suggesting features, troubleshooting, installation and having general discussion about the product are all available.

We'd love to hear your Twist stories and Feedback,


Twist Forums

namepostscommentsactivity
General Discussion80125February 2, 2012
Feature Requests821January 10, 2012
Troubleshooting1220January 10, 2012
Twist Instructional Videos911January 10, 2012
Bug Reports1120January 10, 2012

New Twist Discussions

  • Sarita Pol
    Can we access the twist properties inside the twist scenario...1
    Post posted February 1, 2012 by Sarita Pol in General Discussion public

    I have a case where in the Login class I want to know which type of browser I am using. What is the mobile server address. What is the version of browser and other settings defined in twist.Properties

    I am using the default system web browser instantiated by the twist. Twist version is 2.4.0.12621

    Please let me know how to implement this or procedure for the same.

    Thanks,

    Sarita.

     

     

    Recent Comment (1 of 1)

  • angshuman
    Testing webservices with Twist
    Post last edited January 5, 2012 by angshuman in General Discussion public

    The idea of this post is to demonstrate WebServices testing from Twist. While some of our customers have already been using Twist for services testing, this post will hopefully show you easy enough steps to test your WebServices while still leveraging the authoring, maintenance aspects of Twist. In this example, we will test a simple temperature converter service exposed at http://www.w3schools.com/webservices/tempconvert.asmx, which provides simple celsius to fahrenheit degrees conversion.

    Pre-requisite:

    • This example is built with Apache CXF 2.4.2, and you should download it from here (http://cxf.apache.org/download.html), and extract the archive to a local directory. Apache CXF is an open source services framework, and allows you test services over a variety of protocols such as SOAP, XML/HTTP, RESTful HTTP etc and over transports such as HTTP, JMS or JBI.
    • You should also extract the bundled example project and import it within Twist. It contains a simple Twist project testing the above mentioned service. We are going to refer some classes, configurations, build samples from the example project.


    1. Creating the project

    • Create a Twist project, with driver of your choice. For the example project, I have chosen "none". But you may as well integrate this with your chosen driver for your mixed-mode testing requirements (like use a web browser interface to place an order, and verify the transaction through a webservices call).


    2. Generating the building stubs, skeletons, and data types from WSDL.

    What we want is a simple and usable enough java interface for accessing the remote WebService. something like:

      converterService.celsiusToFahrenheit("32")

    A fair amount of boilerplate code must be written to access the Service. Thankfully, we can automate all that code generation. We will generate the bindings necessary for client side testing of the service using wsdl2java utility shipped with CXF. To do this:

    • Get hold of the wsdl document and place it under the "<project root>/src" folder. For the example, I retrieved the wsdl from from http://www.w3schools.com/webservices/tempconvert.asmx?wsdl and saved the file as - "<project root>/src/tempconvert.asmx.wsdl". Your development team can also provide you the same.  
    • Copy 2 files (cxf_wsdl2java.xml and cxf_wsdl2java.properties) from the attached project and place them under <project root>.
    • Open the file "cxf_wsdl2java.xml" and change the wsdl src reference under target "cxfWSDLToJava" to "src/tempconvert.asmx.wsdl"
    • Open cxf_wsdl2java.properties and change the first property "cxf_home" to home directory of CXF. (e.g cxf_home=/<directory>/apache-cxf-2.4.2)
    • Open the "Ant View" (Window -> Show View -> Ant) and drag and drop the "cxf_wsdl2java.xml" to the view and then run target "cxfWSDLToJava".
    • Once run, you should see the generated code under "src" folder within package "org.tempuri"

    If you look within the package contents classes, you will find an interface annotated with @WebService (org.tempuri.TempConvertSoap). This interface has 2 basic methods that represent the operations supported by the WebService. This is the remote interface we are going to use in our Test fixtures.

    Another class (org.tempuri.TempConvert) will be generated annotated with @WebServiceClient. This is the class that will return the remote interface. Methods annotated with @WebEndpoint will return you a remote interface. (in this case, we have used TempConvert.getTempConvertSoap() method)

    NOTE: If you would want to customize the JAX-WS implementations created by wsdl2java, it can be done by using a customization binding file. Please refer here for more information.


    3. Adding CXF Library references to your project

    • Go to "project properties->java build path->libraries tab"
    • Add "external jars" references to cxf-2.4.2.jar, neethi-3.0.1.jar, wsdl4j-1.6.2.jar, xmlbeans-2.4.0.jar, xmlschema-core-2.0.jar (all these are found under <cxf_home>/lib/ folder)

    4. Creating the remote interface instance

    • From the example project, copy the org.example.ConverterServiceFactory java file to your project, under package org.example
    • Open the scenarioContext-suite.xml file from your project and configure 2 beans like below (these will provide you the TempConvertSoap interface).

    <bean id="tempConvertorFactory" class="org.example.ConverterServiceFactory"
         init-method="start" destroy-method="stop" lazy-init="true">
         <property name="wsdlLocation" value="classpath:tempconvert.asmx.wsdl"/>
    </bean>
     
    <bean id="converterService" factory-bean="tempConvertorFactory" factory-method="getConverterServicePort"
          lazy-init="true" scope="singleton">
    </bean>


    5. Creating a scenario and generating test fixture

    • Assuming that you have a scenario "convert celsius.scn" (refer to the example project) which stated something like:


     Temperature Converter:

    •   verify that "100" degrees in centigrade is same as "212" degrees fahrenheit

     

    • Implement the step in fixture "Temperature Converter" (CMD+1 or right click ->quick fix) . This would have generated a fixture and a dummy implementation of the step. Navigate to the code for the step (right click -> show code). We need to hook up the service interface here.


    6. Injecting the service interface to the fixture

    • We can leverage Spring's annotation based configuration to inject the remote interface by simple declaring a private variable and annotating with @Autowired like below

    public class TemperatureConverter {
        
        @Autowired
        private TempConvertSoap converterService;
        ....
        
    }  

     

    7. Calling a remote service operation.

    • Navigate to the code for the step (right click -> show code). Now you are can use the remote interface like below:

    public void verifyThatDegreesInCentigradeIsSameAsDegreesFahrenheit(Double celsius, Double fahrenheit) throws Exception {
            assertEquals(fahrenheit, Double.valueOf(converterService.celsiusToFahrenheit(celsius.toString())));
     }


    8. Execute the scenario

    • You should see the scenario executing correctly.

     

    Additional support from Eclipse WTP

    - In addition, you can install "Eclipse WTP" plugins. This is a standard Indigo distro. If you would point to "http://download.eclipse.org/releases/indigo" update site, you can just install the "Web, XML, Java EE ... " feature. 
    - Once installed, you could then define your services preferences and generate the client side bindings using Apache Axis for example. (e.g. open "Apache Axis" at Project->Preferences->Web Services.)
    - You could then select the Twist project, click new -> Web Service Client, and in the following wizards, mention the wsdl def, and Axis would generate most of the java stub/code for you. Also it would add all the required dependencies onto your project. 
    - You could then write simple java code (from fixtures) to make service calls using the remote interface
     
  • sdqali
    Announcing Twist 2.4
    Post posted January 2, 2012 by sdqali in Announcements public
    The Twist team is pleased to announce the General Access release of Twist 2.4.
      
    This release of Twist comes with a whole set of cool new features. Some of these are listed below:
     
    1. SynonymAssist
    SynonymAssist is a feature in Twist that lets you search for content(steps and concepts) by matching steps and concepts against synonyms of words that you have typed in. Typing in word(s) and invoking Synonym Assist will provide a list of suggestions steps and concepts to select from. You can read more about the Synonym Assist here.
     
    2. Improved Autocomplete 
    The Auto-complete feature now comes with improved ordering of search results. Twist Content Assist will now display results ordered by concepts first, followed by implemented workflow steps and finally unimplemented steps.
     
    3. Selenium upgrade
    Selenium driver bundled with Twist is upgraded to version 2.15.
     
    4. Spring upgrade
    With upgrade to Spring 3.1, Twist provides additional capabilities like Annotation based configuration to initialize tests. More details can be found here.
     
    The installers for Twist 2.4 can be downloaded from here.
    If you already have an instance of Twist, instructions on how to upgrade Twist can be found here.
     
    Happy Twisting,
    The Twist Team.

Search Twist

Keyword Search

Filter Posts with Tags


Twist Community Members

  • Arun Kumar
  • Mark Richter
  • Adam Monago
  • Andy Yates
  • Ethan Teng
  • Elena Yatzeck
  • Rustin
  • angshuman
  • goley
  • Kevin E. Breidenbach
  • Risha Mathias
  • Mark Chang
  • Douglas Ribback
  • Ian Bridson
  • Mike O'Brien
  • Manoj
  • sdqali
  • Sachin Sudheendra
  • Mansi Shah
  • Stone
  • Matt Philip
  • Andy Kemp
  • Li Yanhui
  • Livingston Samuel
  • Ian Carvell
  • Dean Glasener
  • Stephen Chu
  • Andy C
  • Linc
  • Tom