开发者

Can "Excel Add-In for Coded UI Testing" help when reading test scenario data from Excel worksheet

This requires a detailed explanation.

Imagine that I have an Excel spreadsheet with test cases in one worksheet and I may have expected (validation) messages in another (in addition to expected messages in the first worksheet).

There is also some linking between the values of fields in one to the second worksheets.

See: Welcome, <First Name> <Last Name> as an example.

You can see in the "Expected Results" field in "Test cases" worksheet the value of the field is: "The user is taken to My Account page and following welcome message is displayed: "&Messages!$B$1244&", where First name is Dave and Last Name is Brown."

so "&Messages!$B$1244&", denotes field B1244 in worksheet "Messages"

Now the question.

If I am given all test cases like the example below for an ecommerce web site, how can I use Coded UI Testing based on this input? Can I automate Excel, use the steps in test case worksheet and combine that with Coded UI recording of data input and verification.

I believe I would need to do manual coding, partially using recorded input steps and verifications from Coded UI recorder and possibly using manual programming for verification. I would like to hear if others have done something similar.

I would like to incorporate this into Specflow BDD, by writing feature/user story and these test cases will be scenarios.

Any success, thoughts on using Excel test automation as data dr开发者_运维问答iven testing.

Thanks Rad

Test cases worksheet named "Test cases":
=====================
Test Case Name    Test Case Objective  
frontstore.01-3   Register a shopper from order 
                  confirmation page with valid inputs  

# Step                                Data                           Expected Results  
------------------------------------------------------------------------------------------------
1 Launch the test storefront            http://testserver.com/index Welcome page is loaded.  
2 Click Sign In link                                                   Sign In page is loaded.  
3 Click Register under New Customer                                    Register page is loaded.  
4 Enter valid inputs and click Submit     "Logon ID = TestUser                               
                                           Firstname = John                                   
                                           Lastname = Clark                                
                                           ... (other fields)          Registration Successful.  
                                                                       The user is taken to My Account page   
                                                                       and following welcome message is displayed:   
                                                                       Welcome, <First Name> <Last Name>, where First name is  
                                                                       David and Last Name is Brown."  


Validation Messages worksheet named "Messages":  
=====================  
#Text used in MyAccountPages  
---------------------------------------------------------------------------  
MA_WELCOME                                    Welcome, <First Name> <Last Name>  

After reading a bit about Coded UI testing: It can certainly be done, but data/sentences like:

“Launch the test storefront”

“Click Sign In link”

“Registration Successful.

The user is taken to My Account page

and following welcome message is displayed:

Welcome, , where First name is

David and Last Name is Brown."

contain both actions and data so I need to drill down into parts of the sentence to translate it to actions and binding to parameters. If I understand well data binding can only be used to bind column values to some parameters. So I need some way to automatically recognize the meaning of these sentences and use some binding from parts of it.

So if I have a sentence:

“Launch the test storefront” that would be translated to:

CurrentBrowser.Navigate(Helper.TranslateTargetUrlFrom(“test storefront”)) where “test storefront” might resolve to http://testserver.com/index storefront home page and I can ignore Data column for URL or I can capture Launch keyword to mean CurrentBrowser.Navigate(ColumnValue(Data)) and ignore “test storefront” part of the sentence.

“Click Sign In link” could be translated to CurrentBrowser.FindLink(“Sign In”).Click(),

so it this case I will need to know that Sign In is the text of the link, again I need to extract “Sign In” to mean the text of a link.

I see this as pretty manual style of CodedUI where I could do small recording for some actions and rely on manual extractions of terms from given sentences.

I would like to know how can I semantically write better test cases to allow automation. I would probably need some kind of free form test case parser that would recognize the semantic meaning of some words like: click, navigate, launch, enter, click under etc and translate this into code by re-using existing helper methods and recorded actions and do some manual binding, but not with the whole data value in the column, but an extracted value.

Any idea of this kind of automation?


I think yould could do this by data binding the input parameters and just reading Excel as a datasource, you are going to need to use CodedUI for that not MTM + Fast Forward

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜