小编vis*_*rge的帖子

Python中的Selenium Webdriver示例

我用Java编写了一个带有Webdriver的scipt,它工作得很好,下面是样本的代码

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");
   } …
Run Code Online (Sandbox Code Playgroud)

python selenium webdriver

10
推荐指数
1
解决办法
3万
查看次数

标签 统计

python ×1

selenium ×1

webdriver ×1