顯示具有 eggplant 標籤的文章。 顯示所有文章
顯示具有 eggplant 標籤的文章。 顯示所有文章

星期二, 2月 21, 2023

[Eggplant] iOS Gateway 授權問題

 

久久連一下eggplant iOS gateway異常的話,
建議重走一下apple deveplop的相關的授權流程機制就會正常了。

在診斷通常會有二個警告會沒有綠色,
主要注意新的測試主機上有相關的對應的授權檔案即可
(因為也不知道怎麼清除ios gateway上舊的資料 xd)



星期六, 8月 07, 2021

[Eggplant] SenseTalk JSON資料操作

JSON已經是普遍的資料交換標準,可以簡單跟不同程式間作為溝通的橋樑。

SenseTalk提供JSONFormat/JSONValue二個方法來讓用戶使用

JSONValue

將json string轉換到json object於sensetalk使用

PS:要注意json字串要有雙引號,否則會解析錯誤

MockDataFromExcel "PM","ETS_PM_0008"

put the result into mockTicket

log mockTicket

put JSONValue(mockTicket) into ticketInfoWithJSON

log ticketInfoWithJSON's reserveNo



2021/8/8, 2:36:12 PM Log {"carType":"標準車廂", "count":"1", "date":"2021/07/30", "depature":"14:46", "end":"台中", "full":1, "fullSubTotal":"700", "no":"651", "reserveNo":"06264014", "seat":"window", "start":"台北", "subTotal":"TWD 700", "trainTimeType":">60", "type":"單程"}

2021/8/8, 2:36:12 PM Log 06264014


JSONFormat

put JSONFormat(ticketInfoWithJSON) into ticketInfoWithJSONString

log ticketInfoWithJSONString

當然也可以在把json object轉回string回存,中文也可以正常編碼

2021/8/8, 2:36:17 PM Log {

  "carType": "\u6a19\u6e96\u8eca\u5ec2",

  "count": "1",

  "date": "2021/07/30",

  "depature": "14:46",

  "end": "\u53f0\u4e2d",

  "full": 1,

  "fullSubTotal": "700",

  "no": "651",

  "reserveNo": "06264014",

  "seat": "window",

  "start": "\u53f0\u5317",

  "subTotal": "TWD 700",

  "trainTimeType": ">60",

  "type": "\u55ae\u7a0b"

}

星期六, 7月 17, 2021

[Eggplant] Functional | 基本指令記錄-常處理商業邏輯會用到的

 記錄每次錄製都會再查一下的指令集

List 操作

取list某個值
put ["cheddar","provolone","brie","muenster","mozzarella"] into CheeseList
put item 1 of CheeseList // displays "cheddar"

如果要插入值進list

insert testScript after failTestScripts

星期四, 7月 08, 2021

[Eggplant] Functional 關閉預設的執行錯誤alert視窗

如果想要在執行eggplant functional錯誤提示訊息框,避免中斷測試,可以至偏好關閉(Prefermance )

Alert user when script execution fails: Selected by default. Select this checkbox to see an alert dialog box when a script fails. (This option does not apply to scripts that are run as part of a schedule.)



REF:
http://docs.eggplantsoftware.com/ePF/using/epf-general-preferences.htm



星期三, 6月 24, 2020

[eggplant] 客戶問題: 無法透過RDP連線處理


方法一

To enable RDP connection debug logs:
1.    Create an environment variable in Windows on the EPF machine - WLOG_LEVEL and give it a value DEBUG.
2.    Create a script in EPF that connects to a SUT using its name in the Connection List:
Connect “WIN-DS-EGGPLANT-SC”
Log ConnectionInfo()
Log “Waiting for 30 seconds…”
Wait 30
Disconnect
3.    Run the script in cmd using runscript:
 runscript.bat --commandlineoutput yes C:\CodeRepository\Suite-1.suite\Scripts\ConnectSmartCardTest.script

4.    Copy the cmd output to a text file.


方法二

The RDP DLLs that come with the newer versions of Eggplant Functional are different from the ones that come with version 18. There are some security restrictions on the SUT machines that do not allow the connection from EPF.
To try to overcome this, please try the following:

Try entering the hostname of the SUT instead of its IP address and see if it makes a difference. If not, try the following:
1. Quit Eggplant Functional.
2. Open a cmd prompt and go to the EPF installation directory.
3. Enter the following command:
defaults write Eggplant -rdpNlaSecurity NO
4. Open EPF again and try to connect.
5. If that doesn't help, quit EPF again and try the following command:
defaults write Eggplant rdpRdpSecurity NO

星期一, 5月 18, 2020

[eggplant] IE webdrive無法連線

IE webdrive第一次連線失敗發生以下訊息

Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. (WARNING: The server did not provide any stacktrace information).

修正安全性設定即可修正問題


將每一個選項內的啟用受保護程式的checkbox打勾
IE網際網路選項



接著再重新連接一次裝置即可正常

星期四, 4月 23, 2020

[Eggplant] 透過命令行的runscript指令來執行suite的測試

在透過EPF撰寫完相關的suite後,在不同主機上執行suite,就不用再開EPF了。
只要透過runscript指令即可呼叫。

首先先安裝runscript指令(這樣就免除需要執行完整的路徑)


Important: For Mac installations of Eggplant Functional version 18.0 and later, the path to call the runscript command has changed to /Applications/Eggplant.app/Contents/MacOS/runscript

Eggplat->Perference->Run,接著按install runscript in /usr/local/bin即可


[Eggplant] 使用shell指令執行Java Jar

測試如何shell執行java包出的jar檔應用,並把執行結果取出。

測試一般jar檔執行

MacBook-Pro-8:eggplant_cmd bigd$ java -cp JarDemo.jar com.test.jardemo.TestJar "Hello World" "Ken"

輸入參數0:Hello World

輸入參數1:Ken


//存放shell輸出的東西
set destinationFile to "/Users/bigd/Downloads/shellOutput.txt"

//Users/bigd/Downloads/eggplant_cmd
shell "java -cp /Users/bigd/Downloads/eggplant_cmd/JarDemo.jar com.test.jardemo.TestJar 'Hello World' 'Ken' >"  & destinationFile

put file destinationFile into shellOutput
//LogSuccess file destinationFile
log shellOutput

//砍掉檔案
delete file destinationFile



參考

星期三, 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

星期一, 11月 11, 2019

[Eggplant] 【進階語法】ScreenPart提昇你的OCR的辨識速度

等你熟悉了eggplant的圖片/OCR識別的使用後,
如果想要再提昇速度,可以在每次搜尋目標時,
定義搜尋的區塊(searchRectangle )
可以加速整個Script的執行

定義ScreenPart函數

請在你的suite裡新增一個script,命名為ScreenPart檔名,接著貼以下的程式碼

[Eggplant] 使用eggplant functional連結Selenium進行自動化測試(三):取得網頁Table的數值,以wiki百科為例

主要使用Selenium來讀取表格的內容,
進行自動化測試會比使用圖片識別更來的單純,
這個範例是分析wiki百科內的這個表格。



取得元素WebElement Identifiers

類似jquery的選擇器,提供多種方法讓你找到網頁上的元素

元素物件WebElement Objects

當找到元素後你會獲得一個WebElement物件,可以協助你萃取元素的資訊

待補...

[Eggplant] 使用eggplant functional連結Selenium進行自動化測試: 安裝於windows

如果有參考先前mac的教學做過一遍的話,
那使用window的客戶就更單純了~真是幸福呀!箊
只要到eggplant下載官方的WebDriverServerSetup.exe安裝包(安裝精靈),
一步接一步就會安裝完,Selenium Server了,不過WebDriver也是要另外下載(參考先前的文章)。

下載資訊

https://www.eggplantsoftware.com/eggplant-functional-downloads

懶到到官網下載頁面的話請至以下連結
http://downloads.testplant.com/downloads/WebDriverServerSetup.exe

安裝完後要啟動在windows的選單就可以發現啦:D

星期日, 11月 03, 2019

[Eggplant] 使用eggplant functional連結Selenium進行自動化測試(二):建立連線

繼上一篇架設環境後,我逐一來說明如何建立連線。
PS:此文章內容已包含所需的環境建置

啟動你的Selenium Server

如已啟動可以忽略此步驟

 selenium-server -port 4444

建立一個新的連線

打開eggplant functional且打開connection list
這個連線就是連接你電腦安裝的selenium,
預設的port為4444,
Connection Type請選擇為WebDriver


[Eggplant] 使用eggplant functional連結Selenium進行自動化測試(一):安裝 mac測試環境

本文以Mac開發環境來記錄整個安裝Selenium WebDriver Testing流程。

系統限制

Note: Eggplant Functional works with Selenium Server 2.0, also known as Selenium WebDriver. Supported browsers are Firefox, Google Chrome, Microsoft Edge, Microsoft Internet Explorer 10, and Safari. Typically, you need to install a driver for each browser type you want to use.

要注意非windows環境要額外裝自已要的WebDriver

運作方式

SenseTalk <==> Selenium Server <==> Browser Drivers <==> Web Page


前置環境建置

安裝homebrew

進入/usr/bin目錄安裝homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


其他你感興趣的文章

Related Posts with Thumbnails