cancel
Showing results for 
Search instead for 
Did you mean: 

Data Driven testing: How do I conditionally evaluate XLS value in script?

Highlighted
Contributor

Data Driven testing: How do I conditionally evaluate XLS value in script?

Hello,

 

I am working on a Data Driven test using an XLS file as my input data. One column in the file indivcates whether or not to use that row's data for testing. The file contains a number of users and their login credentials. Depending on what test scenario I am conducting, some users should be skipped.

 

I am trying to figure out how to evaluate the value found in column [Include_In_Test] in vbscript. If the value is Y, then proceed and use this row, otherwise, skip to the next data row.

 

I appreciate any examples, suggestions, etc.

 

Thanks,

Bill

2 REPLIES 2
Community Hero

Re: Data Driven testing: How do I conditionally evaluate XLS value in script?

I'm not a VB guy.... but generally, the below JavaScript should be what you need to do...
if (ExcelDriverObject.Value('RunThisTest') === 'Y'){
DoSomething();
}
else {
DoSomethingElse();
}

In code, that's what I would do. You can do something similar with the if...then operation in a keyword test.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: Data Driven testing: How do I conditionally evaluate XLS value in script?

Spoiler
 

Thank you.