-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
678 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.chrome.ChromeDriver; | ||
import org.openqa.selenium.interactions.Actions; | ||
import org.testng.annotations.BeforeTest; | ||
import org.testng.annotations.Test; | ||
|
||
public class Mousehover { | ||
|
||
private WebDriver driver; | ||
private Mousehoverkoarkopage nayapage; | ||
|
||
@BeforeTest | ||
public void first() throws InterruptedException{ | ||
System.setProperty("web-driver.chrome.driver","D:\\\\browserdriver\\\\chromedriver\\\\chromedriver.exe"); | ||
driver=new ChromeDriver(); | ||
nayapage=new Mousehoverkoarkopage(driver); | ||
// driver.get("https://www.hamropatro.com/"); | ||
// driver.get("https://jqueryui.com/droppable/"); | ||
driver.get("https://jqueryui.com/resizable/"); | ||
String title=driver.getTitle(); | ||
driver.manage().window().maximize(); | ||
|
||
} | ||
@Test | ||
public void t1() throws InterruptedException{ | ||
driver.switchTo().frame(nayapage.getframe()); | ||
|
||
Thread.sleep(1000); | ||
Actions action=new Actions(driver); | ||
action.dragAndDropBy(nayapage.getresize(),300,150).perform(); | ||
|
||
|
||
// The following code drags and drops the loop is just for fun | ||
//****************************** | ||
// for(int i =1;i>0;i++) { | ||
// Thread.sleep(1000); | ||
// driver.switchTo().frame(nayapage.getframe()); | ||
// Thread.sleep(1000); | ||
// | ||
// Actions action = new Actions(driver); | ||
// action.dragAndDrop(nayapage.getdrag(), nayapage.getdrop()).perform(); | ||
// Thread.sleep(1000); | ||
// driver.navigate().refresh(); | ||
// } | ||
//******************************* | ||
// yo tala ko code le chai hover garxa | ||
// action.moveToElement(nayapage.getremita()).perform(); | ||
// Thread.sleep(1000); | ||
// action.moveToElement(nayapage.getgiftsa()).perform(); | ||
// Thread.sleep(1000); | ||
// action.moveToElement(nayapage.getrashifal()).perform(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.WebElement; | ||
|
||
public class Mousehoverkoarkopage { | ||
private WebDriver driver; | ||
private String remita="//a[@href=\"/remit\"]"; | ||
private String giftsa="//a[@href=\"/gifts\"]"; | ||
private String rashifal="//a[@href=\"/rashifal\"]"; | ||
private String frame="//*[@id=\"content\"]/iframe"; | ||
private String drag="//div[@id=\"draggable\"]"; | ||
private String drop="//div[@id=\"droppable\"]"; | ||
private String resize="//*[@id=\"resizable\"]/div[3]"; | ||
|
||
public Mousehoverkoarkopage(WebDriver driver){ | ||
this.driver=driver; | ||
} | ||
public WebElement getresize(){ return driver.findElement(By.xpath(resize));} | ||
// public WebElement getremita(){ return driver.findElement(By.xpath(remita));} | ||
// public WebElement getgiftsa(){ return driver.findElement(By.xpath(giftsa));} | ||
// public WebElement getrashifal(){ return driver.findElement(By.xpath(rashifal));} | ||
|
||
public WebElement getframe(){ return driver.findElement(By.xpath(frame));} | ||
// public WebElement getdrag(){ return driver.findElement(By.xpath(drag));} | ||
// public WebElement getdrop(){ return driver.findElement(By.xpath(drop));} | ||
|
||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import org.openqa.selenium.Keys; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.chrome.ChromeDriver; | ||
import org.openqa.selenium.interactions.Actions; | ||
import org.testng.annotations.BeforeTest; | ||
import org.testng.annotations.Test; | ||
|
||
public class Selecttexts { | ||
private WebDriver driver; | ||
private Selecttextskoarkopage nayapage; | ||
@BeforeTest | ||
public void first(){ | ||
System.setProperty("web-driver.chrome.driver","D:\\\\browserdriver\\\\chromedriver\\\\chromedriver.exe"); | ||
driver =new ChromeDriver(); | ||
nayapage=new Selecttextskoarkopage(driver); | ||
driver.get("https://extendsclass.com/text-compare.html"); | ||
driver.manage().window().maximize(); | ||
|
||
} | ||
@Test( priority=1) | ||
public void second() throws InterruptedException{ | ||
Thread.sleep(1000); | ||
Actions action=new Actions(driver); | ||
// this selects text the build() combines the keys and performs action | ||
action.keyDown(nayapage.gettextarea(), Keys.CONTROL).sendKeys("a").sendKeys("c").build().perform(); | ||
Thread.sleep(1000); | ||
action.keyDown(nayapage.gettextpaste(),Keys.CONTROL).sendKeys("a").sendKeys("v").build().perform(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.WebElement; | ||
|
||
public class Selecttextskoarkopage { | ||
private WebDriver driver; | ||
private String textarea="//*[@id=\"dropZone\"]/div[2]/div"; | ||
private String textpaste="//*[@id=\"dropZone2\"]/div[2]/div"; | ||
public Selecttextskoarkopage(WebDriver driver){ | ||
this.driver=driver; | ||
|
||
} | ||
public WebElement gettextarea(){ return driver.findElement(By.xpath(textarea));} | ||
public WebElement gettextpaste(){ return driver.findElement(By.xpath(textpaste));} | ||
|
||
} |
Oops, something went wrong.