文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>xdotool X调试工具

xdotool X调试工具

时间:2009-07-22  来源:fewlife

by tangke <[email protected]> 2009-06-30

前几天在和共创的工程师一起调试italc软件的时候,发现一个叫xdotool的工具,比较好用,解决我们手工进行暴力测试的麻烦,在debian下面的话,直接apt-get install xdotool就可以了,该工具对键盘/鼠标都能模拟出来,对每一个窗口都能激活,功能真的是很强大(虽然是小工具哦)

下面是官方的一个例子,大家可以看一下

# Activate firefox and paste the clipboard contents into the url bar.

wid=`xdotool search --title "Mozilla Firefox"`
xdotool windowactivate $wid
sleep 0.2
xdotool key "ctrl+j"
xdotool key "BackSpace"
xdotool key "ctrl+v"
xdotool key "Return"

比如一个简单的模拟鼠标操作
xdotool mousemove x y
xdotool click 1

上面的操作表示将鼠标移动到x,y,然后按下左键

Example: focus the firefox url bar
Code:

WID=`xdotool search "Mozilla Firefox" | head -1`
xdotool windowfocus $WID
xdotool key ctrl+l
Example: Resize all visible gnome-terminal windows
Code:

WIDS=`xdotool search --onlyvisible --name "gnome-terminal"`
for id in $WIDS; do
  xdotool windowsize $id 500 500
done
参考网站:
http://www.semicomplete.com/projects/xdotool/

相关阅读 更多 +
排行榜 更多 +
豆荚扫描

豆荚扫描

游戏工具 下载
音跃球球

音跃球球

音乐节奏 下载
小白追书绿色封面

小白追书绿色封面

浏览阅读 下载