本文介绍了在Intellij中创建TestNG xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Intellij Idea中创建TestNG.xml

How to create TestNG.xml in Intellij Idea

这是我的测试代码

import com.applitools.eyes.RectangleSize;
import com.applitools.eyes.selenium.Eyes;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

import java.util.concurrent.TimeUnit;


public class mas1 {

    @Test
    public void test() {

        WebDriver driver = new FirefoxDriver();

        driver.get("https://demo.applitools.com");
        driver.manage().timeouts().implicitlyWait(25, TimeUnit.SECONDS);

        driver.quit();

    }
}

我尝试通过以下链接创建TestNG.xml

I tried to create TestNG.xml following the below link

使用IntelliJ IDEA的TestNG:如何在IntelliJ IDEA 9中使用testng.xml文件

有人可以向我解释如何创建TestNG.xml

Can somebody explain to me how to create TestNG.xml

我不知道我必须在套件字段和程序包名称中插入什么来手动创建它.

I don't know what i have to insert in suite field and package name to create it manually.

下面是用于目录浏览的图像,没有包

Below is image for my directory browsing, there are no packages

推荐答案

这是您的项目的示例XML

This is sample XML for your Project,

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite">
  <test thread-count="5" name="Test">
    <classes>
      <class name="java.mas1"/>
    </classes>
  </test> <!-- Test -->
</suite> <!-- Suite -->

这篇关于在Intellij中创建TestNG xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 09:59