Android自動化測試android-uiconductor之一:環境搭建


1、安裝依賴

  1. Jdk 8+
  2. Android SDK 28
  3. adb installed and setup correctly in the env
  4. a local/remote MySql Database
  5. Angular CLI: 1.7.4 (Currently the higher verison of Angular CLI might not work. we are working ont the migration)
  6. Node: 10.15.0

2、啟動mysql

mysql.server start
2.1、登錄數據庫:
mysql -u root -p
    密碼:xxx

3、創建數據庫

CREATE DATABASE IF NOT EXISTS `uicddb` DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
grant ALL PRIVILEGES on uicddb.* to root@'%' identified by '123456';
flush privileges;

3、導入數據庫文件

source "/Users/myuser/Desktop/bak/android-uiconductor/backend/src/com/google/uicd/backend/recorder/db/initdb.sql";

4、修改配置文件

在根目錄的release目錄下有個release/uicd.cfg文件:
修改數據庫連接字符串:
mysqlconnectionstr=jdbc:mysql://localhost:3306/uicddb?autoReconnect=true&user=root&password=admin&useUnicode=true&characterEncoding=utf-8

5、在release下面運行start.sh就可以啟動

/start.sh

過程中的問題解決:

1、osascript: mac_chrome.scpt: No such file or directory

解決:
打開…./bak/android-uiconductor/release/start.sh文件,里面有這一段代碼,其中osascript mac_chrome.scpt是未實現的,需要實現:

實現方法:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security --chrome-frame --user-data-dir="$PWD" --app="file://$PWD/dist/index.html"

2、初始打開瀏覽器特別慢:

原因是因為加載的一個jquery.min.js文件是從google拉取的,因為要FQ,所以特別慢,需要改一下,使用國內的,或者下載下來放在文件目錄中;
https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM