Contributions
Re: Share your components here
Hi! I have now updated the JIRA plugin to fix the problems with the missing connection point and also the missing smack depencency. You can download the new version from my personal site: http://erik.r.yverling.se/creations/plugin/jira or from the custom component gallery: http://www.loadui.org/Custom-Components Happy load testing! Erik R. Yverling (formally Rålenius)13 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.3KViews0likes0CommentsRe: Share your components here
Component name: JIRA Developer: Erik Rålenius Description: Creates a JIRA issue for all Web Page Runner failures after a completed test Source code: // // Copyright (C) 2011 Erik Rålenius (erik@ralenius.se) // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. /** * Create JIRA issue for Web Page Runner failures. * * @name JIRA * @category output * @dependency org.codehaus.groovy:groovy-xmlrpc:0.4 */ import groovy.net.xmlrpc.XMLRPCServerProxy as Proxy import com.eviware.loadui.util.layout.DelayedFormattedString import com.eviware.loadui.api.events.ActionEvent import com.eviware.loadui.api.events.PropertyEvent import com.eviware.loadui.impl.component.ActivityStrategies class JiraProxy extends Proxy { JiraProxy(url) { super(url) } Object invokeMethod(String methodname, args) { super.invokeMethod('jira1.'+methodname, args) } } createProperty('project', String) createProperty('type', Integer, 1) createProperty('priority', Long, 4) createProperty('assignee', String) createProperty('jiraServer', String) createProperty('username', String) password = createProperty('_password', String) createProperty('maxCapturedFailures', Integer, 100) status = 'Not ready' issueDescription = "" capturedFailures = 0 isConnected = false capturedFailuresDisplay = new DelayedFormattedString('%d', 200, value {capturedFailures} ) statusDisplay = new DelayedFormattedString('%s', 200, value {status}) addEventListener( ActionEvent ) { event -> if (isConnected && event.key == 'START' ) { status = 'Capturing' setActivityStrategy(ActivityStrategies.BLINKING) } else if (isConnected && event.key == 'STOP') { status = 'Stopped' setActivityStrategy(ActivityStrategies.OFF) } else if (isConnected && event.key == 'COMPLETE') { if (capturedFailures > 0) { createIssue() issueDescription = "" setActivityStrategy(ActivityStrategies.OFF) } else { status = 'No captures' } } else if (event.key == 'RESET') { capturedFailures = 0 issuesDescription = "" } } output = { message -> if (capturedFailures < maxCapturedFailures.value) { if (isConnected && message['Status'] == false) { addFailureToIssue(message) capturedFailures++ } } } onConnect = { outgoing, incoming -> if (outgoing.terminalHolder.label == 'Web Page Runner' && outgoing.label == 'resultTerminal') { isConnected = true status = 'Ready' } } onDisconnect = { outgoing, incoming -> isConnected = false status = 'Not ready' } onRelease = { capturedFailuresDisplay.release() statusDisplay.release() } // Layout layout { property(property: maxCapturedFailures, label: 'Max captured failures', min: 1, max: 100) separator(vertical: true) box(widget: 'display') { node(label: 'Failures captured', fString: capturedFailuresDisplay, constraints: 'wmin 75') node(label: 'Status', fString: statusDisplay, constraints: 'wmin 75') } } compactLayout { box(widget:'display') { node(label: 'Failures captured', fString: capturedFailuresDisplay, constraints: 'wmin 75') node(label: 'Status', fString: statusDisplay, constraints: 'wmin 75') } } // Settings settings(label: 'Issue properties') { property(property: project, label: 'Project (required)') property(property: assignee, label: 'Assignee') box { property(property: priority, label: 'Priority (1: Blocker, 2: Critical, 3: Major, 4: Minor, 5: Trivial)') } } settings(label: 'Authentication') { property(property: jiraServer, label: 'JIRA server') property(property: username, label: 'Username') property(property: password, widget: 'password', label: 'Pasword') } private def addFailureToIssue(message) { generatorsProperties = getGeneratorPropertiesAsMessage() formatedTimestamp = timestampToFormatedDate(message['TriggerTimestamp']) issueDescription += """Request to ${message['ID']} failed at $formatedTimestamp $generatorsProperties --- """ } private def timestampToFormatedDate(long timestamp) { return new Date(timestamp) } private def createIssue() { // JIRA won't accept null values if (assignee.value == null) { assignee.value = "" } Map issueData = [ summary: "loadUI: $capturedFailures failures captured while running ${canvas.label}", description: issueDescription, type: 1, assignee: assignee.value, project: project.value, priority: priority.value ] String jiraURL = "${jiraServer.value}/rpc/xmlrpc" try { jira = new JiraProxy(jiraURL) loginToken = jira.login(username.value, password.value) issue = jira.createIssue(loginToken, issueData) status = 'Issue created' } catch (exception) { log.error(exception.message, exception) status = 'Creation failed' } } private def getGeneratorPropertiesAsMessage() { message = "" for (component in canvas.components) { if (component.category == 'generators') { message = message + "\n" + "Generator: " + component.label + "\n" for (property in component.properties) { if (isAllowed(property.key)) { message = message + property.key.capitalize() + ": " + property.value + "\n" } } } } return message } private def isAllowed(key) { return key[0] != '_' && key != 'ModelItem.description'; }13 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.3KViews0likes0CommentsRe: loadUI JIRA script component
More troubleshooting The JIRA component uses the groovy-xmlrpc dependency: http://groovy.codehaus.org/XMLRPC If one encounters problems fetching the smack dependency from Maven repos, try downloading it from here: http://www.igniterealtime.org/downloads/index.jsp and installing it manually to your local Maven (http://maven.apache.org) repo with the command: mvn install:install-file -DgroupId=jivesoftware -DartifactId=smack -Dversion=3.0.1 -Dpackaging=jar -Dfile=/path/to/file../smack.jar You may also want to check out how to configure Grape (Groovys package manager) to look in you local maven repo: http://groovy.codehaus.org/Grape Source: http://groovy.329449.n5.nabble.com/XML-RPC-td380078.html14 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.9KViews0likes0CommentsRe: loadUI JIRA script component
Aw snap. I suspect that it's down due to "human error". Thanks for the tip. I'll attach the zip as soon as I get home from work. By the way. If you don't have access to a JIRA server, you could sign up for a free sandbox environment account at http://sandbox.onjira.com14 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.9KViews0likes0CommentsloadUI JIRA script component
Hi all! I have created my first script component for creating a JIRA issue for Web Page Runner failures. If you find any bugs or have suggestions of improvements. Please let me know Download The component can be downloaded from:http://ralenius.se/apps/JIRA.zip Installation Just unzip the archive into the script-components folder in the loadUI root folder. Usage The JIRA component must be connected to the leftmost output terminal (resultTerminal) of the Web Page Runner component. The status message will change to Ready when you are connected. Next, specify the maximum number of captured failures you want in your JIRA issue by turning the knob. Then click on the Settings button and fill out the settings. Observe! The password is sent unencrypted over XML-RPC to the specified JIRA server. Use SSL if possible. Now we are ready to capture some failures. Keep an eye on the Failures captured counter to know how many failures has been captured. When the running test has been completed, an issue with all captured failures is created including the time, URL and generator properties used when the failure was captured. Troubleshooting If you get the status Issue failed when trying to create the JIRA issue, please check you settings. You could also try to run the loadUItest.bat script to a more specified error message.14 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.6KViews0likes7CommentsRe: Linux Agent Install Problem
Hi! I've also run into some problems when installing loadUI on my Arch Linux 64 bit machine. This is my JRE: $ java -version java version "1.6.0_24" Java(TM) SE Runtime Environment (build 1.6.0_24-b07) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode) When I run the installer with the following command $ sudo sh loadUI-1_0_1.sh -c it runs fine until I get to the point where I have to enter the Port for the proxy settings. Unlike what the instructions says, I am not able to just hit enter when the Port is to be given, but has to give an acual value, such as 80. This is where you can enter the proxy settings that Java WebStart will use when starting LoadUI. Leave them blank if you do not use a proxy to reach the internet. Proxy: [] Port: [] Port: [] 80 the rest of the installer runs without any problems. However, when I try to run the symlinked loadUI.sh script i get /usr/local/bin/loadUI.sh: line 41: jre/bin/javaws: No such file or directory which indicates that the javaws file is tried to be run relative to the current directory instead of the /opt/eviware/loadUI-1.0.1 directory. When instead trying to run the loadUI.sh script from the /opt/eviware/loadUI-1.0.1 directory I get this stracktrace Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/eviware/loadUI-1.0.1/jre/lib/i386/xawt/libmawt.so: libXtst.so.6: wrong ELF class: ELFCLASS64 at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1699) at java.lang.Runtime.load0(Runtime.java:770) at java.lang.System.load(System.java:1003) at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1720) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1028) at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50) at java.security.AccessController.doPrivileged(Native Method) at java.awt.Toolkit.loadLibraries(Toolkit.java:1592) at java.awt.Toolkit.<clinit>(Toolkit.java:1614) at com.sun.javaws.Main.main(Main.java:100) which indicates that loadUI is trying to run javaws with an 32 bit JRE on my 64 bit system. When I tried to run the javaws command for my own 64 bit JRE I ran in to the know bug where you don't get pass the spash screen (http://www.eviware.com/Nightly-Builds/loadui-changelog.html). I finally got it all working by downloading the latests snapshot from http://www.eviware.com/Nightly-Builds/loadui-nightly-builds.html and installing it with regular user permissions in my home folder and then running $ javaws loadUI.jnlp from the loadUI-1.0.2-SNAPSHOT folder. I also tried running the install script as sudo, but that did require that I also ran javaws as sudo A also created a custom script for launching loadUI and placed it in /usr/local/bin: #!/bin/sh cd ~/eviware/loadUI-1.0.2-SNAPSHOT javaws loadUI.jnlp Now I could just enter $ loadUI anywhere and it starts nicely Thanks for an awesome test tool, keep up the good work!14 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.6KViews0likes0Comments