Skip to content

Commit ddae8dc

Browse files
authored
Merge pull request #80 from LabKey/fb_labModuleGetPageText
Avoid 'JavaScriptException' from WebDriver.getPageSource
2 parents 8bb7e81 + ac8b55d commit ddae8dc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

LDK/test/src/org/labkey/test/util/external/labModules/LabModuleHelper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,9 @@ public Locator getAssayWell(String text, String color)
223223

224224
public String getPageText()
225225
{
226+
String text = _test.getHtmlSource();
226227
//the browser converts line breaks to spaces. this is a hack to get them back
227-
String text = _test.getDriver().getPageSource().replaceAll("<[^>]+>|&[^;]+;", "");
228+
text = text.replaceAll("<[^>]+>|&[^;]+;", "");
228229
text = text.replaceAll(" {2,}", " ");
229230
text = text.replaceAll(", ", ",\n").replaceAll("] ", "]\n");
230231
return text;

0 commit comments

Comments
 (0)