Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在保存用户名和密码时遇到问题。注册后,用户在注册页面获取用户名和密码。我想将此用户名和密码存储为变量,然后再使用它。这适用于 Selenium IDE 中的存储文本和 javascript,但这不适用于使用 Java 的 WebDriver。任何想法?
你是这个意思吗?
import static org.junit.Assert.*; import org.junit.Test; public class AbcTest { static String aString = ""; @Test public void test1() { aString = "abc"; } @Test public void test2() { assertTrue(aString.equals("abc")); } }