OpenKeyWord  Version: 426, Datum:
SePushButton.cs
1 #region Header
2 /*
3  ==============================================================================
4  Author: Zoltan Hrabovszki <zh@openkeyword.de>
5 
6  Copyright © 2012, 2013, 2014, 2015 IT-Beratung Hrabovszki
7  www.OpenKeyWord.de
8  ==============================================================================
9 
10  This file is part of OpenKeyWord.
11 
12  OpenKeyWord is free software: you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation, either version 3 of the License, or
15  (at your option) any later version.
16 
17  OpenKeyWord is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with OpenKeyWord. If not, see <http://www.gnu.org/licenses/>.
24 
25  Diese Datei ist Teil von OpenKeyWord.
26 
27  OpenKeyWord ist Freie Software: Sie können es unter den Bedingungen
28  der GNU General Public License, wie von der Free Software Foundation,
29  Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
30  veröffentlichten Version, weiterverbreiten und/oder modifizieren.
31 
32  OpenKeyWord wird in der Hoffnung, dass es nützlich sein wird, aber
33  OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
34  Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
35  Siehe die GNU General Public License für weitere Details.
36 
37  Sie sollten eine Kopie der GNU General Public License zusammen mit
38  OpenKeyWord erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
39 */
40 #endregion Header
41 
42 namespace OKW.GUI.Selenium
43 {
44  using System;
45  using System.Collections.Generic;
46 
47  using OKW.GUI;
48  using OKW.Log;
49 
50  using OpenQA.Selenium;
51 
61  public class SePushButton : SeAnyWin // , ILinkObj
62  {
63  #region Constructors
64 
77  public SePushButton(string fpsLocator, params OKWLocator[] fpParams)
78  : base(fpsLocator, fpParams)
79  {
80  }
81 
82  #endregion Constructors
83 
84  #region Methods
85 
86 
101  public override List<string> VerifyCaption(List<string> fplsExpectedValue)
102  {
103  MyLogger.LogFunctionStartDebug("VerifyCaption", "fplsExpectedValue", fplsExpectedValue[0]);
104 
105  List<string> lvLsReturn = new List<string>();
106  bool bOK = false;
107 
108  try
109  {
110  // GetValue_TOOLTIP als delegaten definieren
111  OKW_Wait4Value.ListStringCallBack myCallBack = this.GetCaption;
112 
113  // Nun mit dem erwarteten Sollwert und GetValue_TOOLTIP ggf. auf den Wert Warten.
114  lvLsReturn = MyWait4Value.Wait4Value(fplsExpectedValue, myCallBack);
115 
116  bOK = true;
117  }
118  finally
119  {
120  if (bOK)
121  {
122  MyLogger.LogFunctionEndDebug(lvLsReturn);
123  }
124  else
125  {
126  MyLogger.LogFunctionEndDebug();
127  }
128  }
129 
130  return lvLsReturn;
131  }
132 
147  public override List<string> LogCaption()
148  {
149  List<string> lvLsReturn = new List<string>();
150  bool bOK = false;
151 
152  try
153  {
154  MyLogger.LogFunctionStartDebug("LogCaption");
155 
156  lvLsReturn = this.GetCaption();
157 
158  bOK = true;
159  }
160  finally
161  {
162  if (bOK)
163  {
164  MyLogger.LogFunctionEndDebug(lvLsReturn);
165  }
166  else
167  {
168  MyLogger.LogFunctionEndDebug();
169  }
170  }
171 
172  return lvLsReturn;
173  }
174 
189  public override List<string> MemorizeCaption()
190  {
191  bool bOK = false;
192  List<string> lvLsReturn = null;
193 
194  try
195  {
196  MyLogger.LogFunctionStartDebug("MemorizeCaption");
197 
198  lvLsReturn = this.GetCaption();
199  bOK = true;
200  }
201  finally
202  {
203  if (bOK)
204  {
205  MyLogger.LogFunctionEndDebug(lvLsReturn);
206  }
207  else
208  {
209  MyLogger.LogFunctionEndDebug();
210  }
211  }
212 
213  return lvLsReturn;
214  }
215 
227  public override List<string> GetCaption()
228  {
229  List<string> lvLsReturn = new List<string>();
230  bool bOK = false;
231  try
232  {
233  MyLogger.LogFunctionStartDebug("GetCaption");
234 
235  // Wenn das Objekt nicht existiert mit Exception beenden...
236  if (!this.GetExists())
237  {
238  string lvsLM = this.LM.GetMessage("Common", "OKWGUIObjectNotFoundException", "GetCaption()");
239  throw new OKWGUIObjectNotFoundException(lvsLM);
240  }
241 
242  // The Attribute "value" wird als Beschriftung angezeigt...
243  lvLsReturn.Add(this.Me().GetAttribute("value"));
244  bOK = true;
245  }
246  finally
247  {
248  if (bOK)
249  {
250  MyLogger.LogFunctionEndDebug(lvLsReturn);
251  }
252  else
253  {
254  MyLogger.LogFunctionEndDebug();
255  }
256  }
257 
258  return lvLsReturn;
259  }
260 
261  #endregion Methods
262  }
263 }
delegate List< string > ListStringCallBack()
Callback Muster string Variante.
Diese Ausnahme wird ausgelöst, wenn ein GUI-Objekt zu den im Frame gegebenen Objekterkennungseigensch...
override List< string > GetCaption()
Ermittelt den textuellen Inhalt der Caption/Überschrift des Objektes.
OKW_Wait4Value ist die zetrale Klasse, die für das Warten auf GUI eigenschaften zuständig ist...
SePushButton(string fpsLocator, params OKWLocator[] fpParams)
Definition: SePushButton.cs:77
override List< string > VerifyCaption(List< string > fplsExpectedValue)
Ermittelt den textuellen Inhalt des ToolTips für Prüfewert.
Description of OKWLocator.
Definition: OKWLocator.cs:52
override List< string > LogCaption()
Ermittelt den textuellen Inhalt der Beschriftung (Caption).
override List< string > MemorizeCaption()
Ermittelt den textuellen Inhalt des Caption/Überschrift für das Schlüsselwort MerkeWert.
Definition: Core.cs:40