save HTML without content
I have a function that is used to save the HTML tags of a webpage into a folder which can be treated as expected result and can be compared to the actual result during run time. The code works fine but it saves all the content in the controls as well. For example I do not want to save the value that is entered into a text box but only want to save the HTML details that specifies that there is a text box there. Is this even possible with testcomplete? How do I do that?
if(!ProjectSuite.Variables.generateHTML) return false; var folder = ""; ProjectSuite.Variables.generateHTML === "E" ? folder = "ExpectedResults\\" + folderName : folder = "ActualResults\\" + folderName; var filePath = ProjectSuite.Path + folder; if(!createFolder(filePath)) return false; Sys.Desktop.Keys("^s"); Browsers.CurrentBrowser; var browser = Aliases.browser; var fileNameBox = browser.Item.Item.Item.FloatNotifySink.ComboBox.Edit.wText; if(typeof fileName === "undefined") fileName = fileNameBox; if(aqString.Find(fileName, ".html") == -1) fileName += ".html"; aqFileSystem.DeleteFile(filePath + "\\" + fileName); var newFileName = fileName; browser.Item.Item.Item.FloatNotifySink.ComboBox.Edit.SetText(filePath + "\\" + newFileName); browser.Item.btnSave.Click();
Solved! Go to Solution.
Hi @LinoTadros ,
Thank you for the pointer. I will try it out. I need to have a script for it. I am assuming I will record the process to a script and using it should work for me.