Callable interface appeared in java.util.concurrent package in Java 1.5. Like a Runnable interface, Callable has the same purpose – to create executable tasks. But it provides more possibilities:
Monday, July 22, 2013
Thursday, July 18, 2013
Drag and Drop element using selenium example
In this article we will see how to drag and drop element using selenium. As example let's take JQuery slider to drag it's handle.
I will use JQuery slider from http://ui-dev.jquery.com/demos/slider/ page.
I will use JQuery slider from http://ui-dev.jquery.com/demos/slider/ page.
Sunday, July 7, 2013
Concurrency in java. ExecutorService.
High-level API for concurrency support appeared in Java 5. It includes different tools that make easier life for developers who work with a multi-threaded environment.
In particular, java.util.concurrent package contains a number of classes that help quick organize a thread pool. The following class diagram illustrates their hierarchy:
In particular, java.util.concurrent package contains a number of classes that help quick organize a thread pool. The following class diagram illustrates their hierarchy:
Check broken links on a Page using Selenium
In order to find and check broken links on a Page using Selenium we can do next steps:
All these steps realized and described below:
1. Find all links using findElements() method.
2. Check each link response using java.net.HttpURLConnection class. (if page return 404 code - link is broken)
All these steps realized and described below:
Saturday, July 6, 2013
ScheduledThreadPoolExecutor in examples.
ScheduledThreadPoolExecutor extends capabilities of ThreadPoolExecutor (class diagram here) and makes it possible to schedule tasks execution.
ScheduledExecutorService interface gives new methods:
- two of them for scheduling action (Runnable or Callable) to execute just ones:
schedule (Callable<V> callable, long delay, TimeUnit unit): <V> ScheduledFuture<V>
schedule (Runnable command, long delay, TimeUnit unit): ScheduledFuture<?>
- and two others for periodic task execution:
scheduleAtFixedRate (Runnable command, long initialDelay, long period, TimeUnit unit): ScheduledFuture<?>
scheduleWithFixedDelay (Runnable command, long initialDelay, long delay, TimeUnit unit): ScheduledFuture<?>
Let’s see how they work.
Wednesday, July 3, 2013
How to add FireBug extension in FireFox profile.
No need to explain how convinient and useful to have FireBug extension in a browser if you work with tools like Selenium WebDriver. Firebug is a powerfull extension that allows us inspect elements and their properties, find element's Xpath.
Let’s see how to add firebug extension in FireFoxProfile for debugging selenium tests in runtime.
Let’s see how to add firebug extension in FireFoxProfile for debugging selenium tests in runtime.
Labels:
FirefoxDriver,
FireFoxProfile,
Java,
Selenium,
Selenium/WebDriver
Subscribe to:
Posts (Atom)