Monday, October 10, 2011

Flex and AIR testing with FlexMonkey

FlexMonkey - это инструмент для тестировния Flex и AIR  приложений, который распространяется по свободной лицензции,  и будет полезен как разработчикам, так и тестировщикам. Проект влючает в себя консоль (Air-based), позволяющую быстро создавать и запускать функуциональные тесты, с возможностью записывать, проигрывать и проверять состояние приложения в любой момент времени. FlexMonkey также позволяет генерировать тесты, созданные при помощи консоли, в виде скриптов FlexUnit/ActionScript, которые можно использовать для разработки автоматизированных тестов. Таким образом FlexMonkey  позволяет разработчикам выполнять юнит-тесты, имея возможность проверить логику приложения, и тестировщикам - функциональное тестирование, при помощи соответсвующих инструментов.

Wednesday, September 21, 2011

Selenium 2.0 (Webdriver) How To with Java + Eclipse



Так как Selenium сейчас очень активно развивается, перед началом работы, необходимо скачать последнию версию с официального сайта. Для работы с Selenium 2.0 (WebDriver) нет необходимости в его отельном запуске как это было ранее. Создавая новый проект, в Eclipse в свойствах проекта нужно добавить путь к jar-файлу.



Для проверки присутствия элементов на веб-странице в Selenium RC (1.0) есть метод selenium.isElementPresent(). Для WebDriver аналогично можно использовать метод findElement(), который генерирует исключение NoSuchElementException, если элемент отсутсвтует на странице:

public static boolean isElementPresent(WebDriver driver, By by) { 
  try { 
    driver.findElement(by); 
    return true;  // Success! 
  } catch (NoSuchElementException ignored) { 
    return false; 
  } 

}


//Example 1:
package org.openqa.selenium.example;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
public class Example  {
    public static void main(String[] args) {
        // Create a new instance of the html unit driver
        // Notice that the remainder of the code relies on the interface, 
        // not the implementation.
        WebDriver driver = new HtmlUnitDriver();

        // And now use this to visit Google
        driver.get("http://www.google.com");

        // Find the text input element by its name
        WebElement element = driver.findElement(By.name("q"));

        // Enter something to search for
        element.sendKeys("Cheese!");

        // Now submit the form. WebDriver will find the form for us from the element
        element.submit();

        // Check the title of the page
        System.out.println("Page title is: " + driver.getTitle());
    }
}


//Example 2:

package org.openqa.selenium.example;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class GoogleSuggest {
    public static void main(String[] args) throws Exception {
        // The Firefox driver supports javascript 
        WebDriver driver = new FirefoxDriver();
        
        // Go to the Google Suggest home page
        driver.get("http://www.google.com/webhp?complete=1&hl=en");
        
        // Enter the query string "Cheese"
        WebElement query = driver.findElement(By.name("q"));
        query.sendKeys("Cheese");

        // Sleep until the div we want is visible or 5 seconds is over
        long end = System.currentTimeMillis() + 5000;
        while (System.currentTimeMillis() < end) {
            WebElement resultsDiv = driver.findElement(By.className("gac_m"));

            // If results have been returned, the results are displayed in a drop down.
            if (resultsDiv.isDisplayed()) {
              break;
            }
        }

        // And now list the suggestions
        List<WebElement> allSuggestions = driver.findElements(By.xpath("//td[@class='gac_c']"));
        
        for (WebElement suggestion : allSuggestions) {
            System.out.println(suggestion.getText());
        }
     }
}

Source: http://code.google.com

Top Ten Programming Books


  1. Code Complete («Совершенный код»), второе издание. Steve McConnell 
  2. The Pragmatic Programmer: From Journeyman to Master («Программист-прагматик: от подмастерья к мастеру»), второе издание. Andrew Hunt, David Thomas (Эндрю Хант и Дэвид Томас)
  3. Structure and Interpretation of Computer Programs («Структура и интерпретация компьютерных программ»), второе издание. Harold Abelson, Gerald J Sussman, Julie Sussman (Гарольд Абельсон, Джеральд Суссман и Джули Суссман)
  4. The C Programming Language («Язык программирования Си»), второе издание. Brian W Kernighan и Dennis M Ritchie (Брайн Керниган и Деннис Ритчи)
  5. Introduction to Algorithms («Введение в алгоритмы»). Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest и Clifford Stein (Томас Кормэн, Чарльз Лейзерсон, Рональд Ривест и Клиффорд Штайн)
  6. Refactoring: Improving the Design of Existing Code («Рефакторинг: улучшение существующего кода»). Martin Fowler, Kent Beck, John Brant и William Opdyke (Мартин Фаулер, Кент Бек, Джон Брант и Вильям Опдайк)
  7. Design Patterns: Elements of Reusable Object-Oriented Software («Шаблоны проектирования: Элементы повторно используемого объектно-ориентированного программного обеспечения»). Erich Gamma, Richard Helm, Ralph Johnson и John Vlissides (Эрих Гамма, Ричард Хелм, Ральф Джонсон и Джон Влиссидес (также известные как " Банда четырех ")
  8. The Mythical Man-Month: Essays on Software Engineering («Мифический человеко-месяц, или Как создаются программные системы»). Frederick P. Brooks (Фредерик П. Брукс)
  9. Art of Computer Programming, Volume 1: Fundamental Algorithms («Искусство программирования, том 1: основные алгоритмы»), третье издание. Donald E. Knuth (Дональд Кнут)
  10. Compilers: Principles, Techniques, and Tools («Компиляторы: принципы, технологии и инструменты»), 2-е издание. Alfred V. Aho, Monica S. Lam, Ravi Sethi и Jeffrey D. Ullman (Альфред В. Ахо , Моника С. Лам , Рави Сети и Джеффри Д. Ульман)

Wednesday, August 3, 2011

Photo editing tools

Hugin - panorama photo stitcher
Gimp - raster image editor
RawTherapee - RAW photo editor
Picasa - image organizer, viewer and editor
PTGui - panorama photo stitcher

Tuesday, August 2, 2011

iperf usage

http://openmaniak.com/iperf.php
http://unixfoo.blogspot.cz/2009/02/iperf-network-throughput-measurement.html
http://iperf.sourceforge.net/

Sunday, July 31, 2011

SVN [git svn] basic commands

git svn clone <source address> - initial copy to work directory
git svn fetch && git svn rebase - further updates
git checkout -f - restore everything
git diff - check changes


Saturday, July 30, 2011

Basic commands

Commands to work with files and directories:
ls – print list of files and directories
ls -la – print list of files and directories (with hidden)
cd – change current directory
pwd – print current directory
mkdir dir – make a directory named "dir"
rm file –remove file
rm -r dir – remove directory dir
rm -f file – force remove file
rm -rf dir – удалить форсированно каталог dir
cp file1 file2 – copy
cp -r dir1 dir2 – copy dir1 into dir2; if there is no dir2, it will be created
mv file1 file2 – raname or move file1 to file2.
ln -s file link – create a simlink
touch file – create file
cat > file – output to file
less file – printout file
head file – print first 10 lines of file
tail file – print last 10 lines of file
tail -f file – print content of file 

ps – print current active processes
ps aux - print all procesess
ps aux | grep -v grep | grep -i %name - find process %name (you can use part of name)
top – show all running processes
kill pid – kill process by id pid
killall proc – kill all processes named proc
bg – list of stopped tasks and task in background;
fg
fg n
Permission:  
chmod octal file – change permission file to octal,separately for user, group and for all by adding:
4 – read (r)
2 – write (w)
1 – execute (x)
SSH
ssh user@host connect to host as user
ssh -p port user@host connect to host as user by port
ssh-copy-id user@host add your key to host for user to turn on login without password
ethtool - is a command that allows to display or modify a NIC's parameters

scp - is a command to copy files and directories securely between remote hosts (example: scp filename username@hostname:/home/)
uuidgen - command line utility to generate a new UUID value
passwd
- change user password


grep -r 'word_to_find' [path] - find recursively (example: grep -r 'dhcp' /etc*/*)   

Useful tools

wireshark - is a network protocol analyzer for Unix and Windows
tshark is a console version of wireshark
iperf - traffic generator is a commonly used network testing tool that can create  tcp and udp data streams and measure the throughput of a network that is carrying them
packEth -  is a Linux GUI packet generator tool for ethernet. It allows you to create and send any possible packet or sequence of packets on the ethernet
tcpdump - dump traffic on a network
tcpreplay - gives you the ability to use previously captured traffic in Libcap format to test a variety of network devices. It allows you to classify traffic as client or server, rewrite Layer 2, 3 and 4 headers and finally replay the traffic back onto the network and through other devices such as switches, routers, firewalls, NIDS and IPS's. Tcpreplay supports both single and dual NIC modes for testing both sniffing and inline devices.
vlc -  is a free and open source cross-platform multimedia player and framework that plays most multimedia files as well as DVD, Audio CD, VCD, and various streaming protocols
mplayer - is a  movie player for Linux. Supports reading from network, dvd, vcd, file, pipes, and v4l.
Packet builder -  enables creating custom network packets; users can use this tool to check their network protection against attacks and intruders.Colasoft Packet Builder includes a very powerful editing feature. Besides common HEX editing raw data, it features a Decoding Editor allowing users to edit specific protocol field values much easier
PuTTY - SSH and telnet client
nmap - is a free and open source utility for network exploration or security auditing.
xchm - .chm viewer