本文整理汇总了C#中WatiN.Core.Constraints.Constraint.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Constraint.ToString方法的具体用法?C# Constraint.ToString怎么用?C# Constraint.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WatiN.Core.Constraints.Constraint
的用法示例。
在下文中一共展示了Constraint.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SelectByTextOrValueMultiple
private static void SelectByTextOrValueMultiple(this SelectList selectList, Constraint constraint)
{
// This is copied from SelectList.SelectMultiple
var options = selectList.Options.Filter(constraint);
if (options.Count == 0)
throw new SelectListItemNotFoundException(constraint.ToString(), selectList);
foreach (var option in options)
{
if (option.Selected) continue;
option.SetAttributeValue("selected", "true");
}
selectList.FireEvent("onchange");
}
示例2: Find
public Browser Find(Constraint findBy, int timeout, bool waitForComplete)
{
Logger.LogAction((LogFunction log) => { log("Busy finding Internet Explorer matching constraint {0}", findBy); });
var timer = new SimpleTimer(TimeSpan.FromSeconds(timeout));
var ie = TryFindIe(findBy, timer);
if (ie != null)
{
return FinishInitializationAndWaitForComplete(ie, timer, waitForComplete);
}
throw new BrowserNotFoundException("IE", findBy.ToString(), timeout);
}
示例3: Find
public Browser Find(Constraint findBy, int timeout, bool waitForComplete)
{
Logger.LogAction("Busy finding FireFox matching constraint {0}", findBy);
var action = new TryFuncUntilTimeOut(TimeSpan.FromSeconds(timeout)) { SleepTime = TimeSpan.FromMilliseconds(500) };
var fireFox = action.Try(() => FindFireFox(findBy));
if (fireFox != null)
{
if (waitForComplete) fireFox.WaitForComplete();
return fireFox;
}
throw new BrowserNotFoundException("FireFox", findBy.ToString(), timeout);
}
示例4: FindHtmlDialog
private HtmlDialog FindHtmlDialog(Constraint findBy, int timeout)
{
Logger.LogAction("Busy finding HTMLDialog matching criteria: {0}", findBy);
var action = new TryFuncUntilTimeOut(TimeSpan.FromSeconds(timeout))
{
SleepTime = TimeSpan.FromMilliseconds(500)
};
var result = action.Try(() => HtmlDialogs.First(findBy));
if (result == null)
{
throw new HtmlDialogNotFoundException(findBy.ToString(), timeout);
}
return result;
}