小编Dom*_*Dom的帖子

断言上“类型不匹配:无法从 void 转换为 boolean”

代码如下:

import static org.testng.Assert.assertEquals;

import static org.testng.Assert.assertTrue;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

public class ContactPageElements {
    public static WebElement element = null;
    public static String baseURL1 = "http://something.com";

    //Clicking logo should take you back to the baseURL
    public static void clickLogo (WebDriver driver) {
        element = driver.findElement(By.xpath(".//*[@id='blah'"));
        element.click();
        String currentURL = driver.getCurrentUrl();
        assert.assertEquals(currentURL, baseURL1);
    }
}
Run Code Online (Sandbox Code Playgroud)

对于断言,我收到错误:“类型不匹配:无法从 void 转换为布尔值”

java testng selenium assert

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

标签 统计

assert ×1

java ×1

selenium ×1

testng ×1