OpenKeyWord  Build_ID: 457, Datum: 01.02.2020 07:45:48
Dont repeat yourself. - Do it once and only once!
OKWLocatorXPath.java
1 package okw.gui;
2 
3 import okw.fourTestLocator;
4 
5 public class OKWLocatorXPath extends OKWLocator
6 {
7 
8  public OKWLocatorXPath( )
9  {
10  super( ) ;
11  }
12 
13  public OKWLocatorXPath( String fpsLocator, OKWLocatorBase... fpLocators )
14  {
15  super( fpsLocator, fpLocators ) ;
16  }
17 
18 
40  @Override
41  public void setLocator( String fpsLocator, OKWLocatorBase... fpLocators )
42  {
44 
45 
46  String myLocator = fourTestLocator.getLocator();
47 
48  // Enthält xpath oder ein 4Test-Präfix?
49  if ( fpsLocator.equals( myLocator ) )
50  {
51  // Ja es ist ein normaler XPath
52  if ( fpLocators != null && fpLocators.length > 0 )
53  {
54  super.setLocator( myLocator, fpLocators );
55  }
56  else
57  {
58  super.setLocator( myLocator );
59  }
60  }
61  else
62  {
63  if ( fpLocators != null && fpLocators.length > 0 )
64  {
65  super.setLocator( "$L1$" + myLocator, fpLocators );
66  }
67  else
68  {
69  super.setLocator( myLocator );
70  }
71  }
72  }
73 
74 }
okw.gui.OKWLocatorBase
Definition: OKWLocatorBase.java:3
okw.gui.OKWLocatorXPath
Definition: OKWLocatorXPath.java:5
okw.fourTestLocator
Definition: fourTestLocator.java:3
okw.gui.OKWLocator
Definition: OKWLocator.java:104
okw.gui.OKWLocatorXPath.setLocator
void setLocator(String fpsLocator, OKWLocatorBase... fpLocators)
Konstruktor der Klasse.
Definition: OKWLocatorXPath.java:41