How to select the radio button option reading the excel

selector
uiautomation
studio

#1

Hi All,
i have a page which has question as shown below with options. In my excel, I have question Name and answer given to it for some 100 records.

I am not sure how to identify the item on UI page, read the option from CSV and map it and select tehe right option.


#2

I would suggest using UiExplorer on one of the answers and find an attribute that contains the answer, like aaname or something.

If you identify the attribute with the answer, then all you need to do is replace that part of the selector with the answer from the CSV file.
(ie “< … aaname=’*”+item.ToString+"*’ … >"); just make sure you click in the selector box to edit the selector as a string with quotes around it, that way you can concatenate the item from the table.

So I hope that helps with the tricky part. The rest of it is just storing your CSV in a data table and running it through a For each where you click the Option button.

Regards.


#3

First I need to find the Question right, How do I do that ., Sorry I am new., Can you help me with xaml file. That would be a great help.


#4

You are correct. You will need the question so you can line it up with the data table and find the right answer.

I don’t exactly have the time to work on this to provide samples. It would also require some analyzing of the webpage to see how you can differentiate between the questions. My thinking was that you could loop through your data table and select the answer using both the question and answer in part of the selector, but it depends on the webpage and how the selectors are.

Another approach to consider is the Find Children activity, where you can create a list of everything on the site, then jump to the elements within the question. There could be samples of this on the forums. I don’t have many examples of this to show you.

Regards.


#5

Thank you clayton. I tried that myself and it worked. Many thanks for your expert advise.