Skip to content

VickyGopi/Dropdown-Assignment2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

package week4.day1;

import java.awt.Desktop.Action; import java.io.File; import java.io.IOException; import java.util.concurrent.TimeUnit;

import org.apache.commons.io.FileUtils; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.OutputType; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.interactions.Actions;

import io.github.bonigarcia.wdm.WebDriverManager;

public class Assignment2 {

public static void main(String[] args) throws IOException {
	WebDriverManager.chromedriver().setup();
	ChromeDriver driver = new ChromeDriver();
	driver.get("http://leafground.com/pages/Dropdown.html");
	driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
	driver.manage().window().maximize();
	WebElement source=driver.findElement(By.xpath("(//select)[6]//following::option[text()='Appium']"));
	WebElement target=driver.findElement(By.xpath("(//select)[6]//following::option[text()='Loadrunner']"));
	Actions actionsObj=new Actions(driver);
	actionsObj.keyDown(Keys.CONTROL).click(source).click(target).keyUp(Keys.CONTROL).perform();
	File source1 = driver.getScreenshotAs(OutputType.FILE);
	File target1 = new File ("./snaps/Dropdown.png");
	FileUtils.copyFile(source1, target1);
}

}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published