---
modules:
selenium:
selenium-tools:
junit:
path: ~/.bzt/selenium-taurus/tools/junit/junit.jar # path to JUnit framework
selenium-server: ~/.bzt/selenium-taurus/selenium-server.jar # path to Selenium Standalone Server
jar-name: /Users/ybushnev/Documents/workspace/OwnProjects/TaurusTestProject/out/artifacts/Selenium_jar/Selenium.jar
working-dir: classes # set name of runner working directory within artifacts dir
compile-target-java: 1.7 # -source and -target option value for javac
execution:
- executor: selenium
iterations: 5
scenario: complex
scenarios:
complex:
script: ../selenium/DestinationOfTheWeekTests.java
settings:
artifacts-dir: /tmp/taurus-%Y-%m-%d_%H-%M-%S.%fbzt
This is an issue of hamcrest lib download from outdated location.
We've already fixed it for the next release, you can install it
from snapshot:
http://gettaurus.org/docs/DeveloperGuide/#Python-Egg-Snapshots
| Andrey Pohilko Chief Scientist P: +7 (909) 631-21-69 |
--
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/4728cf97-7ad8-473f-b729-eefaa1051568%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
package com.bushnev.selenium;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Test2 {
WebDriver driver = new FirefoxDriver();
@Before
public void setup() {
driver.navigate().to("http://google.com");
}
@Test
public void login() throws InterruptedException {
driver.getTitle();
}
}
---
execution:
- executor: selenium
iterations: 5
scenario: complex
scenarios:
complex:
script: /home/alphasense/Documents/TaurusTestProject/src/test/java/com/bushnev/selenium/Test2.java
modules:
selenium:
selenium-tools:
junit:
jar-name: compiled_jar_from_provided_sources.jar
reporting:
- module: junit-xml
11:19:23 ERROR: RuntimeError: Test runner JUnitTester has failed: Aug 30, 2016 11:19:22 AM taurusjunit.CustomRunner main
INFO: Starting: [/home/alphasense/Documents/TaurusTestProject/src/test/java/com/bushnev/taurus/2016-08-30_11-19-20.261286/customrunner.properties]
Aug 30, 2016 11:19:22 AM taurusjunit.CustomRunner processJAR
INFO: Processing JAR: /home/alphasense/Documents/TaurusTestProject/src/test/java/com/bushnev/taurus/2016-08-30_11-19-20.261286/classes/compiled_jar_from_provided_sources.jar
Exception in thread "main" java.lang.NoClassDefFoundError: Test2 (wrong name: com/bushnev/selenium/Test2)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
To unsubscribe from this group and stop receiving emails from it, send an email to codename-taurus+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/4728cf97-7ad8-473f-b729-eefaa1051568%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "codename-taurus" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codename-taurus/bezGA6r71GY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codename-taurus+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/da22f83b-c509-3651-07e4-c650022e0e5e%40blazemeter.com.
Just don't change "selenium-tools" setting, this is for internal Taurus functioning.
Looks like if you will remove whole "modules" block in your
config, it will work then.
| Andrey Pohilko Chief Scientist P: +7 (909) 631-21-69 |
To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/e8aa1ecd-530c-2104-3d7a-05551dbad2f8%40blazemeter.com.
Since you have specified "package" but pointed "script" onto specific file, you got JAR with not what you expect.
Either remove "package" in your Java file or point "script" onto
sources root
(/home/alphasense/Documents/TaurusTestProject/src/test/java in
your case).
| Andrey Pohilko Chief Scientist P: +7 (909) 631-21-69 |
scenarios:then in compiled jar I will have only this class. And what if I have some imports inside like "import com.bushnev.frameowrk....'....
complex:
script: /home/alphasense/Documents/TaurusTestProject/src/test/java/taurus/Test4.java
import com.bushnev.framework.BasePage;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Test4{
@Test
public void login() throws InterruptedException {
BasePage basePage = new BasePage();..then this script will fail with reasonable error:
System.setProperty("webdriver.chrome.driver", "/home/alphasense/Documents/chromedriver");
WebDriver driver = new ChromeDriver();
driver.get("http://google.com");
driver.getTitle();
driver.close();
}
}
additional-classpath: # optional, following libs will be added to java classpathAnd yes, I don't have any previous error right now, but test failed without any error entry in bzt logs. Failed on that line:
- /home/alphasense/Documents/TaurusTestProject/out/artifacts/Selenium_jar/Selenium.jar
BasePage basePage = new BasePage();And I can understand that the reason on this line only because if I put it at the end, all other steps work fine while the request status in Taurus is still failed. If I put it at the begging, the script failed without execution of other steps and if I remove that line, then it works fine.
Ppoint "script" onto sources root /home/alphasense/Documents/TaurusTestProject/src/test/java
, this is the thing that will fix classpath searching for you.
| Andrey Pohilko Chief Scientist P: +7 (909) 631-21-69 |
scenarios:instead of
complex:
script: /home/alphasense/Documents/TaurusTestProject/src/test/java
scenarios:
complex:
script: /home/alphasense/Documents/TaurusTestProject/src/test/java/taurus/Test4.java
--
You received this message because you are subscribed to a topic in the Google Groups "codename-taurus" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codename-taurus/bezGA6r71GY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codename-taurus+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/1995a2a7-068a-bcdf-12b1-a4fe75a3973e%40blazemeter.com.
I think you got it right with additional-classpath
| Andrey Pohilko Chief Scientist P: +7 (909) 631-21-69 |



Can you put your code into GitHub repository, so we'll be able to
take it and reproduce your issues?
| Andrey Pohilko Chief Scientist P: +7 (909) 631-21-69 |

Thanks! That helped to locate the issue. I have created PR to fix
it: https://github.com/Blazemeter/taurus/pull/323
First thing, you should have base classes for your tests inside "test" directory, since they belong to test and not to main project code. Selenium testing projects usually have no "main" code, only "test".
Second thing, move taurus config out of "java", as they are not
part of Java source code.
Here's how my working configuration looks like (assuming PR is applied):

| Andrey Pohilko Chief Scientist P: +7 (909) 631-21-69 |
To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/44fa9eae-8e2d-77cc-e5d0-0d14bc842c73%40blazemeter.com.
From what you say, I assume that all these additional classes are
most likely in some JAR, regardless of who has created them, maven
build for example. So these JARs are meant to be included into
"additional-classpath". With proper bzt launch directory, relative
paths to these JARs would work fine.
I personally prefer to launch everything from maven project root
and rely on "target" directory as relative path.
| Andrey Pohilko Chief Scientist P: +7 (909) 631-21-69 |

Hi,
This fix will be part of version 1.6.9. If you see PR merged then
latest
developer snapshot will contain the fix.
I tried to make a working example from your code and located one
more
issue. Created next PR to fix the issue:
https://github.com/Blazemeter/taurus/pull/325
In the PR, I've also added correct project into examples
directory. You
can review it on the PR page or wait for merge to happen.
Thanks for your help!
| Andrey Pohilko Chief Scientist P: +7 (909) 631-21-69 |
Actually no, I meant that almost all the time, we have to use classes from the main section into the test section. And it is not related to additional dependencies like from maven or some jars.. I mean only own code.
I can say that usually QA automation projects have the same pattern: page Object classes, db DAO's for testing and all other project testing stuff (not tests itself) located into the main section.
And as for not QA Automation.. I think it is a common case when we have for example one Enum entity which is located into the main section. In this case why we need to create the same Enum into the test section? For sure we want to reuse it in both places.
And I had a discussion with 2 other engineers who are trying to use Taurus with selenium and they also have the same concern about that.
Sorry if I didn't get your point, but for my point of view it is pretty critical for framework usage.
And as for PR.. Based on the merge history, I thought that it is already included into the last version: (bzt-1.6.8.874.tar.gz, Sep 06, 2016) but to tell the truth, the last build still has this issue for even when I changed everything in the way you mentioned above.
- yaml is moved out from java
- script pointed to java folder
- all other classes moved to test section (really want to try it on simple test project, but don't see how I can go ahead with it in the main project yet)
From what you say, I assume that all these additional classes are most likely in some JAR, regardless of who has created them, maven build for example. So these JARs are meant to be included into "additional-classpath". With proper bzt launch directory, relative paths to these JARs would work fine.
I personally prefer to launch everything from maven project root and rely on "target" directory as relative path.
Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
On 09/04/2016 03:33 PM, Yuri Bushnev wrote:
Great! Thanks for the PR and clarification.
As for tests related code.. Quite often (all of 6 projects where I was working) there are separate QA Automation projects which contain code related only to testing activities (for Backend, DB, Selenium or Performance testing). In this case all code which is related to this QA Automation framework itself is always located in the main java section:
- Helpers- DAO for db testing- Page object for selenium- Different models and so on
- and many others things...
while tests itself are located under java/test.
And I think almost all QA Automation engineers go with this pattern. And I believe that even programmers very often use different models and other code from the main project part to avoid duplication.
That's why I'm just wondering is it possible to implement some workaround as improvement for it in some future versions? I'm sure that it will be critical for many framework users who want to go with selenium tests execution via Taurus.
On Sun, Sep 4, 2016 at 2:47 PM, Andrey Pokhilko <and...@blazemeter.com> wrote:
Thanks! That helped to locate the issue. I have created PR to fix it: https://github.com/Blazemeter/taurus/pull/323
First thing, you should have base classes for your tests inside "test" directory, since they belong to test and not to main project code. Selenium testing projects usually have no "main" code, only "test".
Second thing, move taurus config out of "java", as they are not part of Java source code.
Here's how my working configuration looks like (assuming PR is applied):
Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
On 09/04/2016 01:03 PM, Yuri Bushnev wrote:
Thank you for the quick response. I have simplified the project just to save your time and to show the general idea of my issue.
https://github.com/BushnevYuri/TaurusSImpleTestProject
I have test:
TaurusSImpleTestProject/src/test/java/selenium/JunitBaseTest.java
Which has dependency on:
Taurus/TaurusSImpleTestProject/src/main/java/framework/BaseTestClassForBaseJunitTest.java
The main idea that I want to run some specified test without specifying full path on project jar file in 'additional-classpath' (as it is not possible to do in fully automation way in continuous integration) like in:
TaurusSImpleTestProject/src/test/java/taurus/TaurusScriptV1.yml file.
If it is not possible to do in any ways and only one possible solution is to run only all tests but pointing script to source directory (I guess that in this case we can not specify tests at all) then it should be like in:
TaurusSImpleTestProject/src/test/java/taurus/TaurusScriptV2.yml.
Unfortunately it is also not the great option as we can not specify which tests and how to run. But at least it will be working for CI automation. But for now both options don't work for me without specifying 'aditional-classpath'.
On Sun, Sep 4, 2016 at 12:05 PM, Andrey Pokhilko <and...@blazemeter.com> wrote:
Can you put your code into GitHub repository, so we'll be able to take it and reproduce your issues?
Andrey Pohilko
Chief Scientist
P: +7 (909) 631-21-69
On 09/04/2016 12:01 PM, Yuri Bushnev wrote:
Hello Andrey,
Unfortunately, it seems that specifying 'additional-classpath' doesn't look as great solution for automation because it is not possible to specify it with relative path (only full path can be used => doesn't work well for automation).
That's why I decided to go with your second option: point script to java source root. But it seems it doesn't work also. If I will put my code as:
-src
--main
---java
----[automation framework classes]
--test
---java
----[junit tests]
and point script to /home/alphasense/Documents/TaurusTestProject/src/test/java in this case I get compilation error :
and I even don't seen compiled.jar in result folder.
But if I put my code like:
-src
--main
---java
----[nothing]
--test---java----[automation framework classes]
----[junit tests]
and point script to /home/alphasense/Documents/TaurusTestProject/src/test/java in this case I don't get compilation error, I see the compiled.jar but there is still no other classes inside and Taurus failed during execution. And only in junit.err I can find:
Exception in thread "main" java.lang.NoClassDefFoundError: framework/BaseTest
scenarios:
some-scenario-1:
script: src/test/java/selenium/Test1.java
additional-classpath:
- /Users/ybushnev/Documents/workspace/OwnProjects/TaurusTestProject/out/artifacts/TaurusTestProject/TaurusTestProject.jar
some-sceanrio-2:
script: src/test/java/selenium/Test2.java
additional-classpath:
- /Users/ybushnev/Documents/workspace/OwnProjects/TaurusTestProject/out/artifacts/TaurusTestProject/TaurusTestProject.jar
some-scenario-3:
script: src/test/java/selenium/Test3.java
additional-classpath:
- /Users/ybushnev/Documents/workspace/OwnProjects/TaurusTestProject/out/artifacts/TaurusTestProject/TaurusTestProject.jar
.....
scenarios:Thanks,additional-classpath:some-scenario-1:
- /Users/ybushnev/Documents/workspace/OwnProjects/TaurusTestProject/out/artifacts/TaurusTestProject/TaurusTestProject.jar
script: src/test/java/selenium/Test1.java
some-sceanrio-2:
script: src/test/java/selenium/Test2.java
some-scenario-3:
script: src/test/java/selenium/Test3.java
.....
Yuri.
Thanks,Iurii.
-- You received this message because you are subscribed to a topic in the Google Groups "codename-taurus" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/codename-taurus/bezGA6r71GY/unsubscribe. To unsubscribe from this group and all its topics, send an email to codename-taur...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/1995a2a7-068a-bcdf-12b1-a4fe75a3973e%40blazemeter.com.
For more options, visit https://groups.google.com/d/optout.
-- You received this message because you are subscribed to a topic in the Google Groups "codename-taurus" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/codename-taurus/bezGA6r71GY/unsubscribe. To unsubscribe from this group and all its topics, send an email to codename-taur...@googlegroups.com.
Okay, we'll add global additional-classpath in the 1.7.1. It will be set on this level:
---
modules:
selenium:
additional-classpath: ...
| Andrey Pohilko Chief Scientist P: +7 (909) 631-21-69 |
-- 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/02dd2d0e-641c-4e19-9fe9-1178b99a8a7b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Thanks,Iurii.
-- You received this message because you are subscribed to a topic in the Google Groups "codename-taurus" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/codename-taurus/bezGA6r71GY/unsubscribe. To unsubscribe from this group and all its topics, send an email to codename-taur...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/1995a2a7-068a-bcdf-12b1-a4fe75a3973e%40blazemeter.com.
For more options, visit https://groups.google.com/d/optout.
-- You received this message because you are subscribed to a topic in the Google Groups "codename-taurus" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/codename-taurus/bezGA6r71GY/unsubscribe. To unsubscribe from this group and all its topics, send an email to codename-taur...@googlegroups.com.
That fix was already released, try upgrading to latest version
(1.7.2)
| Andrey Pohilko Chief Scientist P: +7 (909) 631-21-69 |
-- 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/3af16e65-162d-4f43-a35e-1d545cf7421e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.