Help Index
Selenium Website
Does Testuff have an automation API?
Yep! It allows your automation to update test results in Testuff. Automation can also be used to automatically export your data.
How does it work?
Via HTTP POST over SSL. Each company has a custom URL and a unique token for identification. Each test has a unique ID. Test results are POSTed to the relevant URL and include as parameters the token, test ID, lab name, and test result. Following the request, Testuff updates the test result accordingly. Read more about the automation URL on the automation page.
Selenium Integration
There are several ways to integrate Selenium with Testuff. Our own preferred method is to export the Selenium script into Python or Perl, and then use the code on our automation help page to update Testuff.
In addition, if you need to integrate Testuff directly from the IDE, or export HTML scripts, we created a Selenium user extension for Testuff, which allows you to update Testuff with Selenium commands.
To use it:
- Download the Testuff Selenium User Extension.
- Extract call_testuff.js on your computer from the zip file.
- Load it into the IDE. Go to the Selenium options screen and then browse for the call_testuff.js file you saved. Make sure to load it as Selenium Core Extension
- Close the IDE and open it again.
- You should now have a number of additional commands, for example, resetTestuffParameters, addTestuffParameter, etc.
To update Testuff directly from your Selenium script, you will need to provide the correct API URL, test ID, etc. Make sure to read our automation help page before you start. Use the following commands in order:
- resetTestuffParameters()
- addTestuffParameter(lab_name,YOUR_LAB_NAME)
- addTestuffParameter(test_id,YOUR_TEST_ID)
- addTestuffParameter(status,”passed”)
- addTestuffParameter(comment,”your comment text”)
- callTestuff(YOUR_AUTOMATION_URL)
You can download the Testuff Selenium extension on Selenium’s website.
Sample: Eclipse on Java Selenium-RC
public void testuff_pass() throws Exception {
try {
String lab_name = "sanity";
String test_ID = "abcdefghijklmnop"; // replace test ID with correct value from Testuff
String test_status = "passed";
String tester_name = "John";
String comment = "comment text";
String token = "01234567890abcdefghijkl";
// replace token with your own token value from Testuff API settings screen
System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()) ;
String postBody =
"token=" + URLEncoder.encode(token, "UTF-8") +
"&lab_name=" + URLEncoder.encode(lab_name, "UTF-8") +
"&test_id=" + URLEncoder.encode(test_ID, "UTF-8") +
"&status=" + URLEncoder.encode(test_status, "UTF-8") +
"&tester_name=" + URLEncoder.encode(tester_name, "UTF-8") +
"&comment=" + URLEncoder.encode(comment, "UTF-8");
// call Testuff server
URL url = new URL("https://serviceX.testuff.com/company_id/automation");
// replace company_id and host name values from Testuff API settings screen
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(postBody);
wr.flush();
wr.close();
}
catch (Exception e) {System.out.println(e.toString());}
}
