我一直在使用watin進行webapp的集成測試。 webapp使用fckeditor作爲richtext控件之一。FckEditor的Watin測試
這裏是一片我的web應用程序的viewsource的HTML中,包括FCKeditor的
IFRAME ID = 「ctl00_HeaderMain_txtSafetyNetDescription ___框架」 SRC = 「/ FCKEditor的/編輯/ fckeditor.html?實例名= ctl00_HeaderMain_txtSafetyNetDescription &工具欄= MyApp來」 寬=「100%」height =「200px」frameborder =「no」scrolling =「no」/ iframe
通過使用watin腳本...我能夠使用下面的代碼獲取框架對象。
Frame frame = ie.Frame(Find.ById("ctl00_HeaderMain_txtSafetyNetDescription___Frame")) ;
現在我想寫一些文本到fckeditor。但我不知道如何寫入fckeditor,因爲它是一個框架 - 有人可以幫助我做到這一點。
謝謝。 Iyyengar。
我必須這樣做: var richTextFrame = browser.Frame(WatiN.Core.Find.ByTitle(「Rich text editor,DESCRLONG $ 0,press ALT 0 for help。」)); richTextFrame.Body.SetAttributeValue(「innerText」,「Testing Note Details」); – Omzig 2014-07-14 16:24:01