This question is locked. New answers and comments are not allowed.
Hello,
I am using coded step for data driven testing instead of UI binding in one of my Test Case.
Everything seems to working fine when I give Fix path to open CSV file. It will work fine if I want to run Test case from TestList Editor. But my requirement is to run it as TFS nightly build which is at different location. For that how to set relative Path to open CSV file.
I have also added code for reference.
Also it will be very helpful if you guide on how to close browser window in coded step. I have added:
it is passed also but browser window remains open.
Waiting for Reply!!
--Krishna Gandhi.
I am using coded step for data driven testing instead of UI binding in one of my Test Case.
Everything seems to working fine when I give Fix path to open CSV file. It will work fine if I want to run Test case from TestList Editor. But my requirement is to run it as TFS nightly build which is at different location. For that how to set relative Path to open CSV file.
I have also added code for reference.
Also it will be very helpful if you guide on how to close browser window in coded step. I have added:
ActiveBrowser.Close(1000);
(it is added in "else" part in code).it is passed also but browser window remains open.
Waiting for Reply!!
--Krishna Gandhi.
public void AM4_CreateGroups_CodedStep()
{
//StreamReader reader = new StreamReader("C:/Work/Krishna_TFS_Local/ABC.Test.AutomatedUITests/Banking/CreateGroups1.csv");
StreamReader reader = new StreamReader("~/CreateGroups1.csv");
{
Pages.ABC.SilverlightApp.UserManagementTextblock.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick);
Pages.ABC.SilverlightApp.GroupsTextblock.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick);
System.Threading.Thread.Sleep(5000);
Pages.ABC.SilverlightApp.XamlButtonButton.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick);
string line = reader.ReadLine();
line = reader.ReadLine();
while (string.IsNullOrEmpty(line) == false)
{
string[] S = line.Split(',');
Log.WriteLine(line);
Pages.ABC.SilverlightApp.APXamlUserGroupNameTextboxex.SetText(true, S[0], 10, 100, false);
Pages.ABC.SilverlightApp.APXamlDescriptionTextboxex.SetText(true, S[1], 10, 100, false);
Pages.ABC.SilverlightApp.APXamlEmailAddressTextboxex.SetText(true, S[2], 10, 100, false);
Pages.ABC.SilverlightApp.SaveTextblock.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick);
System.Threading.Thread.Sleep(5000);
line = reader.ReadLine();
if (line != null)
{
Pages.ABC.SilverlightApp.XamlTitleTextblock.User.Click(ArtOfTest.WebAii.Core.MouseClickType.RightClick);
Pages.ABC.SilverlightApp.CloseAllTextblock.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick);
Pages.ABC.SilverlightApp.GroupsTextblock.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick);
System.Threading.Thread.Sleep(5000);
Pages.ABC.SilverlightApp.XamlButtonButton.User.Click(ArtOfTest.WebAii.Core.MouseClickType.LeftClick);
System.Threading.Thread.Sleep(5000);
}
else
{
ActiveBrowser.Close(1000);
}