Ask a Question

Script code for Checkpoint validation

SOLVED
Arunachalam
Occasional Contributor

Script code for Checkpoint validation

Hi,

 

The output log of "aqobject.checkproperty" either success or failure log can be stored in any external excel file by using script code. If any Script is available to share it.

1 ACCEPTED SOLUTION

Accepted Solutions
Wamboo
Community Hero

Re: Script code for Checkpoint validation

function storeLogInExternalFile(Object, Property, Condition, Value)) {
	
	var obj = {
		testItemName: Project.TestItems.Current.Name;
		testItemProperty: Property
		testItemValue: Value
		theValueIsCorrect : false;
	}
	
	(aqObject.CheckProperty(Object, Property, Condition, Value)) ? obj.theValueIsCorrect = true  : obj.theValueIsCorrect = false;
	
	let dataToExcel = JSON.stringify(obj);
	
	// put this data into file
}

or store data into long string and put it into one cell in excel and into another one the name of the test item.

Check in documentation that connection between TestComplete can accept JSON object as parameter. If yes you have good example.

View solution in original post

4 REPLIES 4
Wamboo
Community Hero

Re: Script code for Checkpoint validation

Hey,

 

What exactly do you want to do with the data in the file? must be excel? in which language do you write?

Arunachalam
Occasional Contributor

Re: Script code for Checkpoint validation

@Wamboo 

 

1. Our framework script in Javascript.

2. I need to store the log (which means success or failure ) into some excel sheet using the DDT driver method or any other method.

 

Wamboo
Community Hero

Re: Script code for Checkpoint validation

function storeLogInExternalFile(Object, Property, Condition, Value)) {
	
	var obj = {
		testItemName: Project.TestItems.Current.Name;
		testItemProperty: Property
		testItemValue: Value
		theValueIsCorrect : false;
	}
	
	(aqObject.CheckProperty(Object, Property, Condition, Value)) ? obj.theValueIsCorrect = true  : obj.theValueIsCorrect = false;
	
	let dataToExcel = JSON.stringify(obj);
	
	// put this data into file
}

or store data into long string and put it into one cell in excel and into another one the name of the test item.

Check in documentation that connection between TestComplete can accept JSON object as parameter. If yes you have good example.

View solution in original post

TanyaYatskovska
Community Manager

Re: Script code for Checkpoint validation

Thanks for the sample, @Wamboo!

 

@Arunachalam, is this what you were looking for?

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: