面临的错误:
FAILED: f
java.lang.Error: Unresolved compilation problem:
The method assertEquals(String, String) is undefined for the type Assert
package firstTestNGpackage;
import net.jodah.failsafe.internal.util.Assert;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.Chrome
package utils;
import org.openqa.selenium.Point;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import java.util.concurrent.TimeUnit;
public class BrowserUtils {
public W
在我的测试中,出现了许多警报。例如,如果我没有在表单中填写所需的项,就会收到警报。到目前为止,我已经能够切换到它们并使用下面的代码执行我的操作(验证文本,单击ok/cancel)。
basicClick(AppObjects.Continue);
String warningText2 = driver.switchToAlert().getText();
Assert.assertEquals(warningText2, "You have not responded to all of the items on this page.\n\nPleas
控制台
FAILED CONFIGURATION: @BeforeMethod setUp
java.lang.NullPointerException
at com.ecinteractive.base.TestBase.initialization(TestBase.java:50)
at com.ecinteractive.testcases.LoginPageTest.setUp(LoginPageTest.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
因此,我编写了一些测试,如果我直接作为TestNG测试运行,或者运行包含测试的testng.xml文件,那么这些测试就会成功运行。但目前,当我向Java发出请求时,我正在尝试调用TestNG run方法。我使用自定义报告器将结果写入json文件,并将这些结果发送回响应中。
但是,每当我向servlet提出请求时,收到的结果都会告诉我,我的所有测试都被跳过了。为什么我的测试在直接访问时会成功运行,而在被TestNG.run()调用时只会跳过?
这是我的testng.xml:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.d
我试图使用oracle数据库中的测试数据,并使用Java在Eclipse中使用Selenium填充web应用程序中的测试数据。我正在使用属性文件中的Web元素/ id /xpath/class id。
但是,我得到了这个错误:
org.testng.TestNGException:
Method testFireFox requires 2 parameters but 0 were supplied in the @Test annotation.
at org.testng.internal.Parameters.checkParameterTypes(Parameters.ja
我已经运行了中心和节点,并且试图在节点上运行chrome浏览器的测试,但是它失败了:The path to the driver executable must be set by the webdriver.chrome.driver system property;
但我已经设置好了。下面是我使用的代码:
package seleniumgridpackage;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.Platf
我在Eclipse中使用Selenium Web驱动程序和Java,并试图从存储在package文件夹下的src文件夹中的"Object.Properties“文件中读取xpath/Class id / link id,并从数据库中填充测试数据。但是,从下面的属性文件脚本读取第二个属性后,不会读取电子邮件、Pwd和Submit的属性。我无法理解为什么脚本没有读取这些属性。
我的脚本将使用xpath / Class id / link id从存储在package文件夹下src文件夹中的"Object.Properties“文件中标识web字段、按钮、链接。对于网页字段,脚本将从数