Not Able to Execute Selenium Script From Taurus on Blazemeter

612 views
Skip to first unread message

alexis....@abstracta.com.uy

unread,
Oct 27, 2016, 4:48:25 PM10/27/16
to codename-taurus
Hi,

I Have a Selenium Java-Junit script that I have been running locally from console: bzt selenium.yml and is running fine. Now I am using Blazemeter functionality to run it but I get following error:





Here are the files I am trying to execute and the once I am uploading:



Taurus file:



---

execution:

- executor: selenium

  scenario: simple



scenarios:

  simple:

    script: selenium1.java





Selenium Script:



package tests;



import static org.junit.Assert.assertTrue;



import java.util.concurrent.TimeUnit;



import org.junit.After;

import org.junit.Before;

import org.junit.Test;


import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.firefox.FirefoxDriver;



public class selenium1 {



private WebDriver driver;


// Elements

private String inpUser = "//*[@id='user_login']";

private String inpPwd = "//*[@id='user_password']";

private String btnSignIn = "//input[@value='Sign In']";

private String firstRoomTableElement = "//table/tbody/tr[1]/td[1]/a";

private String logedUserlink = "//a[@class='dropdown-toggle']";

private String username = "alexisalvarez";

private String password = "abcd1234";





@Before

public void setUp() throws Exception {

driver = new FirefoxDriver();

driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

}



@Test

public void test1() throws Exception {


driver.get("www.blazemeter.com");

}



@After

public void tearDown() throws Exception {

driver.quit();

}

}



Any ideas? btw I did not find the way to upload files to this post :(



Thanks Alexis A. !

Andrey Pokhilko

unread,
Oct 28, 2016, 11:46:06 AM10/28/16
to codenam...@googlegroups.com

Hi,

This looks like known issue of Taurus, there is bug when your Selenium script has just single test method that runs single time.

The workaround is to set iterations/ramp-up/hold options to have some more results from the test.


Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
BlazeMeter Inc.
--
You received this message because you are subscribed to the Google Groups "codename-taurus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codename-taur...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/9f41ebd3-c352-483e-9166-473792473511%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

alexis....@abstracta.com.uy

unread,
Oct 31, 2016, 12:42:26 PM10/31/16
to codename-taurus
Hi Andrey,

I tried what you mentioned and I am still having issues, here are the files now I am trying to execute:

Taurus:

---
execution:
- executor: selenium
  language: java-junit
  iteration: 2
  hold-for: 2m
  ramp-up: 1m
  scenario: simple

scenarios:
  simple:
    script: selenium.java

Selenium Script:

package tests;

import static org.junit.Assert.assertTrue;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Selenium {

private WebDriver driver;

@Before
public void setUp() throws Exception {
driver = new FirefoxDriver();
}

@Test
public void testBlaze() throws Exception {
assertTrue(driver.getTitle().contains(
"JMeter and Performance Testing for DevOps"));
}
@Test
public void testGoogle() throws Exception {
driver.get("http://www.google.com");
assertTrue(driver.getTitle().contains(
"Google"));
}
@After
public void tearDown() throws Exception {
driver.quit();
}
}

As you may notice I added another test to the script just to avoid Taurus known issue, but I am still getting following message:

Error Running Test

The test encountered the following fatal error, and could not complete successfully:

Error:r-t-5817730250019 - Session ended without load report data


Any ideas?



Andrey Pokhilko

unread,
Nov 1, 2016, 9:19:57 AM11/1/16
to codenam...@googlegroups.com

Hi,

When I try to run your file, I get following error:

"/tmp/selenium.java:11: error: class Selenium is public, should be declared in a file named Selenium.java"


Which means that file name is case sensitive. Our cloud machines are Linux, they are case sensitive for sure.


I fix this issue by renaming file into Selenium.java and also changing YAML file accordingly, it starts working for me locally. On the production cloud, it fails, there is Taurus upgrade is needed in BlazeMeter cloud.


Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
BlazeMeter Inc.
--
You received this message because you are subscribed to the Google Groups "codename-taurus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codename-taur...@googlegroups.com.

alexis....@abstracta.com.uy

unread,
Nov 1, 2016, 10:56:28 AM11/1/16
to codename-taurus
Yes that is what is happening, I just got an answer from support team saying Taurus upgrade will be available this week. Once I get it running I will let you all know.

Thanks! 

Dmitri Pribysh

unread,
Nov 3, 2016, 8:12:41 AM11/3/16
to alexis....@abstracta.com.uy, codename-taurus
Selenium test in the cloud should work now.
> --
> You received this message because you are subscribed to the Google
> Groups "codename-taurus" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to codename-taur...@googlegroups.com
> <mailto:codename-taur...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/codename-taurus/05e45656-a962-4179-b62f-5d970454549f%40googlegroups.com
> <https://groups.google.com/d/msgid/codename-taurus/05e45656-a962-4179-b62f-5d970454549f%40googlegroups.com?utm_medium=email&utm_source=footer>.

alexis....@abstracta.com.uy

unread,
Nov 4, 2016, 11:35:15 AM11/4/16
to codename-taurus, alexis....@abstracta.com.uy
Yup, thanks for your help. Now my tests are running.


El jueves, 3 de noviembre de 2016, 9:12:41 (UTC-3), Dmitri Pribysh escribió:
Selenium test in the cloud should work now.

On 11/01/2016 05:56 PM, alexis....@abstracta.com.uy wrote:
> Yes that is what is happening, I just got an answer from support team
> saying Taurus upgrade will be available this week. Once I get it
> running I will let you all know.
>
> Thanks!
> --
> You received this message because you are subscribed to the Google
> Groups "codename-taurus" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to codename-taur...@googlegroups.com

Srinath M

unread,
Apr 5, 2017, 1:14:01 PM4/5/17
to codename-taurus
Hi Andrey,

Please provide me the steps to execute selenium scripts from taurus tool. I am able to execute jmeter scripts. As of now I am executing selenium separately.

Thanks,
Srinath

rohit....@gmail.com

unread,
Apr 6, 2017, 4:10:01 PM4/6/17
to codename-taurus
Hi Srinath,

If you get to know the details about running selenium script from Jmeter/Taurus, please help me in setting up the test.

Thanks,
Rohit Gupta
Reply all
Reply to author
Forward
0 new messages