星期三, 1月 08, 2020

[Eggplant] shell cmd 執行window batch

簡單的呼叫bat檔的測試案例,並可將bat的執行結果輸出在txt檔上

(*
http://docs.testplant.com/ePF/SenseTalk/stk-system-interaction.htm#shell
*)

//set the shellCommand to "ShellExecute"

//run bat 
shell "c:\windows\system32\cmd.exe", <
> ">C:\Users\bigd\Downloads\ShellOutpoutFile.txt"

//read bat result from output file
put file "C:\Users\bigd\Downloads\ShellOutpoutFile.txt" into ShellLog

//print outputfile info
log "Shell content from TxtFile"

log ShellLog

http://docs.testplant.com/ePF/SenseTalk/stk-system-interaction.htm

[Eggplant] 【進階範例】SUT斷線重新連結

星期二, 1月 07, 2020

[Eggplant] Android Gateway | android rotate指令


--force-rotForces SN2 to rotate the image. Prior to Android 6.0, the image that came from Android OS to SN2 was not rotated, and SN2 had to rotate it, so it would appeared readable in Eggplant Functional. In Android 6.0 and later, SN2 receives an already rotated image. This option forces SN2 to rotate images even on Android 6.0 and later. This option is implemented in case some devices do not have this updated behavior.
--screen-rot 0
--screen-rot 1
--screen-rot 2
--screen-rot 3
Turns the screen by 0, 90, 180, or 270 degrees, respectively.

http://docs.testplant.com/ePF/using/epf-android-gateway-options.htm

[Eggplant] 跨平台裝置測試如何提升圖片搜尋率

跨平台裝置常會測試案例的圖相(例如按鈕大小)遇到不同解析度會有放大的問題?
可以透過以下方法,就不需要依據每個SUT受測裝置擷過過多圖片。


1. Search Type設成Adaptive To Image

2.  設定Scale Factor去比對不同解析度的圖像=>可先透過測試指定比例

 2.1  可在EPF settings裡面設定參數

 2.2 程式控制
//愈細則會增加搜尋時間
set the scaleFactors to 0.5 to 1 step 0.01

更多scaleFactors設定可參考以下連結
http://docs.testplant.com/ePF/SenseTalk/stk-eggplant-functional-global-properties.htm


3. 調Image設定的Tolerance

備註:如何打開hidden的圖像識別
Show all search types

[Eggplant] 客戶問題:Windows手動安裝selenium伺服器與Java環境

先前在客戶端安裝eggplant官方的window selenium安裝包
發現在執行webdrive指令會發生異常的錯誤,
發現手動重新安裝就可以解決這個問題。



Java環境設定

下載JRE
https://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

安裝完後會在此目錄下看到執行的java.exe
C:\Program Files\Java\jre1.8.0_231\bin

接著設定環境變數,才有辦法直接在cmdline的路徑下都打java指令

星期一, 1月 06, 2020

[Eggplant] 客戶問題: Number of Errors logged: 183

有趣的客戶案例:
將多個測試腳本拆開後,再分開使用run指令呼叫各部份的測試腳本,
因在單自的腳本裡有寫LogError來印LOG,
就會造成此錯誤訊息Number of Errors logged
造成最外層想要做一個long run的廻圈無法正確執行。
解決方法將LogError改成LogWarning即可,
因使用LogError如發生錯誤不會在中間的腳本停掉程序的



補充:

Run:可以用在順序的腳本執行,簡單來說就是每一個腳本中間是有相關聯的,
因此異常就會中斷整個測試集

RunWithNewResult: 就不會因其中一個錯誤腳本而中斷。


其他你感興趣的文章

Related Posts with Thumbnails