Beispiel #1
0
		private static Frame findFrame(FrameCollection frames, BaseConstraint findBy)
		{
			foreach (Frame frame in frames)
			{
				if (findBy.Compare(frame))
				{
					// Return
					return frame;
				}
			}

			throw new FrameNotFoundException(findBy.ConstraintToString());
		}
Beispiel #2
0
		private static string createMessage(BaseConstraint constraint)
		{
			return string.Format("The compare methode of a constraint class can't be reentered during execution of the compare. The exception occurred in an instance of '{0}' with constraint: {1}.", constraint.GetType().ToString(), constraint.ConstraintToString());
		}
Beispiel #3
0
		private static SHDocVw.InternetExplorer findInternetExplorer(BaseConstraint findBy, int timeout)
		{
			Logger.LogAction("Busy finding Internet Explorer matching constriant " + findBy.ConstraintToString());

			SimpleTimer timeoutTimer = new SimpleTimer(timeout);

			do
			{
				Thread.Sleep(500);

				SHDocVw.InternetExplorer internetExplorer = findInternetExplorer(findBy);

				if (internetExplorer != null)
				{
					return internetExplorer;
				}
			} while (!timeoutTimer.Elapsed);

			return null;
		}
Beispiel #4
0
		private static IE findIE(BaseConstraint findBy, int timeout, bool waitForComplete)
		{
			SHDocVw.InternetExplorer internetExplorer = findInternetExplorer(findBy, timeout);

			if (internetExplorer != null)
			{
				IE ie = new IE(internetExplorer);
                if (waitForComplete)
                {
			        ie.WaitForComplete();
			    }

				return ie;
			}

			throw new IENotFoundException(findBy.ConstraintToString(), timeout);
		}
Beispiel #5
0
		private HtmlDialog findHtmlDialog(BaseConstraint findBy, int timeout)
		{
			Logger.LogAction("Busy finding HTMLDialog matching criteria: " + findBy.ConstraintToString());

			SimpleTimer timeoutTimer = new SimpleTimer(timeout);

			do
			{
				Thread.Sleep(500);

				foreach (HtmlDialog htmlDialog in HtmlDialogs)
				{
					if (findBy.Compare(htmlDialog))
					{
						return htmlDialog;
					}
				}
			} while (!timeoutTimer.Elapsed);

			throw new HtmlDialogNotFoundException(findBy.ConstraintToString(), timeout);
		}
Beispiel #6
0
 public override string ConstraintToString()
 {
     return("Not '" + _baseConstraint.ConstraintToString() + "'");
 }