Skip to main content
put entire post into code block
Source Link
Kate Paulk
  • 31.5k
  • 8
  • 55
  • 109

String source = "[[FirefoxDriver: firefox on WINDOWS (4520a9a1-c58b-4b34-ae3e-48613e6e7005)] -> xpath: //div[@class='page-title category-title']]";

//Split your Source from "->" String[] temp = source.split("-> ");

//Split your Source from ": " String[] temp2 = temp[1].split(": ");

//Access first index to get locator name String locator = temp2[0];

//Access Second index to get locator value String value = temp2[1].substring(0,temp2[1].length()-1);

String source = "[[FirefoxDriver: firefox on WINDOWS (4520a9a1-c58b-4b34-ae3e-48613e6e7005)] -> xpath: //div[@class='page-title category-title']]";

//Split your Source from "->"
String[] temp = source.split("-> ");

//Split your Source from ": "
String[] temp2 = temp[1].split(": ");

//Access first index to get locator name
String locator = temp2[0];

//Access Second index to get locator value
String value = temp2[1].substring(0,temp2[1].length()-1);

String source = "[[FirefoxDriver: firefox on WINDOWS (4520a9a1-c58b-4b34-ae3e-48613e6e7005)] -> xpath: //div[@class='page-title category-title']]";

//Split your Source from "->" String[] temp = source.split("-> ");

//Split your Source from ": " String[] temp2 = temp[1].split(": ");

//Access first index to get locator name String locator = temp2[0];

//Access Second index to get locator value String value = temp2[1].substring(0,temp2[1].length()-1);

String source = "[[FirefoxDriver: firefox on WINDOWS (4520a9a1-c58b-4b34-ae3e-48613e6e7005)] -> xpath: //div[@class='page-title category-title']]";

//Split your Source from "->"
String[] temp = source.split("-> ");

//Split your Source from ": "
String[] temp2 = temp[1].split(": ");

//Access first index to get locator name
String locator = temp2[0];

//Access Second index to get locator value
String value = temp2[1].substring(0,temp2[1].length()-1);
Source Link

String source = "[[FirefoxDriver: firefox on WINDOWS (4520a9a1-c58b-4b34-ae3e-48613e6e7005)] -> xpath: //div[@class='page-title category-title']]";

//Split your Source from "->" String[] temp = source.split("-> ");

//Split your Source from ": " String[] temp2 = temp[1].split(": ");

//Access first index to get locator name String locator = temp2[0];

//Access Second index to get locator value String value = temp2[1].substring(0,temp2[1].length()-1);