2016年3月24日 星期四

RobotFramework Installation Guide for Oracle Linux 7.1


RobotFramework Installation Guide for Oracle Linux 7.1

Check Host File
vi /etc/hosts
10.179.86.8     eras-st-robot  eras-st-robot.eth0

Set Host Name
hostnamectl set-hostname eras-st-robot02

Change SSHD config
vi /etc/ssh/sshd_config
  • X11Forwarding yes
  • X11UseLocalhost no
service sshd restart

Check $DISPLAY after reboot
echo $DISPLAY
10.179.86.8:10.0

Install Xming
Install Xming X11 display server (https://sourceforge.net/projects/xming/) on your desktop PC and launch it

Enable X11 forward for PuTTY
Connection > SSH > X11 > Enable X11 forwarding

Add DNS Server
vi /etc/resolv.conf
options rotate attempts:2 timeout:2
search assets.thomsonreuters.com
nameserver 10.238.127.253
nameserver 10.238.127.254

Add Proxy Server
vi ~/.bash_profile
http_proxy=http://10.23.31.130:8080
export http_proxy
https_proxy=http://10.23.31.130:8080
export https_proxy

Setup Yum Proxy
vi /etc/yum.conf
proxy=http://10.23.31.130:8080

Remove SPT Repo and Install the YCK repository
rm /etc/yum.repos.d/SPT.repo
scp ricky.leung@10.32.29.215:/data/tools/oel7.1_yum.repos.d/ol7-u1-x64-1_0-patch-current-YCK.repo /etc/yum.repos.d/ol7-u1-x64-1_0-patch-current-YCK.repo

NTP Service
yum install ntp
vi /etc/ntp.conf
server 10.32.29.101 iburst
systemctl restart ntpd
ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*10.32.29.101    .PPS.            1 u    2   64    1    1.259   -0.179   0.000


Python, Paramiko and RobotFramework
yum install python-devel python-setuptools glibc*
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
sudo pip --proxy http://10.23.31.130:8080 install paramiko robotframework robotframework-ride robotframework-sshlibrary

Install xauth and xclock
yum install xauth xclock

Install EPEL Repo and wxPython, paramiko and sshpass
rpm -ivh epel-release-7-5.noarch.rpm
yum install wxPython python-paramiko sshpass

Generate public key to TG and InputHandler
ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub reutadmin@10.179.86.7
ssh-copy-id -i ~/.ssh/id_rsa.pub 10.179.86.8

Run the test

Copy SystemTests possibly from GIT to to ~ and then use ride.py to open SystemTests/SystemTestInputHandler/SystemTestInputHandler.txt

2016年3月17日 星期四

robot framework 使用五:CentOS上运行robot framework 并自动发送测试结果

http://blog.csdn.net/mask5726/article/details/27520041

操作系统版本:centos 6.0  x86_64
想要在linux上运行robot framework的测试用例,需要安装以下工具和软件:
1.安装python 2.7.6 ,首先python --version 查看系统是否装有python,并且python的版本是不是我们要用的
Python 2.6.5
说明已经装有python 2.6.5,下载python2.7.6,下载地址:https://www.python.org/download#pubkeys  选择:Python 2.7.6 compressed source tarball (for Linux, Unix or Mac OS X) 
使用root用户登录,下载后的文件通过rz命令将文件Python-2.7.6.tgz上传到root用户目录下
 执行以下命令安装:
tar zxvf Python-2.7.6.tgz
3cd Python-2.7.6
4./configure --prefix=/usr/local
5make && make altinstall
安装完后执行:python2.7 --version
出现这个:Python 2.7.6
证明安装完成,安装的目录为:/usr/local/lib/python2.7
为便于和系统中的python2.6.5区分,运行python的时候用python2.7代替。
2.安装 robotframework-2.8.4.tar.gz ,下载地址:https://pypi.python.org/pypi/robotframework


通过rz命令上传到root用户根目录下,执行 tar -zxvf robotframework-2.8.4.tar.gz
cd robotframework-2.8.4
python setup.py install
安装完成后,运行pybot --version
出现:Robot Framework 2.8.4 (Python 2.7.6 on linux2)
表明安装成功。

3.安装selenium2library和其他需要的库
执行
easy_install-2.7 robotframework-selenium2library
easy_install-2.7 selenium
easy_install-2.7 decorator
然后验证
python2.7
Type "help", "copyright", "credits" or "license" for more information.
>>> import Selenium2Library
>>>
出现最后那个空行表明安装成功!
先安装ez_setup.py,下载地址:https://pypi.python.org/pypi/setuptools/#unix-wget
执行 python2.7 ez_setup.py
4.把我们的脚本目录test传到linux上,执行 pybot ./cases.txt 或者python -m robot.run ./test,即可运行。
5.linux上运行脚本,需要有display,解决办法是安装vnc或者xvbf,vns安装:
 yum -y groupinstall “X Window System” “Desktop” “Fonts” “General Purpose Desktop”

rpm -ivh /mnt/Server/vnc-server-4.1.2-9.el5.x86_64.rpm
service vncserver start
vncserver :1
启动vncserver之后会提示输入初始密码,输入并确认后就可以在windows机器上下载http://www.realvnc.com/download/登陆到这个Linux机器上用鼠标操作
我的机器vncserver装完后不能正常工作,所以采用第二种方式,安装 xvbf
yum -y install xorg-x11-server-Xvfb
yum -y install mesa-dri-drivers
dbus-uuidgen –ensure
执行:Xvbf后就可以成功运行脚本了,需要主要脚本的命名最好用英文。
下一篇再介绍如何自动执行测试用例和自动发送结果邮件吧。

2023 Promox on Morefine N6000 16GB 512GB

2023 Promox on Morefine N6000 16GB 512GB Software Etcher 100MB (not but can be rufus-4.3.exe 1.4MB) Proxmox VE 7.4 ISO Installer (1st ISO re...