c# - 为什么下一个按钮要花这么长时间才能按下?
问题描述
好吧,很简单,我在 C# 中有一个 selenium 脚本,您从下拉框中选择一个名称,选择日期并逐页计算结果的数量。现在有人可以帮我加快这个过程,因为单击下一个按钮进入下一页几乎需要 5 秒钟。
这是我的代码:
int entityCount = 0;
int totalCount = 0;
try
{
System.Threading.Thread.Sleep(5000);
while (_AuditRep.nextButton.Enabled && _AuditRep.nextButton.Displayed)
{
System.Threading.Thread.Sleep(5000);
_AuditRep.nextButton.Click();
entityCount += _AuditRep.AuditResultsByEntity("Users").Count;
totalCount += _AuditRep.AuditTotalResults.Count;
}
if (entityCount != totalCount)
{
Assert.Fail("The count of Drivers is " + entityCount + " whereas "
+ "the total count is " + totalCount);
}
else
{
Console.WriteLine("The count of entity Drivers is " + entityCount + " and "
+ "the total count is " + totalCount);
}
}
catch
{
if (_AuditRep.AuditResultsByEntity("Users").Count != _AuditRep.AuditTotalResults.Count)
{
Assert.Fail("The count of Drivers is " + _AuditRep.AuditResultsByEntity("Users").Count + " whereas "
+ "the total count is " + _AuditRep.AuditTotalResults.Count);
}
else
{
Console.WriteLine("The count of entity Drivers is " + _AuditRep.AuditResultsByEntity("Users").Count + " and "
+ "the total count is " + _AuditRep.AuditTotalResults.Count);
}
}
解决方案
推荐阅读
- node.js - How to programmatically set the network proxy on Mac OS via node.js
- react-native - How to fix react-native-gesture-handler error not working
- scala - How to split a Scala list into sublists based on a list of indexes
- android - pass onActivityResult data to viewmodel while facebook login imports import android.content.Intent
- javascript - Ajax GET: multiple data-specific calls, or fewer less specific calls?
- vert.x - Is a vert.x even bus address uni-directional?
- python - Is there a tool to test mobile push notifications, without having actual mobile app?
- jmeter - jmeter和随机数分布
- sql-server - SQL Server drop temporary table has odd behaviour
- java - Is there any way to create a fixed accelerometer sensor delay on my Android app? I want to achieve, exactly, 20 Hz sampling rate