cancel
Showing results for 
Search instead for 
Did you mean: 

save HTML without content

SOLVED
Highlighted
aa1
Contributor

save HTML without content

Hi,

 

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?

 

My code:

 

 

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(); 

Please help.

 

thanks

aa

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Leader

Re: save HTML without content

Do a "Web Comparision Checkpoint" and use the "Compare only Tag Structure feature.

Cheers

-Lino

View solution in original post

2 REPLIES 2
Community Leader

Re: save HTML without content

Do a "Web Comparision Checkpoint" and use the "Compare only Tag Structure feature.

Cheers

-Lino

View solution in original post

aa1
Contributor

Re: save HTML without content

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.

 

thanks again.

New Here?
Join us and watch the welcome video:
Top Kudoed Authors