我想記錄slider captcha給我們的客戶網站。無法使用Selenium Webdrive控制滑塊captcha jquery?
我們已接到命名爲http://www.fmylife.com/signup
其他網站這個概念這有滑塊驗證碼註冊
我嘗試使用硒的webdriver行動建設者
public class TestFmylife {
WebDriver driver;
Selenium selenium;
@BeforeMethod
public void startSelenium() {
driver = new FirefoxDriver();
selenium = new WebDriverBackedSelenium(driver, "http://www.fmylife.com/");
driver.manage().window().maximize();
}
@AfterMethod
public void stopSelenium() {
driver.close();
}
@Test
public void testFmylife() {
selenium.open("/");
selenium.click("link=Sign up");
selenium.waitForPageToLoad("30000");
selenium.type("name=login", "testfmylife");
selenium.type("name=pass", "[email protected]");
selenium.type("name=passc", "[email protected]");
selenium.type("name=mail", "[email protected]");
Point MyPoint= driver.findElement(By.xpath("//*[@id='bgSlider']")).getLocation();
WebElement someElement = driver.findElement(By.xpath("//*[@id='bgSlider']"));
System.out.println(MyPoint.x+"--------"+MyPoint.y);
Actions builder = new Actions(driver);
Action dragAndDrop = builder.clickAndHold(someElement).moveByOffset(MyPoint.x,(MyPoint.y + 100)).release().build();
dragAndDrop.perform();
selenium.click("css=div.form > div.ok > input[type=\"submit\"]");
}
}
但我不能使用此代碼
幫助移動滑塊我排序了這一點
是在你的系統中這方面的工作?它不是在我的系統工作 – 2012-08-16 07:15:10