SerenityRunner .class cannot be resolved

1,611 views
Skip to first unread message

Swaroop Swaroop

unread,
May 22, 2016, 2:52:00 AM5/22/16
to Serenity BDD Users Group
Dear Friends,

I have been trying to implement Serenity in my project for a while now. I am struck at one place. Could anyone please check the following  issue for me.

Technical Details.
Windows 7, 32bit operating System, Junit with Serenity.

I am using POM.xml and here is the screen shot:

[INFO] Scanning for projects...
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building Serenity JUnit Quick Start Project 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ junit-quick-start ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\workspace\Serenity Webdriver\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ junit-quick-start ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ junit-quick-start ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\workspace\Serenity Webdriver\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ junit-quick-start ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\workspace\Serenity Webdriver\target\test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/workspace/Serenity Webdriver/src/test/java/com/Swaroop/Serenity/JunitSuite.java:[9,10] cannot find symbol
  symbol: class SerenityRunner
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 31.931 s
[INFO] Finished at: 2016-05-22T11:57:55+05:30
[INFO] Final Memory: 20M/53M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project junit-quick-start: Compilation failure
[ERROR] /D:/workspace/Serenity Webdriver/src/test/java/com/Swaroop/Serenity/JunitSuite.java:[9,10] cannot find symbol
[ERROR] symbol: class SerenityRunner
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Serenity.png

Swaroop Swaroop

unread,
May 22, 2016, 4:17:58 AM5/22/16
to Serenity BDD Users Group

 I tried with the latest version 1.1.34 jar but still serenityRunner.class is not resolved.

Swaroop Swaroop

unread,
May 22, 2016, 4:26:28 AM5/22/16
to Serenity BDD Users Group
Here is my JunitSuite:

package com.Swaroop.Serenity;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

import net.thucydides.core.annotations.Managed;
@RunWith(SerenityRunner.class)

public class JunitSuite {
        @Managed (driver="firefox")
        public static WebDriver driver;
       
        @Test
        public static void Search(){
        driver.get("http://www.google.com");
        driver.findElement(By.xpath("//input[@name='q']")).sendKeys("Selenium");
       
    }
   
   
}

SerenityRunner.class is not resolved even after using 1.1.34 jar of serenity-core and serenity-junit jar. Please help.

Auto Generated Inline Image 1

Harry King

unread,
May 23, 2016, 3:44:59 AM5/23/16
to Serenity BDD Users Group
Not sure if its causing your problem, but you libraries folder appears to have multiple versions of Serenity in there, I'd stick with the latest stable release (1.1.34 at time of writing).

Thanh Chuong

unread,
May 23, 2016, 6:24:13 AM5/23/16
to Serenity BDD Users Group
Hi Swaroop,

You need to import SerenityRunner into your test class (JunitSuite.java)

import net.serenitybdd.junit.runners.SerenityRunner;




Regards,
Thanh Chuong

Swaroop Swaroop

unread,
May 23, 2016, 10:16:54 AM5/23/16
to Thanh Chuong, Serenity BDD Users Group

Thank you for your guidance. Will try and let you know.

--
You received this message because you are subscribed to a topic in the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/thucydides-users/7w7PcmC-IJw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to thucydides-use...@googlegroups.com.
To post to this group, send email to thucydid...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Swaroop Swaroop

unread,
May 23, 2016, 10:58:48 AM5/23/16
to Thanh Chuong, Serenity BDD Users Group

It is working now. Thank you.

Swaroop Swaroop

unread,
May 26, 2016, 8:56:04 AM5/26/16
to Thanh Chuong, Serenity BDD Users Group

Why does the browser Firefox not open when serenity starts. I have selenium 2.53. Still facing this error. Can somebody suggest.

Thanks
Swaroop

John Smart

unread,
May 26, 2016, 9:00:33 AM5/26/16
to Swaroop Swaroop, Thanh Chuong, Serenity BDD Users Group
This is often a symptom of an issue with the version of Firefox (too new or too old)

Sent from my iPhone
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages