coded-ui-tests

How to run a test many times with data read from .csv file (data driving)

家住魔仙堡 提交于 2019-11-26 12:33:16
I am trying to automate some testing for one of our web applications and I need to know how I can make my Coded UI project read data from a CSV file. Lets say I want to test a log in screen. My CSV file will contain a few user names and passwords. I want my Coded UI test to read these log in details and loop through them to run the test on each set of data. AdrianHHH The web has many tutorials on data driving Coded UI tests. The basic steps for data driving with a CSV file are as follows. Create the CSV file. Add the CSV file to the project. Make sure the CSV file is deployed. Add the CSV file

“control.Exists” within a loop works for first time and not for second time in coded ui

爷,独闯天下 提交于 2019-11-26 10:03:50
问题 consider the code for(i = 0; i < 5; i++) { if(control.Exists) { mouse.Click(button); } } In this, control is a popup window. for the first time of execution, control.Exists = true and for the second time it is false though the control is present. Why is that so? How to make it to be true? Thanks in advance. 回答1: Programs often draw another copy of a control, it looks identical to the eye but it is different. Hence the second time around the loop control refers to the old version of the