Serenity Not Running in my machine

345 views
Skip to first unread message

Swaroop Swaroop

unread,
Apr 4, 2016, 12:12:15 PM4/4/16
to Serenity BDD Users Group
Dear All,

I am trying to integrate Junit with Serenity for the first time. I have written the code with Page Object Model design. But the issue that i am facing are:

1. Junit Initialization error when run as a Junit Test
2. Please check the screen shot. The issue is attached.

Could anyone let me know where am i going wrong. I have not yet integrated Maven to this.

My technical details are :  Windows 7, JRE 1.8, Junit 4.0, Serenity 1.0.47.

Thanks and Regards,
Swaroop


Serenity Junit Maven.png

Swaroop Swaroop

unread,
Apr 9, 2016, 5:51:13 AM4/9/16
to Serenity BDD Users Group

Dear All,

After a lot of struggle i was able to start Serenity on my Machine using Windows 7, 32 bit, Serenity 1.0.47 with Maven integration and Browser Firefox 44.. However Serenity seems to be rejecting my tests as it says instantiating error.

Here is my code.
package com.swaroop.SerenityJunitSuiteRunner;

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

import net.serenitybdd.junit.runners.SerenityRunner;
import net.thucydides.core.annotations.Managed;
import net.thucydides.core.annotations.Steps;

@RunWith(SerenityRunner.class)
public class JunitSerenitySuiteRunner {
   
    @Managed
    WebDriver driver;
   
    @Steps
    ActitimeLogin userauthentication;
   
    @Test
    public void testActitimeLogin(){

      userauthentication.asAnAdministrator();
        
    }
}
************************************************************
package com.swaroop.SerenityJunitSuiteRunner;

import org.openqa.selenium.WebDriver;
import net.serenitybdd.core.annotations.findby.By;
import net.thucydides.core.annotations.Managed;

public class ActitimeLogin {


   
public void asAnAdministrator(){
    driver.findElement(By.xpath("//input[@id='username']")).sendKeys("admin");
    driver.findElement(By.xpath("//input[@name='pwd']")).sendKeys("manager");
    driver.findElement(By.xpath("//a[@id='loginButton")).click();
}
}
*********************************************************************************************
I am just not able to understand how Serenity works. I have followed the suggestions given to me but unable to make it run my tests. Could anyone help me with a sample serenity Junit example so that i could understand how serenity works. Please help.........



I am trying this from 2 days but i am missing it somewhere in design.

Hope this helps someone.........

Thanks and Regards,
Swaroop



Auto Generated Inline Image 1

Swaroop Swaroop

unread,
Apr 9, 2016, 8:31:03 AM4/9/16
to Serenity BDD Users Group
Dear All,

I think there is something in my machine that is not supporting
Serenity in terms of compatability.

This time I shall give a detailed info:

OS: Windows 7 32 bit
Browser Firefox 44
Java 1.8 update
Maven 3.3.3
Serenity: 1.0.47


I have followed the steps given at :
http://thucydides.info/docs/serenity-staging/#_basic_junit_integration

Here is my code:

package com.Swaroop.Serenity;

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

import net.serenitybdd.core.annotations.findby.By;
import net.serenitybdd.junit.runners.SerenityRunner;
import net.thucydides.core.annotations.DefaultUrl;
import net.thucydides.core.annotations.Managed;
@RunWith(SerenityRunner.class)

@DefaultUrl("http://localhost:81/login.do")
public class ActitimeLogin {

@Managed (driver="Firefox")
public WebDriver driver;


@Test
public void test() {

driver.findElement(By.xpath("//input[@id='username']")).sendKeys("admin");
driver.findElement(By.xpath("//input[@name='pwd']")).sendKeys("manager");
driver.findElement(By.xpath("//a[@id='loginButton']")).click();
}

}

I tried the above code and i got the below error:
T E S T S
-------------------------------------------------------
Running com.Swaroop.Serenity.ActitimeLogin
1627 [main] INFO net.serenitybdd.core.Serenity -

-------------------------------------------------------------------------------------
_______. _______ .______ _______ .__ __. __
.___________.____ ____
/ || ____|| _ \ | ____|| \ | | | | |
|\ \ / /
| (----`| |__ | |_) | | |__ | \| | | | `---|
|----` \ \/ /
\ \ | __| | / | __| | . ` | | | | |
\_ _/
.----) | | |____ | |\ \----.| |____ | |\ | | | | |
| |
|_______/ |_______|| _| `._____||_______||__| \__| |__| |__|
|__|
-------------------------------------------------------------------------------------

1842 [main] INFO net.serenitybdd.core.Serenity - Test Suite Started:
Actitime login
2489 [main] INFO net.serenitybdd.core.Serenity -
_____ _____ ____ _____ ____ _____ _ ____ _____ _____ ____
|_ _| ____/ ___|_ _| / ___|_ _|/ \ | _ \_ _| ____| _ \
| | | _| \___ \ | | \___ \ | | / _ \ | |_) || | | _| | | | |
| | | |___ ___) || | ___) || |/ ___ \| _ < | | | |___| |_| |
|_| |_____|____/ |_| |____/ |_/_/ \_\_| \_\|_| |_____|____/


TEST STARTED: test
--------------------------------------------------------------------
2492 [main] INFO net.serenitybdd.core.Serenity - TEST NUMBER: 1
org.openqa.selenium.firefox.NotConnectedException: Unable to connect
to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
\search...@gmail.com","e":false,"v":"1.0.0.1028","st":1428046533848,"mt":1426593442000}}}
1460204384382 addons.xpi DEBUG Existing add-on fxdr...@googlecode.com
in app-profile
1460204384385 addons.xpi DEBUG getModTime: Recursive scan of
{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}
1460204384386 addons.xpi DEBUG Existing add-on
{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} in app-global
1460204384387 addons.xpi DEBUG getModTime: Recursive scan of
{972ce4c6-7e08-4474-a285-3208198ce6fd}
1460204384389 addons.xpi DEBUG Existing add-on
{972ce4c6-7e08-4474-a285-3208198ce6fd} in app-global
1460204384390 addons.xpi DEBUG Existing add-on search...@gmail.com
in winreg-app-global
1460204384391 addons.xpi DEBUG getInstallState changed: false, state:
{"app-profile":{"fxdr...@googlecode.com":{"d":"C:\\Users\\Swaroop\\AppData\\Local\\Temp\\anonymous1854224812046695352webdriver-profile\\extensions\\fxdr...@googlecode.com","e":false,"v":"2.45.0","st":1460204330657,"mt":1460204329089}},"app-global":{"{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}":{"d":"C:\\Program
Files\\Mozilla Firefox\\browser\\extensions\\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi","e":true,"v":"8.0.0.9103","st":1452090606000},"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"d":"C:\\Program
Files\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","e":true,"v":"44.0.2","st":1457107255649,"mt":1455153612000}},"winreg-app-global":{"search...@gmail.com":{"d":"C:\\Users\\Swaroop\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\ol2133gy.default\\extensions\\search...@gmail.com","e":false,"v":"1.0.0.1028","st":1428046533848,"mt":1426593442000}}}
1460204384395 addons.xpi DEBUG No changes found
1460204384429 addons.xpi DEBUG Registering manifest for C:\Program
Files\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
1460204384430 addons.xpi DEBUG Loading bootstrap scope from C:\Program
Files\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
1460204384462 addons.xpi DEBUG Calling bootstrap method startup on
{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} version 8.0.0.9103
1460204384602 addons.manager DEBUG Registering shutdown blocker for XPIProvider
1460204384604 addons.manager DEBUG Provider finished startup: XPIProvider
1460204384604 addons.manager DEBUG Starting provider: LightweightThemeManager
1460204384604 addons.manager DEBUG Registering shutdown blocker for
LightweightThemeManager
1460204384605 addons.manager DEBUG Provider finished startup:
LightweightThemeManager
1460204384606 addons.manager DEBUG Starting provider: GMPProvider
1460204384618 addons.manager DEBUG Registering shutdown blocker for GMPProvider
1460204384619 addons.manager DEBUG Provider finished startup: GMPProvider
1460204384619 addons.manager DEBUG Starting provider: PluginProvider
1460204384620 addons.manager DEBUG Registering shutdown blocker for
PluginProvider
1460204384621 addons.manager DEBUG Provider finished startup: PluginProvider
1460204384621 addons.manager DEBUG Completed startup sequence
[GFX1]: Potential driver version mismatch ignored due to missing DLLs
1460204385743 addons.xpi-utils DEBUG Starting async load of XPI
database C:\Users\Swaroop\AppData\Local\Temp\anonymous1854224812046695352webdriver-profile\extensions.json
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
1460204387257 addons.manager DEBUG Starting provider: <unnamed-provider>
1460204387258 addons.manager DEBUG Registering shutdown blocker for
<unnamed-provider>
1460204387258 addons.manager DEBUG Provider finished startup: <unnamed-provider>
1460204387890 addons.xpi-utils DEBUG Async JSON file read took 0 MS
1460204387890 addons.xpi-utils DEBUG Finished async read of XPI
database, parsing...
1460204387909 addons.xpi-utils DEBUG Successfully read XPI database
1460204388680 addons.manager DEBUG Starting provider: PreviousExperimentProvider
1460204388680 addons.manager DEBUG Registering shutdown blocker for
PreviousExperimentProvider
1460204388681 addons.manager DEBUG Provider finished startup:
PreviousExperimentProvider


What I think:
Browser may not be supported
Java may be the reason
Serenity version may be an issue

Kindly let me know if anybody has a solution for this. I have been at
it for 3 days now. if it works in a different browser version please
let me know.

Thanks and i appreciate your precious time in this regard.

Regards,
Swaroop

John Smart

unread,
Apr 9, 2016, 9:04:39 AM4/9/16
to Swaroop Swaroop, Serenity BDD Users Group
1.0.47 is quite old - 1.1.18 is more up to date. Have you read http://thucydides.info/docs/articles/an-introduction-to-serenity-bdd-with-junit.html?

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.
> To post to this group, send an email to thucydid...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages