cancel
Showing results for 
Search instead for 
Did you mean: 

Datadriven Using Excel for Scripts

Occasional Contributor

Datadriven Using Excel for Scripts

I want to use excel sheet for different test cases. 

Value corresponding to ScriptName Column will be the function name as well in TestCase Script file. 

Please help how to read and write values from excel and run in Javascript.

I have seen lot of documentation but it is not helpful and everywhere it is using keyword driven test with data loops. I do not want that. Please refer attached file. 

 

 

3 REPLIES 3
Highlighted
Community Hero

Re: Datadriven Using Excel for Scripts

I have created step by step guide for reading excel please refer the article https://www.linkedin.com/pulse/testcomplete-read-data-from-excel-step-shankar-r/


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”


Extension Available

Occasional Contributor

Re: Datadriven Using Excel for Scripts

Read the excel data and store in RecordSet as Shankar mentioned,

 

Use those values to build the function name and its arguments as a String Variable. Finally pass the variable to eval method to run the script which is present in the script file

 

Eg in Vbscript

Builder = objRS.Fields("ScriptName").Value & "(""OR_" & objRS.Fields("Username").Value & """)"

Eval(Builder) - This will identify the function in  TestCase Script file and will run it.

 

Community Manager

Re: Datadriven Using Excel for Scripts

Hi @sdudani,

 

Just to make sure that you read this article

https://support.smartbear.com/testcomplete/docs/testing-with/data-driven/drivers.html

 

It contains very useful samples in different languages.

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
New Here?
Join us and watch the welcome video:
Watch the new Interview
Top Kudoed Authors