<commit_before>﻿namespace Selenium_Webdriver_Helpers.App
{
    public static class WaitExtensions
    {
    }
}<commit_msg>add method wait for ajax<commit_after>﻿using System.Threading;
using OpenQA.Selenium;

namespace Selenium_Webdriver_Helpers.App
{
    public static class WaitExtensions
    {
        public static void WaitForAjax(this IWebDriver driver)
        {
            while (true)
            {
                var ajaxIsComplete = (bool)(driver as IJavaScriptExecutor).ExecuteScript("return jQuery.active == 0");
                if (ajaxIsComplete)
                    break;
                Thread.Sleep(100);
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.07750759878419453, 'fraction_numerical': 0.0060790273556231, 'mean_word_length': 2.108490566037736, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5399097', 'n_tokens_mistral': 187, 'n_tokens_neox': 174, 'n_words': 39}