Belajar Selenium Python-Java Eclipse di Ubuntu

Selenium itu bisa untuk AutoFill Form Web

Caranya:

1. Copy dan rename: selenium.sh

#!/bin/bash# Following the guide found at this page # http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html

echo "\r\nUpdating system ...\r\n" 
sudo apt-get update

# Create folder to place selenium in 
# echo "\r\nCreating folder to place selenium in ...\r\n" 
sudo mkdir ~/selenium cd ~/selenium

# Get Selenium and install headless Java runtime # 
echo "\r\nInstalling Selenium and headless Java runtime ...\r\n" 
sudo wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar 
sudo apt-get install openjdk-7-jre-headless -y 

# Install Firefox # 
echo "\r\nInstalling Firefox ...\r\n" sudo apt-get install firefox -y 

# Install headless GUI for firefox. 'Xvfb is a display server that performs graphical operations in memory' # 
echo "\r\nInstalling XVFB (headless GUI for Firefox) ...\r\n" 
sudo apt-get install xvfb -y 

# Finally, starting up Selenium server #
echo "\r\nStarting up Selenium server ...\r\n"DISPLAY=:1 xvfb-run java -jar ~/selenium/selenium-server-standalone-2.53.1.jar

source: https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c

2. di terminal ketikkan:

chmod +x selenium.sh

./selenium.sh

3. lihat prosessnya sampai keluar Selenium server running

4. untuk start stop server selenium

java -jar ~/selenium/selenium-server-standalone-3.0.1.jar
http://localhost:4444/selenium-server/driver?cmd=getLogMessages
http://localhost:4444/wd/hub/status
http://localhost:4444/selenium-server/driver?cmd=shutDownSeleniumServer

5. untuk testing di chrome, utk firefox belum tahu caranya

sudo apt-get install chromium-chromedriver

ketik di editor dan beri nama misal python_test.py

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome("/usr/lib/chromium-browser/chromedriver")

#driver = webdriver.Firefox()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()

silahkan tes di terminal

python python_test.py

6. Hasil pengujian:

selenium-server-standalone-2.53.1.jar SUPPORT => downgrade ke mozilla 45.0.2

link download mozilla deb: https://sourceforge.net/projects/ubuntuzilla/files/mozilla/apt/pool/main/f/firefox-mozilla-build/

selenium-server-standalone-3.0.1.jar TIDAK SUPPORT MINT 17

 

source:

http://selenium-python.readthedocs.io
Configure Eclipse with Selenium WebDriver
Advertisements

MySQL said: Documentation #2002 – No such file or directory The server is not respon

Ketika membuka http://localhost/phymyadmin, tampil :

Error

MySQL said: Documentation
#2002 - No such file or directory
The server is not responding (or the local server's socket is not correctly configured).
Connection for controluser as defined in your configuration failed.

screenshotnya :

bbc5f715bc4f7ef4df78769b92b0eeb256f7536490

solusi saya:

sudo service mysql start

sudo service mysql stop

sudo /opt/lampp/lampp restart

sumber gambar dan prolog artikel:

http://forums.devshed.com/php-development-5/mysql-documentation-2002-file-directory-server-respon-959987.html