Hi,
I am trying to figure out a way in which i can use data driven from an excel sheet to repeat a sequence of steps.
Attached is the html view and below code which i am using. The RED tick in the attachment is the text (Product -Gain/Loss) which i would like to enter and pick from an excel sheet. Similarly for each repeat sequence different text will be picked up from an excel sheet.
The below code helps me get the correct text value and perform a click event some times and sometimes it gives an error . But even if it works for the first iteration it gives an error when it moves to the second iteration to pick the second text value from the excel sheet.
Can you guys help me on this please?
Thanks,
Santosh
I am trying to figure out a way in which i can use data driven from an excel sheet to repeat a sequence of steps.
Attached is the html view and below code which i am using. The RED tick in the attachment is the text (Product -Gain/Loss) which i would like to enter and pick from an excel sheet. Similarly for each repeat sequence different text will be picked up from an excel sheet.
The below code helps me get the correct text value and perform a click event some times and sometimes it gives an error . But even if it works for the first iteration it gives an error when it moves to the second iteration to pick the second text value from the excel sheet.
HtmlDiv e = Find.ByExpression<HtmlDiv>(
"id=ReadyToUse_Reports"
);
string
SelectedReport = Convert.ToString(Data[
"B"
].ToString()).Trim();
HtmlAnchor a = e.Find.ByContent<HtmlAnchor>(SelectedReport, FindContentType.InnerText);
or
HtmlAnchor a= e.Find.ByContent<HtmlAnchor>(SelectedReport, FindContentType.TextContent);
Assert.IsNotNull(a);
a.Click();
Can you guys help me on this please?
Thanks,
Santosh