Skip to main content

Grinderstone under linux

I am using Ubuntu 9.10
jan@albotek:~/development/eclipse$ more /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.10
DISTRIB_CODENAME=karmic
DISTRIB_DESCRIPTION="Ubuntu 9.10"
I installed new eclipse 3.5.2, and inside eclipse used jdk 1.6.0.20 as default JRE, and jython 2.5.1 for my jython. Still I did not manage to get my grinder scripts with proxy working. The failure I was getting:
Java exception initialising test script
 test1.record(grinder.getLogger().output)
 File "/home/jan/development/workspace-grinder/Grinder1/src/HelloWorld3.py", line 7, in Caused by: net.grinder.script.NonInstrumentableTypeException: Failed to wrap 
   at net.grinder.engine.process.instrumenter.MasterInstrumenter.instrument(MasterInstrumenter.java:114)
   at net.grinder.engine.process.TestData.instrument(TestData.java:100)
   at net.grinder.script.Test.record(Test.java:114)
In my output log I was seeing:
6/5/10 10:22:09 a.m. (process albotek-0): The Grinder version 3.4
6/5/10 10:22:09 a.m. (process albotek-0): null 1.5.0: GNU libgcj (4.4.1, GNU libgcj 4.4.1) on Linux i386 2.6.31-21-generic
6/5/10 10:22:09 a.m. (process albotek-0): time zone is GMT+02:00 (+0200)
6/5/10 10:22:21 a.m. (process albotek-0): worker process 0
6/5/10 10:22:21 a.m. (process albotek-0): Java VM does not support instrumentation, DCR unavailable
6/5/10 10:22:21 a.m. (process albotek-0): instrumentation agents: NO INSTRUMENTER COULD BE LOADED
6/5/10 10:22:21 a.m. (process albotek-0): executing "/home/jan/development/workspace-grinder/Grinder1/src/HelloWorld3.py" using Jython 2.5.1 (Release_2_5_1:6813, Sep 26 2009, 13:47:54) 
Apparently I was using the wrong java version. Although I set it explicitly inside eclipse, eclipse itself had been started with java from OS, and grinderstone is using that one for its execution. I made a small startup script for my eclipse:
export GDK_NATIVE_WINDOWS=true
./eclipse  -clean -console -consoleLog -vm /usr/lib/jvm/java-6-sun/bin/java -vma
rgs -Xmx400M -XX:MaxPermSize=128M -Dorg.eclipse.swt.browser.XULRunnerPath=/usr/l
ib/xulrunner/xulrunner
and when I now start my eclipse, I get:
6/5/10 10:30:24 AM (process albotek-0): The Grinder version 3.4
6/5/10 10:30:24 AM (process albotek-0): Java(TM) SE Runtime Environment 1.6.0_20-b02: Java HotSpot(TM) Server VM (16.3-b01, mixed mode) on Linux i386 2.6.31-21-generic
6/5/10 10:30:24 AM (process albotek-0): time zone is CEST (+0200)
6/5/10 10:30:29 AM (process albotek-0): worker process 0
6/5/10 10:30:29 AM (process albotek-0): instrumentation agents: byte code transforming instrumenter for Jython 2.5; byte code transforming instrumenter for Java
6/5/10 10:30:29 AM (process albotek-0): executing "/home/jan/development/workspace-grinder/Grinder2/src/HelloWorld3.py" using Jython 2.5.1 (Release_2_5_1:6813, Sep 26 2009, 13:47:54) 

Comments

Popular posts from this blog

SSL handshake failed: Secure connection truncated

Got this problem on Ubuntu 9.10 and 10.10. svn co --username=xx https:/yy zz “SSL handshake failed: Secure connection truncated” According to this link bug-ubuntu The solution is: sudo apt-get install libneon27 cd /usr/lib/ sudo rm libneon-gnutls.so.27 sudo ln -s /usr/lib/libneon.so.27 libneon-gnutls.so.27

Create a groovy console and bind to selenium

Required groovy files In the previous posting we defined the pom file that we need for our build environment. Now we will setup some groovy files to get selenium and groovy running interactively. ConsoleWaiter.groovy The idea of Groovy Console I found on some other sides. Honour goes for instance too: http://josefbetancourt.wordpress.com/tag/eclipse-2/ I copied some code of this, and put it under src/test/groovy/com/jankester/selenium/test/utils: package com.jankester.selenium.test.utils /** * File: ConsoleWaiter.groovy */ import groovy.lang.Binding; import groovy.ui.Console; /** * Provides a wrapper for the console. * * Based on source by John Green * Adapted from: http://www.oehive.org/files/ConsoleWaiter.groovy * Released under the Eclipse Public License * http://www.eclipse.org/legal/epl-v10.html * * I added methods to allow use from Java. * * The run() method launches the console and causes this thread * to sleep until the console's window is closed....

Interactive selenium testing

The problem Location of elements When I started using selenium, I noticed that it is not easy to do it right. First you start with IDE, but you notice, that the IDE does not really record a lot. In a next step I added firebug, and started analyzing how the elements where to be located: either by tag, id, class etc. Junit testcase With this information I could then create my junit testcase: @Test public void testMapView() throws Exception { //assert that we cannot see submenu of MapCreator elem = driver.findElement(By.className(SeleniumConstants.MAP_SUB_MENU)); String style = elem.getAttribute("style"); assertTrue("Element must have style display off.",style.matches("display: none.*")); logger.debug("Located element " + SeleniumConstants.MAP_SUB_MENU); //find menu and click on mapview elem = driver.findElement(By.id(SeleniumConstants.MAP_CONTROL)); actions.moveToElement(elem).click().perform(); //assert su...