如果表行随着搜索查询而消失,如何等待将搜索数据加载到表中?硒c#

问题描述 投票:0回答:1

该表在首次打开时加载数据,我创建了一个方法来获取随机数据并进行搜索,清除旧数据需要时间,然后显示“无结果”,然后加载新的搜索结果,该表的第一行始终可见的原因,它会显示“ No Result”一段时间,然后在数据加载后显示所有行,如何执行等待,等待数据清除然后等待新数据加载我尝试使用下面的代码,但即使在加载所有元素后仍要等待]

public void waitForSearchResult()
{
    var wait = new WebDriverWait(Driver, new TimeSpan(0, 1, 0));
    wait.IgnoreExceptionTypes(typeof(NoSuchElementException));
    try
    {
        wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.VisibilityOfAllElementsLocatedBy(Driver.FindElements(By.XPath("//manual-map-bddl-list//tbody/tr"))));
    }
    catch (Exception )
    {

    }

enter image description here

c# jquery selenium webdriverwait webautomation
1个回答
0
投票

我会尝试使用像这样的等待:

© www.soinside.com 2019 - 2024. All rights reserved.