Unleashing Speech Reporting for Selenium .Net Framework

Unleashing Speech Reporting for Selenium .Net Framework

In my last article I covered how we can add speech reporting for Java Selenium Framework. In this article I'm going to cover how we can add speech reporting for C# .Net Selenium Framework.

First of all add Microsoft Speech into your references.

No alt text provided for this image

Then I have added the common function to do speech reporting.

  public void SpeechReporting (string text)
        {
            SpeechSynthesizer synthesizer = new SpeechSynthesizer();
            synthesizer.Volume = 100// 0...100
            synthesizer.Rate = -2;     // -10...10


            // Synchronous
            synthesizer.Speak(text);
        }

Finally I have added the speech reporting at my test case level.

   IWebDriver driver = new ChromeDriver();
   Speech sp = new Speech();
   sp.SpeechReporting("Loading chrome driver");
   LoginPage loginP = new LoginPage(driver);
    HomePage home = new HomePage(driver);


要查看或添加评论,请登录

Kushan Shalindra Amarasiri的更多文章

社区洞察

其他会员也浏览了