所以架了一台Jenkins,然後將之前寫過的sikuli 來測試一下
發現了一些錯誤,由於是透過Jenkin 去呼叫sikuli
導致sikuli在執行時的初始化畫面邊界大小錯誤 如下所示
[error] Location: outside any screen (23707968, 23707968) - subsequent actions might not work as expected
[error] Location: outside any screen (23707968, 23707968) - subsequent actions might not work as expected
後來上網查詢一下,也是有人使用類似的搭配,但是似乎只能在Jenkin slave 下執行sikuli
因此找來台測試機當salve 只是slave 的設定沒那麼簡單
PS. Slave的測試機不需要另外安裝Jenkins,只需要從master 下載 slave.jar
步驟如下
On Jenkins master
1.Go to Manage Jenkins - >Configure Global Security.
Enable TCP port for JNLP agents as Random.
PS. This step is configured for "Launch agent via Java Web Start"
2.Manage Jenkins > Manage Nodes.
3.Select New Node and enter node name. Select Permanent Agent -> Press OK.
4.On this page, fill in the following fields:
Set a number of executors (one or more) as needed. Default is 1.
Set a Remote directory for the master on the slave machine. i.e Linux Slave: “/opt/jenkins/” or Windows Slave: “C:\jenkins”.
Set Usage to “Use this node as much as possible”. Choose Launch method as “Launch agent via Java Web Start”.
Set Availability,Keep this slave online as much as possible.
Press Save.
5.Go to Manage Jenkins>Manage Nodes, click on the newly created slave machine.
會出現如下圖的選擇方式

6.On Salve machine Download the slave.jar from master ( Click the web link)
Open CMD and execute commands as below:
java -jar slave.jar -jnlpUrl http://192.168.32.101:8080/computer/QA_T440/slave-agent.jnlp -secret 4bc0834e61fc5a2ab4598852b008ed791a56173b4f1f51feefdb249e3ce39423

7.done!