I am trying to match the first word in a drop down list with a given string. What is happening is when I am creating a new drop-down name, it is getting updated by some different name, though the first word remains same.
The code I am using is:
public void DeleteStyleGroup()
{
var StyleGroupName = Driver.Instance.FindElement(By.Name("sgroupnbr"));
StyleGroupName.Click();
var selectelement = new SelectElement(StyleGroupName);
selectelement.SelectByText(GrpName);
}
The drop-down field name here is "sgroupbr"
In my Unit test class, the code I am using is:
public class DeleteStyleGroup : ibankTest
{
[TestMethod]
public void Delete_Style_Group()
{
StyleGrp.GrpNme("AdrijaTest").DeleteStyleGroup();
}
[TestInitialize]
public void ClassInit()
{
StyleGrp.Goto();
StyleGrp.StyltGroupName("AdrijaTest").Configuration("C3 One Tab").Save();
}
}
So the the group name is a method where it tries to find the drop-down name "AdrijaTest", but it is getting updated with some other name like "AdrijaTest 401".
Can someone please help?