Hi Taurus support team,
my name is Stanislav. at the work i have a task to measure page load time. The project is with login page(session). The question is: How can i perform page load test for specific page when i have login form. Below is the example of my code.
Or when i have big dependent test and i test i have 10 different pages and some pages contain attachment files, how is possible to tell the test that i want to measure page load time of different pages? Will wait for your answer.
11:30:47 INFO: Average times: total 6.490, latency 0.000, connect 0.000
11:30:47 INFO: Percentile 0.0%: 6.490
11:30:47 INFO: Percentile 50.0%: 6.490
11:30:47 INFO: Percentile 90.0%: 6.490
11:30:47 INFO: Percentile 95.0%: 6.490
11:30:47 INFO: Percentile 99.0%: 6.490
11:30:47 INFO: Percentile 99.9%: 6.490
11:30:47 INFO: Percentile 100.0%: 6.490
TEST.yml
---
execution:
- executor: selenium
scenario: simple
concurrency: 1
scenarios:
simple:
requests:
- http://10.32.1.114:9080
method: GET
script: /home/xxxxx/Desktop/XXXXX/src/test/java/Testing_2.java
additional-classpath: ~/.bzt/jmeter-taurus/lib/selenium-java-2.53.1.jar
modules:
selenium:
selenium-tools:
junit:
path: ~/.bzt/jmeter-taurus/lib/junit-4.12.jar
compile-target-java: 1.7
hamcrest-core: ~/.bzt/jmeter-taurus/lib/hamcrest-core-1.3.jar
cli-aliases:
report:
reporting:
- blazemeter
Testing_2.java
*****************************************************************''WebDriver driver = new FirefoxDriver();
@Before
public void setup() {
driver.navigate().to("http://10.111.111.114:9080");
}
@Test
public void login() throws InterruptedException {
WebDriverWait wait = new WebDriverWait(driver, 60);
driver.findElement(By.cssSelector("a[ng-click='vm.closeTokenForm()']")).click();
driver.findElement(By.cssSelector("div[class='text-center']")).getText();
driver.findElement(By.linkText(user)).click();
Thread.sleep(2000);
WebElement table = driver.findElement(By.cssSelector("table[class='large-12 columns ng-scope']"));
java.util.List<WebElement> tr_collection = table.findElements(By.cssSelector("tbody > tr"));
wait.until(ExpectedConditions.visibilityOfAllElements(tr_collection)).size();
}
@After
public void close() {
driver.close();
}
About jar: you should use `additional-classpath` if your test script depends on a certain jar. `jar-name` is mostly an internal Taurus option.
ok i have tried your solution. I had one big test with one @Test annotation, now i have them 11. In TESTNG is test priority simple just write priority = 1; =2 etc, but in junit this is not supported. I have put in beginning of the class
@FixMethodOrder(MethodSorters.NAME_ASCENDING) an give for test method names test1(), test2(), test3() etc. and the result in intellij is: test1(), test10, test11, test2, test3 .... . Example of my code is below: @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class Taurus { DetectOs detectOs = new DetectOs(); private String ametnik = "xxxx"; String webPage = "http://xx.xxx.xx.xx.x:xxx"; TryOrCatch tryOrCatch = new TryOrCatch(); Nupud nupp = new Nupud(); Screencapture screencapture = new Screencapture(); @Before public void before(){ detectOs.firefox(); } @Test public void test1() throws Exception { Sisselogimine login = new Sisselogimine(); login.privateLogin(detectOs.getDriver(), webPage, ametnik); } @Test public void test2() throws InterruptedException { IsikuOtsing isikuOtsingMenu = new IsikuOtsing(); String isikukood = "xxxxxxxxxxx"; Thread.sleep(10000); isikuOtsingMenu.iskuOtsing(detectOs.getDriver(), isikukood); } @Test public void test3() { IsikuOtsing valimine = new IsikuOtsing(); valimine.isikuValimine(detectOs.getDriver()); } @Test public void test4() throws InterruptedException { System.out.println(detectOs.getDriver().findElement(By.cssSelector("h1[class='b-title__heading ng-scope']")).getText() + " on avatud"); Thread.sleep(5000); } @Test public void test5() throws InterruptedException, IOException { tryOrCatch.tryCatch(detectOs.getDriver()); screencapture.screencapture(detectOs.getDriver()); nupp.edasi(detectOs.getDriver()); } @Test public void test6() throws InterruptedException, IOException { tryOrCatch.tryCatch(detectOs.getDriver()); screencapture.screencapture(detectOs.getDriver()); MaarusedAndmed maaruseAndmed = new MaarusedAndmed(); maaruseAndmed.maaruseAndmed(detectOs.getDriver()); } @Test public void test7() throws InterruptedException, IOException { tryOrCatch.tryCatch(detectOs.getDriver()); screencapture.screencapture(detectOs.getDriver()); WebElement checkbox = detectOs.getDriver().findElements(By.cssSelector("input[ng-model='laps.valitud']")).get(0); if (!checkbox.isSelected()) { checkbox.click(); } nupp.edasi(detectOs.getDriver()); } @Test public void test8() throws InterruptedException, IOException { tryOrCatch.tryCatch(detectOs.getDriver()); screencapture.screencapture(detectOs.getDriver()); nupp.edasi(detectOs.getDriver()); } @Test public void test9() throws InterruptedException, IOException { tryOrCatch.tryCatch(detectOs.getDriver()); screencapture.screencapture(detectOs.getDriver()); ValjamaksedJaTeavitus valjamaksedJaTeavitus = new ValjamaksedJaTeavitus(); valjamaksedJaTeavitus.valjamakseJaTeavitus(detectOs.getDriver()); } @Test public void test10() throws InterruptedException, IOException { tryOrCatch.tryCatch(detectOs.getDriver()); screencapture.screencapture(detectOs.getDriver()); nupp.edasi(detectOs.getDriver()); } @Test public void test11() throws InterruptedException, IOException { tryOrCatch.tryCatch(detectOs.getDriver()); screencapture.screencapture(detectOs.getDriver()); Eelvaade eelvaade = new Eelvaade(); eelvaade.eelvaade(detectOs.getDriver()); } @After public void close() { detectOs.getDriver().close(); } } and one more question. i have packet my project to .jar file. in yml. i need to add this file in modules using jar-name: or in screnatios using additional-classpath? Will wait for your answer.
-- 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/5050803a-e0b1-486a-b27d-cc93c39b630e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
This indicates that Java compiler didn't recognize your jar from additional classpath.
Try to put a full path to your jar in `additional-classpath`
(i.e. /home/user/src/project.jar).
ok, the priority is working. My test has many other test classes that are in different packets(folders). When i run bzt test.yml it gives me error: Picture in attachment.
-- 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-taurus+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/5050803a-e0b1-486a-b27d-cc93c39b630e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Oh, so your tests are already bundled in a jar? Then you can specify this jar as a `script` in scenario, and do not specify it in`additional-classpath`.
i understand what this means :). and the classpath is fine. in attachment i have added two pictures, one for .yml and other .jar extract.
When i go to the log folder -> classes -> i dont see there complied.jar file, only Taurus.java. My mistake in configuration? have deleted old configuration ~/.bzt folder and made upgrade for bzt to 863 version. Had hamcrest issue but now its gone. Will wait for your answer what to do next
Hi,
i have tried and same error!
regards,
Hi,
16:11:03 ERROR: RuntimeError: Javac exited with error:
warning: [options] bootstrap class path not set in conjunction with -source 1.7.
Have tried to put the jar file in additional-classpath and execution section getting same error. have tried also to remove complie-target-java and same. Tried with different java versions .17, 1.8. SAME. Maybe i am doing something wrong?
conf:
---
execution:
- executor: selenium
scenario: TEST
iterations: 1
script: ~/IdeaProject/Skais2/SKAIS2_SeleniumTests/target/selenium-1.0-SNAPSHOT-tests.jar
scenarios:
TEST:
requests:
method: GET
script: ~/IdeaProject/Skais2/SKAIS2_SeleniumTests/src/test/java/Taurus.java
additional-classpath: ~/.bzt/jmeter-taurus/lib/selenium-java-2.53.1.jar
modules:
selenium:
selenium-toolks:
junit:
complie-target-java: 1.8
cli-aliases:
report:
reporting:
- blazemeter
- module: junit-xml
- module: final_stats
regards,