利用Selenium实现后台影片的循环添加
禁止使用Xpah的绝对路径,如:/html/body/header/nav/div[2]/ul/li[3]/a。如每出现一处,扣10分,出现2处,扣除20分,依次类推。
1、实现登录
2、点击“影片管理/添加影片信息”
3、利用循环实现5条记录的添加并保存
package homework1;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.Select;
public class Movie {
public static void main(String[] args) throws InterruptedException {
// 登录
String url = "http://localhost:8032/mymovie/admin.php/Login/index.html";
System.setProperty("webdriver.gecko.driver", "D:\\Demo\\geckodriver.exe");
System.setProperty("webdriver.firefox.bin","F:\\software\\firefox.exe" )