Append query string to current URL with key value pair - way 1
Step 1 : Need to get current URL
String currentUrl = driver.getCurrentUrl();
Step2: use URI buider class to add parameters
Steps3: Split your string as key and value pair
Ex- string abcd=def then here, key is 'abcd', value is 'def'
Step4: Add current url, key and value to URI builder class
ex - driver.get(new URIBuilder(currentUrl).addParameter(key, value).toString());
Step 1 : Need to get current URL
String currentUrl = driver.getCurrentUrl();
Step2: use URI buider class to add parameters
Steps3: Split your string as key and value pair
Ex- string abcd=def then here, key is 'abcd', value is 'def'
Step4: Add current url, key and value to URI builder class
ex - driver.get(new URIBuilder(currentUrl).addParameter(key, value).toString());
No comments:
Post a Comment