
|
If you were logged in you would be able to see more operations.
|
|
|
|
Original Estimate:
|
0.08h
|
Remaining Estimate:
|
0.08h
|
Time Spent:
|
Unknown
|
|
Environment:
|
windows XP
|
|
|
getString parses too much sometimes, the result of a command may be simply "OK", in which case removing the first 3 characters is impossible and creates an error
I ran into this from the getEval() function and needed to add a no-op to the end of my javascript to get around it
public String doCommand(String commandName, String[] args) {
DefaultSeleneseCommand command = new DefaultSeleneseCommand(commandName,args);
String result = executeCommandOnServlet(command.getCommandURLString());
if (result == null) {
throw new NullPointerException("Selenium Bug! result must not be null");
}
if (!result.startsWith("OK")) { //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
throw new SeleniumException(result);
}
return result;
}
public String getString(String commandName, String[] args) {
return doCommand(commandName, args).substring(3); // skip "OK," //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
}
please, getString() to something like this:
public String getString(String commandName, String[] args) {
String result = doCommand(commandName, args);
return result.length() >= 3 ? result.substring(3) : " "; // skip "OK," or "OK"
}
|
|
Description
|
getString parses too much sometimes, the result of a command may be simply "OK", in which case removing the first 3 characters is impossible and creates an error
I ran into this from the getEval() function and needed to add a no-op to the end of my javascript to get around it
public String doCommand(String commandName, String[] args) {
DefaultSeleneseCommand command = new DefaultSeleneseCommand(commandName,args);
String result = executeCommandOnServlet(command.getCommandURLString());
if (result == null) {
throw new NullPointerException("Selenium Bug! result must not be null");
}
if (!result.startsWith("OK")) { //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
throw new SeleniumException(result);
}
return result;
}
public String getString(String commandName, String[] args) {
return doCommand(commandName, args).substring(3); // skip "OK," //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
}
please, getString() to something like this:
public String getString(String commandName, String[] args) {
String result = doCommand(commandName, args);
return result.length() >= 3 ? result.substring(3) : " "; // skip "OK," or "OK"
}
|
Show » |
|