Trying to find loading symbols in angular

Viewed 49

I am trying to find all loading symbols (spinners) in a webpage's pagesource (it is using angular). I currently trying to detect (fast) if a page is loading, what I have so far is to look for spinner-border ml-3 md-spinner. What else can I search for?

    public static bool IsLoading(IWebDriver driver)
    {
        List<string> xsIdentifiers = new List<string>(new string[]
        {
            "spinner-border ml-3 md-spinner",
        });

        foreach (var identifier in xsIdentifiers)
        {
            if (driver.PageSource.Contains(identifier))
            {
                Console.WriteLine($"Loading... Found identifier: {identifier}");
                Thread.Sleep(2000);
                return true;
            }
        }
        return false;
    }
1 Answers

I use the following technique to find elements that are loaded fast and you cannot detect them with locators.

  1. In Chrome go to Network
  2. Change the speed from No throttling to the slowest
  3. Open Elements tab
  4. Reload the page and check which elements are changed while your page is being loaded.

This is great method which saved me many times.

Network speed

Related