seleniumautomationui-automationspeed-test

Can I Automated Speed Test using Selenium?


I am using beta.speedtest.net to check my network speed. I want to automate this process using Selenium(open to other frameworks as well). This automation process consists of few steps

  1. Clicking on Change Server link
  2. Type my preferred server location
  3. Choose the server of my choice
  4. Run the test
  5. Get the result of each test (in any way possible)

How I am proceeding

    public void RunTheTest()
    {
        IWebDriver driver = new ChromeDriver();
        driver.Manage().Window.Maximize();
        driver.Navigate().GoToUrl("http://beta.speedtest.net");
        driver.FindElement(By.LinkText("Change Server")).Click();
    }

Unable to find any element that is critical for my process.


Solution

  • The LinkText won't work in your case because the text contains leading and trailing white spaces. Those may be Non-Breaking SPaces

    enter image description here

    So you have to go with xpath with contains or normalize-space

    //a[normalize-space(text())='Change Server']
    
    //a[contains(text(),'Change Server')]
    

    If you want simple then go with className

    btn-server-select
    

    as there is only one element with such className