我用Java编写了一个scipt和Webdriver,它运行良好,下面是示例代码
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverBackedSelenium;
import org.openqa.selenium.firefox.FirefoxDriver;
import com.thoughtworks.selenium.Selenium;
import java.util.*;
import java.lang.Thread.*;
public class Login {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
}
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
Selenium selenium = new WebDriverBackedSelenium(driver, "http://192.168.10.10:8080/");
selenium.open("/");
selenium.keyPress("name=user_id", "admin");
}
}
}
但我的要求是用webdriver在python中实现相同的功能,您能告诉我如何使用上面的示例和webdriver二进制文件来实现这个功能,以及如何为相同的程序进行设置吗
你看过python bindings for WebDriver的说明了吗?
^{} 很清楚,虽然不是代码的直接翻译:
一个测试模块GoogleOneBox为一个有google搜索栏的页面建模 (url移动了一点)。
这是个插头,但也许能回答你的问题:
holmium.core文档中的详细信息holmium.core documentation
运行方式:
相关问题 更多 >
编程相关推荐