0
votes

I'd like to run Selenium tests with Jenkins and export results in TestLink.

I followed this tutorial : https://wiki.jenkins-ci.org/display/JENKINS/TestLink+Plugin

I managed to run tests from jenkins and exported the result in TestLink but only the test example which did not use selenium.

When I replaced it by a selenium-made test (exported in "Java TestNG RC") I got some errors at compilation ("class, interface, or enum expected","illegal character","illegal statement", ...)

Do I have to install a plugin for selenium or something else?

Help is appreciated.

2
what tutorial you are talking about? I don't see any link. Can you show us some code snippet where you are getting problem?Smit
Sry for that mis, i meant this tutorial wiki.jenkins-ci.org/display/JENKINS/TestLink+PluginAloys Fortier
Next time you have to make changes to question don't throws them in answers, SO gives ability to update or edit your question anytime you want.Smit

2 Answers

0
votes

My experience is that you cant trust the code that the IDE creates. I throws a lot of stuff in there that is just not useful. I work in ruby and the first time I tried to run a piece of code exported from the IDE it failed miserably. Its not surprising that it wont compile in java. You are better of coding it yourself. The IDE is a good tool to learn concepts but you really need to move beyond it fairly quickly.

The IDE will assume that you want to run the tests in a Unit framework such as JUnit or TestNG. Have you been able to run this test or any others in the testNG framework?

I would recommend starting with selenium and then build on that. It takes a lot of tools to create a solid CI environment and they are all complicated.

0
votes

In fact i ran tests in TestNG well, the issue is with Selenium. I don't know how to do if i have to import classes in the test.java or if i have to put something in my workspace ...

here is an example of a test very simple :

package com.example.tests;

import com.thoughtworks.selenium.*;
import org.testng.annotations.*;
import static org.testng.Assert.*;
import java.util.regex.Pattern;

public class try extends SeleneseTestNgHelper {
    @Test public void testTry() throws Exception {
        selenium.open("www.google.fr");
        selenium.waitForPageToLoad("30000");
    }
}

and the errors i got :

error: package com.thoughtworks.selenium does not exist
error : cannot find symbol (i got this one about 17 times).

i think i have to put selenium-java somewhere but i don't know where ...