Ask a Question

Data Driven Testing Dropdown

pavithiras
Occasional Contributor

Data Driven Testing Dropdown

Is it possible to make a Data-driven Keyword test for a web page that contains four fields, Which includes two text box fields and two drop down fields. How can I make it data driven, and I am going to get the inputs from an Excel sheet.

Thanks.

20 REPLIES 20
rraghvani
Champion Level 3

I suggest you read through Data-Driven Testing. It is possible to achieve what you require.

pavithiras
Occasional Contributor

I was trying to do that, It is working for the text boxes. But for the drop down it is not taking values from the excel.

rraghvani
Champion Level 3

Within your data driven loop, try to output the value to message log. To check if you are reading the correct values from your Excel spreadsheet.

pavithiras
Occasional Contributor

Hi, Thank you for helping me out.
I tried to check that values, it displays the expected value in log message. It clicks the drop down box and it's not able to find the data to match from the excel data. 
EG: In excel it says January as the data, But after clicking the month dropdown it was not able to click on January. IS that because of click method?

rraghvani
Champion Level 3

Try using for example ClickItem("January") method.

 

I don't know what your control looks like, as not all controls are the same.

pavithiras
Occasional Contributor

I am using a web application, this method says it cannot be used in Web app.
My control looks like, For example: It looks like a calendar where it has a drop down for months and years and we need to select the months and year that we are getting from the excel.

pavithiras_0-1696363619337.png

 

Marsha_R
Champion Level 3

Try recording a little test to access the drop down and see what code TestComplete gives you for those actions.

pavithiras
Occasional Contributor

Hi Marsha,

I tried making a test which records just a single person data, for the drop down. It is creating an aliases (Name Mapping) and and it maps the month I selected during the recording and uses the click method to select the month when I run the test. 

How can I send a variable for the click method?

Thank you in advance.

pavithiras
Occasional Contributor

Hi Marsha,

I tried making a test which records just a single person data, for the drop down. It is creating an aliases (Name Mapping) and and it maps the month I selected during the recording and uses the click method to select the month when I run the test. 

How can I send a variable for the click method?

Thank you in advance.

cancel
Showing results for 
Search instead for 
Did you mean: