Tag Archives: with jquery

How to work with jQuery Resizable and Draggable using selenium webdriver? – Example

Example:

How to work with jQuery Resizable and Draggable using selenium webdriver?

coordinates

coordinates

 

How to work with jQuery Resizable and Draggable using selenium webdriver?

How to work with jQuery Resizable and Draggable using selenium webdriver?

 

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.Point;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
public class test_jquery_resize_drag {

private static WebDriver myTestDriver;
 public static void main(String[] args) throws InterruptedException {
 myTestDriver = new FirefoxDriver();
 myTestDriver.manage().window().maximize();
 myTestDriver.manage().timeouts().implicitlyWait(1L,TimeUnit.SECONDS);
 myTestDriver.get("http://tinyurl.com/burdnrx");


 Point MyPoint= myTestDriver.findElement(By.xpath("//*[@id='container']/div[2]/div[3]")).getLocation();
 System.out.println(MyPoint.x+"--------"+MyPoint.y);

 WebElement draggable = myTestDriver.findElement(By.xpath("//*[@id='container']/div[2]"));

 new Actions(myTestDriver)
 .dragAndDropBy(draggable,-10, 0)
 .build()
 .perform();
 Thread.sleep(5000L);


 draggable = myTestDriver.findElement(By.xpath("//*[@id='container']/div[2]"));
 new Actions(myTestDriver)
 .dragAndDropBy(draggable, -200 , 0 )
 .build()
 .perform();
 Thread.sleep(5000L);

 draggable = myTestDriver.findElement(By.xpath("//*[@id='container']/div[2]/div[3]"));
 for(int i=100;i<=110;i++){
 new Actions(myTestDriver)
 .dragAndDropBy(draggable, i, 0)
 .build()
 .perform();
 Thread.sleep(1000L);
 }


 draggable = myTestDriver.findElement(By.xpath("//*[@id='container']/div[2]/div[3]"));
 for(int i=110;i>=100;i--){
 new Actions(myTestDriver)
 .dragAndDropBy(draggable, -i, 0)
 .build()
 .perform();
 Thread.sleep(1000L);
 }

 draggable = myTestDriver.findElement(By.xpath("//*[@id='container']/div[2]"));

 new Actions(myTestDriver)
 .dragAndDropBy(draggable, MyPoint.x,MyPoint.y)
 .build()
 .perform();
 Thread.sleep(5000L);
 myTestDriver.quit();







 }

}

 

Get this code from PasteBIN

Advertisements

How to work with jQuery draggable using selenium webdriver? – one more Example

Example :

How to work with jQuery draggable using selenium webdriver?

 

coordinates

coordinates

How to work with jQuery draggable using selenium webdriver?

How to work with jQuery draggable using selenium webdriver?

 

import org.openqa.selenium.By;
import org.openqa.selenium.Point;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
public class testdragjquery {

private static WebDriver myTestDriver;
 public static void main(String[] args) throws InterruptedException {
 myTestDriver = new FirefoxDriver();
 myTestDriver.get(&quot;http://tinyurl.com/2rxmut&quot;);


 Point MyPoint= myTestDriver.findElement(By.id(&quot;insideParent&quot;)).getLocation();
 System.out.println(MyPoint.x+&quot;--------&quot;+MyPoint.y);

WebElement draggable = myTestDriver.findElement(By.id(&quot;insideParent&quot;));
 new Actions(myTestDriver)
 .dragAndDropBy(draggable, MyPoint.x + 10, MyPoint.y +20)
 .build()
 .perform();
 Thread.sleep(5000L);
 new Actions(myTestDriver)
 .dragAndDropBy(draggable, MyPoint.x + 20, MyPoint.y +20)
 .build()
 .perform();

 Thread.sleep(5000L);
 new Actions(myTestDriver)
 .dragAndDropBy(draggable, MyPoint.x + 30, MyPoint.y +20)
 .build()
 .perform();
 Thread.sleep(5000L);
 new Actions(myTestDriver)
 .dragAndDropBy(draggable, MyPoint.x + 40, MyPoint.y +20)
 .build()
 .perform();
 Thread.sleep(5000L);
 new Actions(myTestDriver)
 .dragAndDropBy(draggable, MyPoint.x + 50, MyPoint.y +20)
 .build()
 .perform();

myTestDriver.quit();
 }

}

 

Take this code from PasteBIN

jQuery with selenium webdriver – Example of Drag and drop with jQuery UI

Example :

jQuery with selenium webdriver – Example of Drag and drop with jQuery UI

Drag and drop with jQuery UI

Drag and drop with jQuery UI

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 testjquerydraganddrop {
 private static WebDriver myTestDriver;

 public static void main(String[] args) {


 myTestDriver = new FirefoxDriver();

 myTestDriver.manage().window().maximize();
 myTestDriver.manage().timeouts().implicitlyWait(1L,TimeUnit.SECONDS);
 myTestDriver.get("http://dev.css-zibaldone.com/onwebdev/post/jquery-drag-and-drop.html");

 WebElement draggable = myTestDriver.findElement(By.id("draggable"));

 WebElement droppable = myTestDriver.findElement(By.id("droppable"));

 new Actions(myTestDriver).dragAndDrop(draggable, droppable).build().perform();
 }

}


Drag and drop with jQuery UI

How to handle jQuery autocomplete using Selenium Webdriver?

Problem? 😦

How to Pressing Enter Button, ARROW_DOWN, ARROW_UP of Keyboard using Selenium Webdriver?

Solution 🙂

Take sample code from PasteBIN

Enum Keys

Enum Keys

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class KeysTest {

 public static void main(String[] args) {
 WebDriver myTestDriver = new FirefoxDriver();
 myTestDriver.get(&amp;quot;http://tinyurl.com/yhu7olp&amp;quot;);
 myTestDriver.manage().window().maximize();
 myTestDriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
 myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(&amp;quot;a&amp;quot;);
 myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_DOWN);
 myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_DOWN);
 myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_DOWN);
 myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_DOWN);

myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_DOWN);

myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_DOWN);

myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_DOWN);
 myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_UP);
 myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_UP);

 myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ENTER);

myTestDriver.quit();

 }

}

How to work with Keyboard Keypress event using selenium webdriver?

Problem? 😦

How to Pressing Enter Button, ARROW_DOWN, ARROW_UP of Keyboard using Selenium Webdriver?

Solution 🙂

Take sample code from PasteBIN

Enum Keys

Enum Keys

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class KeysTest {

 public static void main(String[] args) {
 WebDriver myTestDriver = new FirefoxDriver();
 myTestDriver.get(&quot;http://tinyurl.com/yhu7olp&quot;);
 myTestDriver.manage().window().maximize();
 myTestDriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
 myTestDriver.findElement(By.xpath(&quot;//input[@class='ui-autocomplete-input']&quot;)).sendKeys(&quot;a&quot;);
 myTestDriver.findElement(By.xpath(&quot;//input[@class='ui-autocomplete-input']&quot;)).sendKeys(Keys.ARROW_DOWN);
 myTestDriver.findElement(By.xpath(&quot;//input[@class='ui-autocomplete-input']&quot;)).sendKeys(Keys.ARROW_DOWN);
 myTestDriver.findElement(By.xpath(&quot;//input[@class='ui-autocomplete-input']&quot;)).sendKeys(Keys.ARROW_DOWN);
 myTestDriver.findElement(By.xpath(&quot;//input[@class='ui-autocomplete-input']&quot;)).sendKeys(Keys.ARROW_DOWN);

myTestDriver.findElement(By.xpath(&quot;//input[@class='ui-autocomplete-input']&quot;)).sendKeys(Keys.ARROW_DOWN);

myTestDriver.findElement(By.xpath(&quot;//input[@class='ui-autocomplete-input']&quot;)).sendKeys(Keys.ARROW_DOWN);

myTestDriver.findElement(By.xpath(&quot;//input[@class='ui-autocomplete-input']&quot;)).sendKeys(Keys.ARROW_DOWN);
 myTestDriver.findElement(By.xpath(&quot;//input[@class='ui-autocomplete-input']&quot;)).sendKeys(Keys.ARROW_UP);
 myTestDriver.findElement(By.xpath(&quot;//input[@class='ui-autocomplete-input']&quot;)).sendKeys(Keys.ARROW_UP);

 myTestDriver.findElement(By.xpath(&quot;//input[@class='ui-autocomplete-input']&quot;)).sendKeys(Keys.ENTER);

myTestDriver.quit();

 }

}

How to work with Keyboard Keypress event using selenium webdriver?

Problem? 😦

How to Pressing Enter Button, ARROW_DOWN, ARROW_UP of Keyboard using Selenium Webdriver?

Solution 🙂

Take sample code from PasteBIN

 

Enum Keys

Enum Keys

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class KeysTest {

 public static void main(String[] args) {
 WebDriver myTestDriver = new FirefoxDriver();
 myTestDriver.get(&amp;quot;http://tinyurl.com/yhu7olp&amp;quot;);
 myTestDriver.manage().window().maximize();
 myTestDriver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
 myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(&amp;quot;a&amp;quot;);
 myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_DOWN);
 myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_DOWN);
 myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_DOWN);
 myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_DOWN);

myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_DOWN);

myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_DOWN);

myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_DOWN);
 myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_UP);
 myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ARROW_UP);

 myTestDriver.findElement(By.xpath(&amp;quot;//input[@class='ui-autocomplete-input']&amp;quot;)).sendKeys(Keys.ENTER);

myTestDriver.quit();

 }

}
Pupunzi

For a better web

Tech

News and reviews from the world of gadgets, gear, apps and the web

VentureBeat

News About Tech, Money and Innovation

Digital Inspiration

Tips and tutorials around all things tech.

Thinkwareglobal's Blog

Just another WordPress.com weblog

Kenazari's Blog

Just another WordPress.com weblog

Richfowler1's Blog

Just another WordPress.com weblog

Romaicus's Blog

Just another WordPress.com weblog

botlaguduri

Just another WordPress.com site

chandanag89

Just another WordPress.com site

meghshetty

Just another WordPress.com site

digitalmediaexpert

digital media expert blog

Thinking in Silverlight

Silverlight/WPF/Windows 8 Store App

Different Journeys

Let's make life easier!

LAW RESOURCE INDIA

LEGAL RESOURCE CENTRE / COURT JUDGMENTS / LEGAL ARCHIVES

BookConnect

Promoting Indian language Books

Actively Lazy

Software, crafted with passion

SAPonPower

An ongoing discussion about SAP infrastructure

SAP Career

Your Career Mentor

hrsapcertification

Just another WordPress.com site

The secret product manager

Thoughts about product management, SUSE, Linux, ARM processors, Cloud, AIX, Power Systems, and other things that interest me

Sap Certification Material . Com

Quality store for sap software and courses

Simon Les Flex's Blog

SAP Process Integration Specialist - NOW WE CAN DO BETTER!

Oracle Technologies Primer

An Oracle Fusion Middleware and iPaaS blog!

Gilberto Holms

Java, Middleware, SOA Architecture Blog

The Skeleton

Java code skeletons, tips and pointers

J@n van Zoggel

integration, innovation & random technology stuff

The Pragmatic Integrator

Hints and tips from a pragmatic integration specialist

briskwalk

The pace of life..

Optimalbg's Blog

Just another WordPress.com site

IT Jobs in USA

Keep the track of this Blog if you are looking out for some good Opportunities to work in USA....

Referral Jobs | Right Place to Get a Job

Hurry you are one Click away to get a job - Fresher Jobs for 2012, 2013 fresher’s and also high paid jobs for well Experienced IT professionals on Referal jobs.

eccinternational.wordpress.com/

ISO Consulting | ISO 27001 | ISO 20000 | CMMI | BCM | GRI Sustainability Reporting & Assurance | eLearning | Trainings | Philippines

Michael Korn's Blog

Musings on Life, Career, Faith and Technology

WORKINGWITHQTP

Just another WordPress.com weblog

Topics

.Net Core, AspNetCore, Entity Framework, Entity Framework Core, AspNetIdentity, AspNetIdentityCore, Unit Test, WCF, Workflows

SQA and Testers Blog

Just another WordPress.com weblog

Expertqtp's Weblog

Just another WordPress.com weblog

Sai Chamarthi

Experienced Testing Professional

saxenavinay

A great WordPress.com site

Suresh4qtp's Blog

Just another WordPress.com site

jonah95hill

This WordPress.com site is the cat’s pajamas

It's always something...

Just another WordPress.com weblog

Faculty of Information Technology - Lê Ngọc Tiến

Be Yourself! Simplify Our Goals! Nothing is Impossible!

Anti-Malware Testing

Thoughts on security product testing past and present

Methods & Tools

Practical knowledge for the software developer, tester and project manager