I want to clear session Storage value in HTML5?

I have created the following custom Keyword and calling in test case:

public class CleanSession

{

@Keyword

public String CleanCache()

{

WebDriver driver = DriverFactory.getWebDriver();

LocalStorage local =((WebStorage)driver).getSessionStorage().clear()

}

}

Getting Following error:

01-22-2018 03:16:59 PM - [ERROR] - Cannot cast object ‘CInternetExplorerDriver: internet explorer on WINDOWS (c0f0e132-d574-48c3-a339-9180555b0e33)’ with class ‘com.kms.katalon.selenium.driver.CInternetExplorerDriver’ to class ‘org.openqa.selenium.html5.WebStorage’

01-22-2018 03:16:59 PM - [ERROR] - Test Cases/01_UserManagement/Login FAILED because (of) org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object ‘CInternetExplorerDriver: internet explorer on WINDOWS (c0f0e132-d574-48c3-a339-9180555b0e33)’ with class ‘com.kms.katalon.selenium.driver.CInternetExplorerDriver’ to class ‘org.openqa.selenium.html5.WebStorage’

Please let me know how to use this?

1 Like