I am trying to match the first in a drop down list with a given . What is happening is when I am creating a new drop-down name, it is getting updated by some different name, though the first 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?



Source link https://sqa.stackexchange.com/questions/22001/--name-where-only-the-first-word--given-string-using-selen

LEAVE A REPLY

Please enter your comment!
Please enter your name here