I want to record the captcha slider specified on our client website.
We got this concept from another site called http://www.fmylife.com/signup
It has a captcha slider for registering.
I am trying to use the selenium webdriver action constructor
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", " 123@fmylife "); selenium.type("name=passc", " 123@fmylife "); selenium.type("name=mail", " testfmylife@gmail.com "); 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\"]"); } }
But I can not move the slider using this code
Help me figure this out
Jasmine.Olivra
source share