小编UzI*_*zIT的帖子

无法解析符号“之前” - Intellij jUnit

我是 Intellij IDEA 的新手。我正在尝试使用 jUnit 注释 @Before 和 @After 进行我的硒测试。即使我在类中导入 jUnit,我也无法使用注释。有什么帮助吗?

package Config;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
import org.junit.Before;
import org.junit.Test;

public class browserConfig {

    public static WebDriver driver = null;
    public static Properties config = new Properties();
    public static FileInputStream fis;

    @Before
    public void initBrowser(){

        if (driver ==null){

            try{

                fis = new FileInputStream(System.getProperty("user.dir") + "//src//main//java//Config//config.properties");

            } catch (FileNotFoundException e) {

                e.printStackTrace();

            }
Run Code Online (Sandbox Code Playgroud)

java junit intellij-idea

2
推荐指数
1
解决办法
9837
查看次数

标签 统计

intellij-idea ×1

java ×1

junit ×1