Friday 17 September 2021

The log4net v2.0.12 is not working in the Visual Studio 2019 V16.11.2.

🐛 Bug Report

 


The log4net v2.0.12 is not working in the Visual Studio 2019 V16.11.2.

Environment

  1. OS: Windows 10
  2. Selenium version: 4.0.0-rc1
  3. Language Bindings version: C#
  4. Visual Studio version: 2019 V16.11.2
  5. log4net version: 2.0.12




Thursday 16 September 2021

specflow-Selenium-C# test script displays error in Visual Studio 2019 V16.11.2

🐛 Bug Report



Selenium-specflow test script displays error in VS2019 when the SpecFlow.MSTest v3.9.22 is installed

Error Details:

Severity Code Description Project File Line Suppression State
Error The "GenerateFeatureFileCodeBehindTask" task failed unexpectedly.
System.Exception: Error when reading project file. ---> System.Configuration.ConfigurationErrorsException: Unrecognized element 'unitTestProvider'.
at System.Configuration.ConfigurationElement.DeserializeElement(XmlReader reader, Boolean serializeCollectionKey)
at System.Configuration.ConfigurationSection.DeserializeSection(XmlReader reader)
at TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler.CreateFromXml(String xmlContent)
at TechTalk.SpecFlow.Configuration.ConfigurationLoader.Load(SpecFlowConfiguration specFlowConfiguration, ISpecFlowConfigurationHolder specFlowConfigurationHolder)
at TechTalk.SpecFlow.Generator.Configuration.GeneratorConfigurationProvider.LoadConfiguration(SpecFlowConfiguration specFlowConfiguration, SpecFlowConfigurationHolder specFlowConfigurationHolder)
at TechTalk.SpecFlow.Generator.Configuration.GeneratorConfigurationProviderExtensions.LoadConfiguration(IGeneratorConfigurationProvider configurationProvider, SpecFlowConfigurationHolder configurationHolder)
at TechTalk.SpecFlow.Generator.Project.ProjectReader.ReadSpecFlowProject(String projectFilePath, String rootNamespace)
--- End of inner exception stack trace ---
at TechTalk.SpecFlow.Generator.Project.ProjectReader.ReadSpecFlowProject(String projectFilePath, String rootNamespace)
at TechTalk.SpecFlow.Generator.Project.MSBuildProjectReader.LoadSpecFlowProjectFromMsBuild(String projectFilePath, String rootNamespace)
at SpecFlow.Tools.MsBuild.Generation.SpecFlowProjectProvider.GetSpecFlowProject()
at SpecFlow.Tools.MsBuild.Generation.GenerateFeatureFileCodeBehindTaskExecutor.Execute()
at SpecFlow.Tools.MsBuild.Generation.GenerateFeatureFileCodeBehindTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() SeleniumWebdriver

Expected behavior :

  • Build generation should be successful

Environment

  1. OS: Windows 10
  2. specflow version: 3.9.22
  3. Selenium version: 4.0.0-rc1
  4. Language Bindings version: C#
  5. Visual Studio version: 2019 V16.11.2
  6. SpecFlow.MSTest version: 3.9.22
1. When the Project is created using the "SpecFlow project" as template, the version is V 3.9.8 where there are no issues.

2. When the Project is created using the "MSTest project" as template and the Specflow is added/installed on top of it, the version is V 3.9.22.
  •    Here the GHerkin and Cucumber versions are creating the issue.
3. If a project is created using the MSTest template and if the SpecFlow version is updated to the V 3.9.22, this issue will occur.



I have created a new project and if SpecFlow is installed dependencies mentioned were not installed (such as BoDi and Cucumber.Message) but in old project these were installed individually and the error persist.

 


Sunday 12 September 2021

Selenium-C#- V 4.0.0-rc1-DesiredCapabilities has been deprecated and henceforth the WinAppDriver is not working


🐛 Bug Report




Selenium-C#- V 4.0.0-rc1-DesiredCapabilities has been deprecated and henceforth the WinAppDriver is not working

Expected behavior:

DesiredCapabilities should not be deprecated, as it required for automating the WinAppDriver

Environment:

OS: Windows 10
WinAppDriver version: WinAppDriver v1.3 Release Candidate 1 (1.2.99)
Language Bindings version: C#
Selenium version : Selenium-C#- V 4.0.0-rc1

Screenshot:






Wednesday 8 September 2021

Selenium-C# - MSTest-Excel Data Driven and ExcelDataReader Visual Studio issues




 Selenium-C#- V 4.0.0-rc1

ExcelDataReader - V 3.7.0-develop00310

ExcelDataReader.DataSet - V 3.7.0-develop00310

Visual Studio - Version 16.11.2

=========================================================================

ExcelDataReader:

Public calss ExcelDataRead

{

 public void TestReadExcel()

        {

            FileStream stream = new FileStream(@"TestCreateBugXlsx.xlsx", FileMode.Open, FileAccess.Read);

   ftype = Path.GetExtension(filename);

   if (ftype == ".xls")

  {

IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream);

  }

  else

 {

IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);

 }

           //To UseHeaderRow or filter the rows

            var result = excelReader.AsDataSet(new ExcelDataSetConfiguration()

            {

                ConfigureDataTable = (_) => new ExcelDataTableConfiguration()

                {

                        UseHeaderRow = true,

                        FilterRow = rowReader => rowReader.Depth > 1

                }

            });

            DataTable result1 = result.Tables["TestCreateBug"];

}

}

====================================================================

Issues in ExcelDataReader:

1. "excelReader.IsFirstRowAsColumnNames = true;" is not working

2. When the ".xlsb" file is read with the "FilterRow = rowReader => rowReader.Depth > 0" in configuration section, it is not working as expected, even when Filter row is commented out, the same output is generated.

3. When the ".xlsb" file is read, the character "d" is randomly generated

Screenshot:



4. Added a new sheet such as "Sheet1" and when the below code is executed the success message is displayed and data reading is unsuccessful when the 1st row is used as header.

Code:
 [TestClass]
    public class TestExcelData
    {

        [TestMethod]
        public void TestReadExcel()
        {
            FileStream stream = new FileStream(@"TestCreateBugXlsb.xlsb", FileMode.Open, FileAccess.Read);
            //IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream);
            IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);

            var result = excelReader.AsDataSet(new ExcelDataSetConfiguration()
            {
                ConfigureDataTable = (_) => new ExcelDataTableConfiguration()
                {
                    UseHeaderRow = true,
                    FilterRow = rowReader => rowReader.Depth > 0
                }
            });

            DataTable table = result.Tables["Sheet1"];
           
            for (int i=0; i < table.Rows.Count; i++)
            {
                var col = table.Rows[i];
                for (int j=0; j < col.ItemArray.Length; j++)
                {
                    Console.WriteLine("Data : {0}", col.ItemArray[j]);
                }
            }
        }
    }
}


4. Added a new sheet such as "Sheet1" and when the below code is executed the success message is displayed and data reading is successful when the 1st row is not used as header.

 [TestClass]
    public class TestExcelData
    {

        [TestMethod]
        public void TestReadExcel()
        {
            FileStream stream = new FileStream(@"TestCreateBugXlsb.xlsb", FileMode.Open, FileAccess.Read);
            IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);

            DataTable table = excelReader.AsDataSet().Tables["Sheet1"];

            for (int i = 0; i < table.Rows.Count; i++)
            {
                var col = table.Rows[i];
                for (int j = 0; j < col.ItemArray.Length; j++)
                {
                    Console.WriteLine("Data : {0}", col.ItemArray[j]);
                }
            }
        }
    }
}




=================================================================

Excel Data Driven using the Data Source in MSTest:

public class DataDriven

    {

        private TestContext _testContext;

        public TestContext TestContext

        {

            get { return _testContext; }

            set { _testContext = value; }

         }        

        [TestMethod]

        [DataSource("System.Data.Odbc", @"Dsn=Excel Files;dbq=CreateBugXlxs.xlsx", "CreateBug$", DataAccessMethod.Sequential)]

        public void TestDataDriven()

        {

            Console.WriteLine(TestContext.DataRow[0].ToString());

            Console.WriteLine(TestContext.DataRow[1].ToString());

            Console.WriteLine(TestContext.DataRow[2].ToString());

            Console.WriteLine(TestContext.DataRow[3].ToString());

            Console.WriteLine(TestContext.DataRow[4].ToString());

}

Issues:

1. When the '.xlsb' file is being data driven/read, an additional empty row is being executed or stored

Screenshot:



2. Added a new sheet such as "Sheet1" and when the below code is executed the warning is displayed without any details and data reading is unsuccessful as 1st row is used as header by data source as default.

Code:

[TestClass]
    public class TestCreateBugXlxs
    {
        private TestContext _testContext;

        public TestContext TestContext
        {
            get { return _testContext; }
            set { _testContext = value; }
        }

        
        [TestMethod]
        [DataSource("System.Data.Odbc", @"Dsn=Excel Files;dbq=TestCreateBugXlsb.xlsb", "Sheet1$", DataAccessMethod.Sequential)]
        public void TestBugXlxs()
        {
            Console.WriteLine(TestContext.DataRow[0].ToString());
         }
  }




3. When the Excel is Data Driven and Platform target is 'Any CPU' and installed is 'accessdatabaseengine_X64.exe', error is displayed but when the 'x64' is chosen, the error is not displayed here the performance is degraded (Visual Studio 2019)

Screenshot:





Monday 6 September 2021

Selenium-C#- Latest Browser and V"4.0.0-beta4" or in "4.0.0-rc1" Issues


The below mentioned are the issues in the Selenium-C#-V"4.0.0-beta4" or in "4.0.0-rc1" Issues

  1.  In the Selenium "4.0.0-beta4" or in "4.0.0-rc1" -C#, the 'ExpectedConditions' method implementation is not provided in the 'OpenQA.Selenium.Support.UI'

Selenium - C# -Issues in all latest browsers

  1. The drag and drop functionality is not working in all latest browser
  2. The "CTRL + t :: For opening a new tab" functionality achieved through the Actions class is not working
  3. The "CTRL + shift + a :: For opening Add-ons tab" functionality achieved through the Actions class is not working 
  4. "ALT + f + x - for closing the tab" functionality achieved through the Actions class
  5. The "Click And Hold" functionality is not working