Created
February 7, 2015 06:11
-
-
Save udayanem/fbd78fcffc9b48018ff6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.TimeUnit; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.firefox.FirefoxDriver; | |
import org.openqa.selenium.interactions.Actions; | |
public class ActBuilder | |
{ | |
public static void main(String[] args) throws InterruptedException | |
{ | |
WebDriver driver=new FirefoxDriver(); | |
driver.get("http://www.flipkart.com/"); | |
driver.manage().window().maximize(); | |
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); | |
WebElement ele=driver.findElement(By.xpath("//li[@class='menu-l0 ' and @data-key='electronics']")); | |
Actions builder=new Actions(driver); | |
// builder.moveToElement(ele).build().perform(); | |
builder.moveToElement(ele).perform(); | |
Thread.sleep(2000); | |
WebElement nexus=driver.findElement(By.xpath("//a[@data-tracking-id='0_Nexus 6']")); | |
// nexus.click(); | |
// builder.moveToElement(nexus).click().build().perform(); | |
builder.click(nexus).build().perform(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment