Pages - Menu

2019年9月24日 星期二

[Katalon Studio]登入Ldap 網站

前言的碎碎念

一般登入的網頁都很簡單,去抓個input的id塞個帳號密碼進去就好了,
但是Windchill 就是愛走不尋常的路,弄個Ldap出來,請參考下圖(fig 1)
現在又有任務要把合計上千個料號的英文品名弄進去Windchill裡面
本來使用Katalon Recorder ,不用管怎麼登入,只要網頁先開好進去後,
執行就對了。但只要執行了一百多個料號,Chrome的記憶體開始吃到4G,然後就掛了。
改完Chrome的參數後有比較好,能跑到兩百多個,但記憶體吃到7G多後一樣掛掉。
只好改研究Katalon Studio了,一開始以為是http proxy login但驗證不過,最後才想起來應該是走apache的ladp認證






(fig 1)
要使用這個前,請先安裝autoit
詳細步驟可參考水管,只參考AutoIT的部分即可
開啟編輯器 (fig 2 的 step 1)

(fig 2)
在(fig 3)輸入以下指令

(fig 3)

WinWaitActive("需要授權")
Send("mis{TAB}321{ENTER}")

第一個是視窗的名稱,
不知道視窗的名稱,可以開啟(fig 2的step 2)
按住step 1 拉去 視窗 step 2 上面



可以看到title的名稱,很奇怪的是Chrome無法擷取視窗的名稱,Firefox卻可以。


再來開啟Katalon Studio
參考 官網範例-Using autoIT for authentication in Katalon Studio

WebUI.openBrowser('')
autoit_prj = 'D:\\kill\\autoit\\Windchill.exe'
Runtime.getRuntime().exec(autoit_prj)
Thread.sleep(3000);
 
//Sample URL. Please change it to your authentication URL
WebUI.navigateToUrl('http://test2.daimom.tw/Windchill')



參考:
How To Handle Authentication Popup Window Using Selenium WebDriver

沒有留言:

張貼留言