General Discussion

General discussion on using Twist including questions and tips

This is a public Discussion Area  publicRSS

Welcome Guest

 

Log in if you have an account.

Otherwise, register for an account.

For more details, please visit the How This Site Works page.

Forums

General Discussion Recent Posts

  • Robert Elbourn
    Twist with Continous Integration, and MavenAnswered61
    Post last edited April 27, 2012 by Robert Elbourn

    Does anyone have any examples of Twist integrating directly with Maven? ie. without going via ANT?  I am struggling to follow the examples in a clear and concise way.  I am unsure if the maven antrun plugin is somewhere in the installation or actually something I need to download.  (Downloading is tricky we are fairly locked down here).

    What would be great is if someone could put up a hello world example of using maven with a twist project, maybe with selenium, maybe it loads google, with a twist test, testing that it can find google, and then the example maven file structure.  If it can't work without ant, then maybe the ant buildfile too.

    Recent Comments (3 of 6)

  • azuniga
    Twist won't inject Resource via Spring4
    Post last edited April 27, 2012 by azuniga

    I am running Twist 2.3.1 on RHEL and using Spring. I am using image based testing with Sikuli, as mentioned in another Twist post. In the applicationContext-scenario.xml I have a map of lists that one of my test scenarios needs. You can see the spring code in the code snippet area. I am using the @Resource(name="mapOfAttributes) to inject the map. I can't use Autowired b/c it supposedly doesn't work with maps, I tried it. The java code is also in code snippets area. This scenario is a table driven scenario. Before my scenario executes, I have a context that launches the browser and does some other cleaning up stuff before running the test. I have some Guava code that checks the map is not null and it always fails. What do I need to do to have this value injected?

    Recent Comments (3 of 4)

  • Srijayanth Sridhar
    Using Sikuli with Twist to test applications visually61
    Post last edited April 24, 2012 by Srijayanth Sridhar

    What is Sikuli?

    Sikuli is a visual technology to automate and test graphical user interfaces (GUI) using screenshots. You may read more about it here: http://sikuli.org

    Installing Sikuli:

    You can get the latest version from here: http://sikuli.org/download.shtml

    Note: If you are using linux you will need to have wmctrl, and OpenCV 2.1 installed.

    Using Sikuli with Twist:

    There are two distinct parts to using Sikuli with Twist. The first part involves wiring Twist up to use the Sikuli jars. The second involves getting the screenshots you will require to automate your application.

    To wire Twist up with Sikuli:

    The Sikuli IDE you downloaded has a jar file called sikuli-script.jar. You can find this jar file under the lib directory of your Sikuli installation. You will need to copy this jar file into a directory called libs(create "libs" if it is not already present) in the Twist project where you intend to use Sikuli.

    Now you can let the Twist project know that you have inserted a new library. You may do this by right clicking on the project, selecting "Properties>Java Build Path" and selecting the "Libraries" tab. Click on "Add JARs" and select the sikuli-script.jar by navigating to the libs folder under your twist project. Click on Ok.

    The final part of wiring up Sikuli involves the creation of beans in your applicationContext-suite.xml file. Doing this will let Twist know how to instantiate your driver and make it available to your test code. Add the following right at the end of the applicationContext-suite.xml file, just before where it says </beans>:

    <bean id="sikuli" class="org.sikuli.script.Screen"/>


    This bean will make the "Screen" object available to your test code. You will use the Screen object to interact with your applications.

    Now that Sikuli is wired into Twist you will be able to use it in any fixture. To test it, open a scenario you have written, or write a new scenario with a single workflow step under a fixture. Implement the fixture and navigate to the code. Create a constructor for your fixture and introduce the Screen object as a parameter in your constructor. The best way to do this is to type Scree and then press Ctrl-Space to pick from a list of suggestions(make sure you pick the option that has org.sikuli.script in it). Your constructor will then look something like:

    public FixtureName(..., Screen screen) {....


    If you just typed "Screen screen" instead of using suggestions, you will see Screen underlined in red. This is just letting you know that you haven't included an import statement to import Screen. This is easily remedied by typing the following at the top of your java file:

    import org.sikuli.script.Screen;


    Automating with Sikuli:

    Sikuli works by using screenshots of specific parts of your application(buttons/textboxes etc) and performing actions on them. It is therefore imperative to have those screenshots in your Twist project. You may use the Sikuli IDE to capture the relevant screenshots for the application you are testing and then copy those over to your Twist project under a folder called "images" or something appropriate.

    Once these screenshots are in place, the rest of it involves making appropriate calls to Sikuli.

    For example if you have captured the Windows "Start" button as one of your screenshots, you can get Twist to click it by using:

    screen.click("images/start.png");


    inside one of your workflow steps.

    Sikuli works very well where your application has common visual components across multiple screens but does not have a driver to easily access these controls. Flash based applications are a good class of applications that can be tested with Sikuli.

    Happy testing.

    Recent Comments (3 of 6)

  • azuniga
    Twist launches firefox and firefox can't oped Adobe...Answered4
    Post last edited April 24, 2012 by azuniga

    When I launch firefox from the command line, I am able to view PDF's in my browser. I am testing my GUI with Twist and using the sikuli driver. Before I run the test I close the browser. The line of code that opens the browser says: App.open(PDF_ENABLED_BROWSER + " -new-window " + URL When I try to open a PDF I get the following error, Could not launch Adobe Reader 9.5.1. Please make sure it exists in PATH variable in the environment. If the problem persists, please reinstall the application. I am running on RHEL and using Firefox 3.6.23, not by choice. Any help is greatly appreciated.

    Recent Comments (3 of 4)

  • Sarita Pol
    Can we access the twist properties inside the twist scenario...2
    Post last edited April 17, 2012 by Sarita Pol

    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 Comments (2 of 2)

  • Robert Elbourn
    Selenium 2.0 and usage of Proxy Avoidance
    Post last edited March 20, 2012 by Robert Elbourn

    Hi,

    We are fairly newcomers to twist and are currently looking to resolve a few issues.

    Firstly when we used Selenium 0.92 we just needed to have the avoid proxy settings in the properties file to enable us to use IE.  Which worked ok. 

    Now we are using Selenium 2.0 as its shipped with the updated version of twist (currently 2.4) and although I can get firefox to work, I cannot get IE to work, even if I put in the cgi script location under the "browser script location area" http://autoproxy.intranet.whatever.com/cgi-bin/pac.fcgi.

    Can anyone shed any light on this as I cannot be the first person to have had this issue ?  I could try using the 0.92 version again and use the -proxyInjectionMode -avoidProxy commands but that seems like a step backwards to me.

    Cheers Rob.

     

    ps. error is:

    19-Mar-2012 11:20:44 org.openqa.selenium.remote.RemoteWebDriver execute
    INFO: Executing: [null, newSession {"desiredCapabilities":"Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}]"}]



    Edit: Fixed the issue, I missed an error message in the middle of the bumf, basically it was related to the security levels of the different zones of the browser being unequal.

Recent Comments

Recent Participants

  • Scott
  • Morag Keirns
  • srinivasa
  • Kurt
  • Ben Butler-Cole
  • Mike
  • Melissa Doerken
  • Ron
  • LeeBenhart
  • Adrian S.
  • Lisa
  • goley
  • sdqali
  • Suzie Prince
  • Anshika
  • sweety rai
  • Huimin Li
  • Adam Monago
  • Santosh
  • azuniga

Search this Forum

Keyword Search

Filter Posts with Tags