HTML5 and Selenium

2,653 views
Skip to first unread message

raghavendra kumar

unread,
May 30, 2012, 9:12:57 AM5/30/12
to seleniu...@googlegroups.com
Hi Any one have idea on Testing HTML5 applications Using Selenium.


Please send me a sample script for testing html5 apps(if you have any)

--
Raghavendra Kumar

David

unread,
May 30, 2012, 2:17:17 PM5/30/12
to Selenium Users
What specific HTML5 features will you be testing. HTML5 is not just
one thing.

On May 30, 6:12 am, raghavendra kumar <raghavkumar1...@gmail.com>
wrote:

raghavendra kumar

unread,
May 30, 2012, 2:44:39 PM5/30/12
to seleniu...@googlegroups.com, mang...@gmail.com
Testing Local Storage and Session Storage Data

>
> --
> Raghavendra Kumarhttp://rkchunduri.blogspot.com

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

David

unread,
May 30, 2012, 6:40:04 PM5/30/12
to Selenium Users
I'd be interested to know as well. However, I asked about a diff HTML5
feature (multiple file uploader) and was told Selenium (2 / WebDriver)
may not currently support (all) HTML5 features. So bear that in mind.

In my case, I found you can't automate multiple file uploader, either
that or I haven't found the write code/method to do that.

On May 30, 11:44 am, raghavendra kumar <raghavkumar1...@gmail.com>
wrote:

David

unread,
Jul 6, 2012, 5:31:11 PM7/6/12
to seleniu...@googlegroups.com, mang...@gmail.com
I just recently did some basic test with local storage. You probably can test local storage with Selenium 2 / WebDriver. You may run into issues doing so with Selenium RC since you have to go through browserbot to access local storage. With WebDriver, you get direct access to it via the DOM (e.g. window.localStorage).

More details here:


granted that site talks about it from developer point of view, but you can manipulate it same way using WebDriver's Javascript executor.


On Wednesday, May 30, 2012 11:44:39 AM UTC-7, Raghavendra Kumar wrote:
Testing Local Storage and Session Storage Data

On Wed, May 30, 2012 at 11:47 PM, David <mang...@gmail.com> wrote:
What specific HTML5 features will you be testing. HTML5 is not just
one thing.

On May 30, 6:12 am, raghavendra kumar <raghavkumar1...@gmail.com>
wrote:
> Hi Any one have idea on Testing HTML5 applications Using Selenium.
>
> Please send me a sample script for testing html5 apps(if you have any)
>
> --
> Raghavendra Kumarhttp://rkchunduri.blogspot.com

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

David

unread,
Jul 18, 2012, 1:15:16 PM7/18/12
to seleniu...@googlegroups.com, mang...@gmail.com
FYI, in case anyone was wondering, here's sample code in Java on working with local storage. The sample below uses wrapped code around WebDriver, so you'll have to figure out the pure WebDriver code to call to execute javascript. Easily ported to other language bindings.

public void removeItemFromLocalStorage(String item){
this.executeJavascript(String.format("window.localStorage.removeItem('%s');", item));
}

public boolean isItemPresentInLocalStorage(String item){
if(this.executeJavascript(String.format("return window.localStorage.getItem('%s');", item)) == null)
return false;
else
return true;
}
public String getItemFromLocalStorage(String item){
return (String) this.executeJavascript(String.format("return window.localStorage.getItem('%s');", item));
}
public void setItemInLocalStorage(String item, String value){
this.executeJavascript(String.format("window.localStorage.setItem('%s','%s');", item, value));
}
public void clearLocalStorage(){
this.executeJavascript(String.format("window.localStorage.clear();"));
}

should work across most browsers per the link I mentioned earlier. Unless you're working with old browsers.

webtester

unread,
Oct 29, 2012, 6:36:23 AM10/29/12
to seleniu...@googlegroups.com, mang...@gmail.com
I made a gist for sessionStorage: https://gist.github.com/3972875

Regards,
Roy
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Sudharsan Srinivasan

unread,
Jul 28, 2014, 6:03:16 AM7/28/14
to seleniu...@googlegroups.com, mang...@gmail.com

Hi David,

I am getting WebDriver executing the above java script(this.executeJavascript(String.format("window.localStorage.clear();"));) in my project.  

Browser : Firefox 30.0
Selenium : 2.42.2

eec...@gmail.com

unread,
Sep 7, 2014, 6:58:51 PM9/7/14
to seleniu...@googlegroups.com, mang...@gmail.com
From version 2.42 of selenium you can use `webDriver.getLocalStorage()` if the driver supports it.
Reply all
Reply to author
Forward
0 new messages