How to remove special chartector from URL using URLdecoder
Method for decode URL:
public String decodeParameter(String param) {
try {
return URLDecoder.decode(param, "UTF-8");
} catch (Exception e) {
return URLDecoder.decode(param);
}
}
- - Call above method to test
ex-
newUrl = driver.getCurrentUrl().
decodedURL=decodeParameter(curr);
Method for decode URL:
public String decodeParameter(String param) {
try {
return URLDecoder.decode(param, "UTF-8");
} catch (Exception e) {
return URLDecoder.decode(param);
}
}
- - Call above method to test
ex-
newUrl = driver.getCurrentUrl().
decodedURL=decodeParameter(curr);
No comments:
Post a Comment