com.ibm.team.fvt.tests.utils
Class ByUtils

java.lang.Object
  extended by com.ibm.team.fvt.tests.utils.ByUtils

public class ByUtils
extends java.lang.Object

Utility class to create By locator mechanism.


Nested Class Summary
static class ByUtils.ComparisonPattern
          Comparison pattern.
 
Field Summary
static int CONTAINS_PATTERN
          Deprecated. 
static int ENDS_WITH_PATTERN
          Deprecated. 
static int EQUALS_PATTERN
          Deprecated. 
static int STARTS_WITH_PATTERN
          Deprecated. 
 
Constructor Summary
ByUtils()
           
 
Method Summary
static java.lang.String xpathCompareWithText(ByUtils.ComparisonPattern pattern, java.lang.String text, boolean isClmResource)
          Return a xpath string to compare the given text using the given pattern.
static java.lang.String xpathCompareWithText(int pattern, java.lang.String text, boolean isClmResource)
          Deprecated. Since 5.0.1, use xpathCompareWithText(ComparisonPattern, String, boolean) instead
static org.openqa.selenium.By xpathMatchingItemText(java.lang.String xpathPrefix, ByUtils.ComparisonPattern pattern, java.lang.String text)
          Return a xpath to match the given text using the given pattern.
static org.openqa.selenium.By xpathMatchingItemText(java.lang.String xpathPrefix, int pattern, java.lang.String text)
          Deprecated. Since 5.0.1, use xpathMatchingItemText(String, ComparisonPattern, String) instead
static org.openqa.selenium.By xpathMatchingItemText(java.lang.String xpathPrefix, java.lang.String text)
          Return a xpath to match the given text using the given pattern.
static org.openqa.selenium.By xpathMatchingText(ByUtils.ComparisonPattern pattern, java.lang.String text)
          Return a xpath to match the given text using the given pattern.
static org.openqa.selenium.By xpathMatchingText(int pattern, java.lang.String text)
          Deprecated. Since 5.0.1, use xpathMatchingItemText(String, String) instead
static org.openqa.selenium.By xpathMatchingTexts(ByUtils.ComparisonPattern pattern, boolean all, java.lang.String... texts)
          Return a xpath to match the given texts using the given pattern.
static org.openqa.selenium.By xpathMatchingTexts(int pattern, boolean all, java.lang.String... texts)
          Deprecated. Since 5.0.1, use xpathMatchingTexts(ComparisonPattern, boolean, String...) instead
static java.lang.String xpathStringForTextComparison(ByUtils.ComparisonPattern pattern, java.lang.String text)
          Return a xpath string to compare the given text using the given pattern.
static java.lang.String xpathStringForTextComparison(int pattern, java.lang.String text)
          Deprecated. Since 5.0.1, use xpathStringForTextComparison(ComparisonPattern, String) instead
static org.openqa.selenium.By xpathToSetWorkItemCategory(java.lang.String[] categoryLevels)
          Returns the xpath to find the given category levels in a work item Filed Against options list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EQUALS_PATTERN

@Deprecated
public static final int EQUALS_PATTERN
Deprecated. 
Comparison pattern value.

The patterns are bitwise, hence they can be combined. In that case, an OR applies with all the specified patterns.

For example, if you wan to compare either equals or starts-with, then use:
EQUALS_PATTERN | STARTS_WITH_PATTERN

See Also:
Constant Field Values

STARTS_WITH_PATTERN

@Deprecated
public static final int STARTS_WITH_PATTERN
Deprecated. 
See Also:
Constant Field Values

ENDS_WITH_PATTERN

@Deprecated
public static final int ENDS_WITH_PATTERN
Deprecated. 
See Also:
Constant Field Values

CONTAINS_PATTERN

@Deprecated
public static final int CONTAINS_PATTERN
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

ByUtils

public ByUtils()
Method Detail

xpathCompareWithText

public static java.lang.String xpathCompareWithText(ByUtils.ComparisonPattern pattern,
                                                    java.lang.String text,
                                                    boolean isClmResource)
Return a xpath string to compare the given text using the given pattern.

Special addition is done to the xpath string if the comparison is done for a CLM resource.

Parameters:
pattern - The pattern used for matching text.
text - The text to compare with
isClmResource - Tells whether the text comparison concerns a CLM resource or not

xpathCompareWithText

@Deprecated
public static java.lang.String xpathCompareWithText(int pattern,
                                                               java.lang.String text,
                                                               boolean isClmResource)
Deprecated. Since 5.0.1, use xpathCompareWithText(ComparisonPattern, String, boolean) instead

Return a xpath string to compare the given text using the given pattern.

Special addition is done to the xpath string if the comparison is done for a CLM resource.

Parameters:
pattern - The pattern used for matching text. Currently supported are: WARNING: These bits cannot be combined for this method.
text - The text to compare with
isClmResource - Tells whether the text comparison concerns a CLM resource or not

xpathMatchingItemText

public static org.openqa.selenium.By xpathMatchingItemText(java.lang.String xpathPrefix,
                                                           ByUtils.ComparisonPattern pattern,
                                                           java.lang.String text)
Return a xpath to match the given text using the given pattern.

Parameters:
pattern - The pattern used for matching text.
text - The text to match
Returns:
The xpath as a By.

xpathMatchingItemText

@Deprecated
public static org.openqa.selenium.By xpathMatchingItemText(java.lang.String xpathPrefix,
                                                                      int pattern,
                                                                      java.lang.String text)
Deprecated. Since 5.0.1, use xpathMatchingItemText(String, ComparisonPattern, String) instead

Return a xpath to match the given text using the given pattern.

Parameters:
pattern - The pattern used for matching text. Currently supported are: WARNING: These bits cannot be combined for this method.
text - The text to match
Returns:
The xpath as a By.

xpathMatchingItemText

public static org.openqa.selenium.By xpathMatchingItemText(java.lang.String xpathPrefix,
                                                           java.lang.String text)
Return a xpath to match the given text using the given pattern.

Parameters:
text - The text to match
Returns:
The xpath as a By.

xpathMatchingText

public static org.openqa.selenium.By xpathMatchingText(ByUtils.ComparisonPattern pattern,
                                                       java.lang.String text)
Return a xpath to match the given text using the given pattern.

Parameters:
pattern - The pattern used for matching text.
text - The text to match
Returns:
The xpath as a By.

xpathMatchingText

@Deprecated
public static org.openqa.selenium.By xpathMatchingText(int pattern,
                                                                  java.lang.String text)
Deprecated. Since 5.0.1, use xpathMatchingItemText(String, String) instead

Return a xpath to match the given text using the given pattern.

Parameters:
pattern - The pattern used for matching text. Currently supported are: WARNING: These bits cannot be combined for this method.
text - The text to match
Returns:
The xpath as a By.

xpathMatchingTexts

public static org.openqa.selenium.By xpathMatchingTexts(ByUtils.ComparisonPattern pattern,
                                                        boolean all,
                                                        java.lang.String... texts)
Return a xpath to match the given texts using the given pattern.

Note that if there are several texts provided, one can specify whether all of them must match or only one is enough.

Parameters:
pattern - The pattern used for matching text.
all - Tells whether all texts must match or only one is enough. Ignored if only one text is given.
texts - The list of texts to match
Returns:
The xpath as a By.

xpathMatchingTexts

@Deprecated
public static org.openqa.selenium.By xpathMatchingTexts(int pattern,
                                                                   boolean all,
                                                                   java.lang.String... texts)
Deprecated. Since 5.0.1, use xpathMatchingTexts(ComparisonPattern, boolean, String...) instead

Return a xpath to match the given texts using the given pattern.

Note that if there are several texts provided, one can specify whether all of them must match or only one is enough.

Parameters:
pattern - The pattern used for matching text. Currently supported are: WARNING: These bits cannot be combined for this method.
all - Tells whether all texts must match or only one is enough. Ignored if only one text is given.
texts - The list of texts to match
Returns:
The xpath as a By.

xpathStringForTextComparison

public static java.lang.String xpathStringForTextComparison(ByUtils.ComparisonPattern pattern,
                                                            java.lang.String text)
Return a xpath string to compare the given text using the given pattern.

Parameters:
pattern - The pattern used for matching text.
text - The text to compare with

xpathStringForTextComparison

@Deprecated
public static java.lang.String xpathStringForTextComparison(int pattern,
                                                                       java.lang.String text)
Deprecated. Since 5.0.1, use xpathStringForTextComparison(ComparisonPattern, String) instead

Return a xpath string to compare the given text using the given pattern.

Parameters:
pattern - The pattern used for matching text. Currently supported are: WARNING: These bits cannot be combined for this method.
text - The text to compare with

xpathToSetWorkItemCategory

public static org.openqa.selenium.By xpathToSetWorkItemCategory(java.lang.String[] categoryLevels)
Returns the xpath to find the given category levels in a work item Filed Against options list.

Parameters:
categoryLevels - The category levels