Unleashing Speech Reporting for Selenium .Net Framework
Kushan Shalindra Amarasiri
Director Quality Engineering at Social Catfish
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.
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);