OKWLocatorXPath extends OKWLocator { @Override public void setLocator( String fpsLocator, OKWLocatorBase... fpLocators ) { fourTestLocator fourTestLocator = new fourTestLocator( fpsLocator ); String myLocator = fourTestLocator.getLocator(); if ( fpsLocator.equals( myLocator ) ) { if ( fpLocators != null && fpLocators.length > 0 ) { super.setLocator( myLocator, fpLocators ); } else { super.setLocator( myLocator ); } } else { if ( fpLocators != null && fpLocators.length > 0 ) { super.setLocator( "$L1$" + myLocator, fpLocators ); } else { super.setLocator( myLocator ); } } } OKWLocatorXPath( );  OKWLocatorXPath( String fpsLocator, OKWLocatorBase... fpLocators ); @Override void setLocator( String fpsLocator, OKWLocatorBase... fpLocators );  }
@Test public void TC_setLocator_2in1_Multiple() { OKWLocatorXPath Locator_1 = new OKWLocatorXPath("L1"); OKWLocatorXPath Locator_2 = new OKWLocatorXPath("L2"); OKWLocatorXPath Locator = new OKWLocatorXPath("Empty"); Locator.setLocator( "L2=$L2$, L1=$L1$, L2=$L2$, L1=$L1$", Locator_1, Locator_2); assertEquals("L2=L2, L1=L1, L2=L2, L1=L1", Locator.getLocator()); }
@Test public void TC_setLocator_2in1_ReverseOrder() { OKWLocatorXPath Locator_1 = new OKWLocatorXPath(">Locator1<"); OKWLocatorXPath Locator_2 = new OKWLocatorXPath(">Locator2<"); OKWLocatorXPath Locator_Summe = new OKWLocatorXPath("Locator2=$L2$ Locator_Summe.setLocator( "Locator2=$L2$ assertEquals("Locator2=>Locator2< }
@Test public void TC_setLocator_2in1() { OKWLocatorXPath Locator_1 = new OKWLocatorXPath(">Locator1<"); OKWLocatorXPath Locator_2 = new OKWLocatorXPath(">Locator2<"); OKWLocatorXPath Locator_Summe = new OKWLocatorXPath("Empty"); Locator_Summe.setLocator( "Locator1=$L1$ assertEquals("Locator1=>Locator1< }
@Test public void TC_Window_setLocator() { OKWLocatorXPath Locator_1 = new OKWLocatorXPath(""); Locator_1.setLocator( ">Locator1<"); assertEquals(">Locator1<", Locator_1.getLocator()); }