Перейти к содержимому

GANT

Регистрация: 23 апр 2015
Offline Активность: 16 авг 2017 08:48
-----

Мои темы

Общие переменные в chakram + mocha

10 августа 2017 - 12:29

Все привет.

Пишу API тесты с использованием chakram (http://dareid.github.io/chakram/) и mocha (https://mochajs.org/). Проблема с конфигурацией. Не смог найти решения, как мне задать переменную, например адрес где находится сама API, чтобы потом использовать этот адрес в любых местах теста. Так же чтобы значение этой переменной можно было изменять.

 

Может кто сталкивался с этим и знает красивое решение?


Ошибка java.lang.AbstractMethodError при запуске теста

28 сентября 2016 - 20:54

Всем привет. Новичок в автоматизации. Пытаюсь создать простенький тест, чтобы убедиться что все работает, но нет. Выдает ошибку, не могу понять в чем дело. Подскажите, пожалуйста, что не так и почему, где мой косяк.

 

Сам тест

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

public class TestClass {

    public WebDriver driver;

    @BeforeMethod
    public void setUp() {
        System.setProperty("webdriver.chrome.driver", "D:\\Programming\\chromedriver.exe");
        driver = new ChromeDriver();
    }

    @Test
    public void forTest() {
        driver.get("http://onliner.by");
        driver.manage().window().maximize();
    }

    @AfterMethod
    public void tearDown()  {
        driver.quit();
    }
}


pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>Auto</groupId>
    <artifactId>Automation</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.9.12</version>
            <scope>test</scope>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>3.0.0-beta3</version>
        </dependency>

    </dependencies>


</project>

Ошибка

java.lang.AbstractMethodError: org.testng.remote.RemoteTestNG$DelegatingTestRunnerFactory.newTestRunner(Lorg/testng/ISuite;Lorg/testng/xml/XmlTest;Ljava/util/Collection;Ljava/util/List;)Lorg/testng/TestRunner;
	at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:594)
	at org.testng.SuiteRunner.init(SuiteRunner.java:168)
	at org.testng.SuiteRunner.<init>(SuiteRunner.java:117)
	at org.testng.TestNG.createSuiteRunner(TestNG.java:1339)
	at org.testng.TestNG.createSuiteRunners(TestNG.java:1326)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1180)
	at org.testng.TestNG.runSuites(TestNG.java:1104)
	at org.testng.TestNG.run(TestNG.java:1076)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:110)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:205)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:174)
	at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:125)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)