{"id":521,"date":"2007-04-21T13:00:24","date_gmt":"2007-04-21T18:00:24","guid":{"rendered":"http:\/\/www.bytebot.net\/blog\/archives\/2007\/04\/21\/selenium-for-your-web-application-testing"},"modified":"2007-04-21T13:00:25","modified_gmt":"2007-04-21T18:00:25","slug":"selenium-for-your-web-application-testing","status":"publish","type":"post","link":"http:\/\/www.bytebot.net\/blog\/archives\/2007\/04\/21\/selenium-for-your-web-application-testing","title":{"rendered":"Selenium for your web application testing"},"content":{"rendered":"<p><a href=\"http:\/\/www.openqa.org\/selenium\/\">Selenium<\/a> looks cool. Sure, its slower than unit tests, but its much faster than a human. It uses the web browser itself, to get your tests going, and will test it just like how a human tests. In a continious build farm, you can have good browser compatibility testing (run it against IE on Windows, even), and it also does functional testing. <\/p>\n<p>It&#8217;s not only for Ruby, it works with Perl, Python, <a href=\"http:\/\/blog.thinkphp.de\/archives\/133-Practical-Testing-PHP-Applications-with-Selenium.html\">PHP<\/a> and so forth. Its good for regression testing, and uses JavaScript. This means its very cross-platform, and cross-browser compatible.<\/p>\n<p>How does it work with Flash? The new version of Flash apparently has JavaScript support according to Alex Chaffee, and you can actually use Selenium if need be. A member of the audience did mention that he had tried it, and its a little icky.<\/p>\n<p>When testing web apps, getting titles are important, to see what the title of the page says &#8211; do it frequently in testing, because sometimes with web apps, you don&#8217;t get a 404 error, but a 200 OK (even though the page itself says it has failed). Write your tests early. Selenium can become slow &#8211; consider refactoring, or maybe move it to unit testing. It also has a slow mode, and it might be useful for a demo of your application even (well, you can see the login, and so forth). Polling architecture, web apps will time out &#8211; a somewhat sensible timeout is about 20 seconds, even if you&#8217;re on a very slow connection &#8211; any longer, and you&#8217;re probably not generating the page and its a (timing) failure.<\/p>\n<p>Selenium doesn&#8217;t work well with testing file downloads. And on Firefox, you might need to use the Chrome extension. Cookies stay on between tests, so this can leads to tests passing when run alone, but failing when run together &#8211; solution is to eval JavaScript to clear cookies between tests. In Firefox, you can specify the name of a <a href=\"http:\/\/www.mozilla.org\/support\/firefox\/profile\">profile<\/a> and launch it in a clean browser &#8211; Selenium by default, makes a new profile by itself &#8211; this really helps as some Extensions might affect your tests. On Linux, this is <tt>firefox -ProfileManager<\/tt>.<\/p>\n<p><a href=\"http:\/\/www.peertopatent.org\/\">Peer To Patent<\/a>, a community patent review site (and it will be open source!). Its tested with Selenium, sponsored by the USPTO, and looks like something that can definitely be useful in making sure silly patents aren&#8217;t passed (when the patent officer doesn&#8217;t know there&#8217;s prior art). When asked at the SDForum Ruby on Rails gathering, how many held patents, I&#8217;d say about 15-20% of the crowd raised their hands! Impressive number, but then again, I&#8217;m sitting in the Silicon Valley, what did I expect, right?<\/p>\n<p>Continious testing architecture? Mac Mini, Parallels (Ubuntu, Windows), they use coherence mode of Parallels and IE sits and looks like a &#8220;native&#8221; application. All tests run, and the Ubuntu virtual instance is what launches everything. Testing thus happens on everything &#8211; OS X, Linux and Windows.<\/p>\n<p>Technorati Tags: <a class=\"performancingtags\" href=\"http:\/\/technorati.com\/tag\/selenium\" rel=\"tag\">selenium<\/a>, <a class=\"performancingtags\" href=\"http:\/\/technorati.com\/tag\/web%20app%20testing\" rel=\"tag\">web app testing<\/a>, <a class=\"performancingtags\" href=\"http:\/\/technorati.com\/tag\/web%20qa\" rel=\"tag\">web qa<\/a>, <a class=\"performancingtags\" href=\"http:\/\/technorati.com\/tag\/ruby\" rel=\"tag\">ruby<\/a>, <a class=\"performancingtags\" href=\"http:\/\/technorati.com\/tag\/svrc2007\" rel=\"tag\">svrc2007<\/a><\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-email\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-email sd-button share-icon\" href=\"mailto:?subject=%5BShared%20Post%5D%20Selenium%20for%20your%20web%20application%20testing&body=http%3A%2F%2Fwww.bytebot.net%2Fblog%2Farchives%2F2007%2F04%2F21%2Fselenium-for-your-web-application-testing&share=email\" target=\"_blank\" title=\"Click to email a link to a friend\" data-email-share-error-title=\"Do you have email set up?\" data-email-share-error-text=\"If you&#039;re having problems sharing via email, you might not have email set up for your browser. You may need to create a new email yourself.\" data-email-share-nonce=\"6538256163\" data-email-share-track-url=\"http:\/\/www.bytebot.net\/blog\/archives\/2007\/04\/21\/selenium-for-your-web-application-testing?share=email\"><span>Email<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-521\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2007\/04\/21\/selenium-for-your-web-application-testing?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span>Facebook<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-521\" class=\"share-linkedin sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2007\/04\/21\/selenium-for-your-web-application-testing?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\" ><span>LinkedIn<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-521\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2007\/04\/21\/selenium-for-your-web-application-testing?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span>Twitter<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Selenium looks cool. Sure, its slower than unit tests, but its much faster than a human. It uses the web browser itself, to get your tests going, and will test it just like how a human tests. In a continious build farm, you can have good browser compatibility testing (run it against IE on Windows, [&hellip;]<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-email\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-email sd-button share-icon\" href=\"mailto:?subject=%5BShared%20Post%5D%20Selenium%20for%20your%20web%20application%20testing&body=http%3A%2F%2Fwww.bytebot.net%2Fblog%2Farchives%2F2007%2F04%2F21%2Fselenium-for-your-web-application-testing&share=email\" target=\"_blank\" title=\"Click to email a link to a friend\" data-email-share-error-title=\"Do you have email set up?\" data-email-share-error-text=\"If you&#039;re having problems sharing via email, you might not have email set up for your browser. You may need to create a new email yourself.\" data-email-share-nonce=\"6538256163\" data-email-share-track-url=\"http:\/\/www.bytebot.net\/blog\/archives\/2007\/04\/21\/selenium-for-your-web-application-testing?share=email\"><span>Email<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-521\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2007\/04\/21\/selenium-for-your-web-application-testing?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span>Facebook<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-521\" class=\"share-linkedin sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2007\/04\/21\/selenium-for-your-web-application-testing?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\" ><span>LinkedIn<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-521\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2007\/04\/21\/selenium-for-your-web-application-testing?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span>Twitter<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_options":[]},"categories":[1],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4vJD-8p","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":762,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2008\/04\/04\/selenium-at-the-myoss-meetup","url_meta":{"origin":521,"position":0},"title":"Selenium at the MyOSS meetup","date":"4\/4\/2008","format":false,"excerpt":"I was at yesterday's MyOSS meetup, and the topic was on the Selenium Web Testing Framework, presented by Yuen-Chi Lian. Here are some notes, and hopefully the slides and code make it up to the website soon.- Java guy, who is a MyJUG guy- Employed by CustomWare Asia Pacific, and\u2026","rel":"","context":"In &quot;General&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":515,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2007\/04\/17\/second-annual-silicon-valley-ruby-conference","url_meta":{"origin":521,"position":1},"title":"Second Annual Silicon Valley Ruby Conference","date":"17\/4\/2007","format":false,"excerpt":"In addition to the MySQL Conference & Expo 2007, which I just registered for (yes, its not too late, register now!), I also registered for the Second Annual Silicon Valley Ruby Conference. Its at The Tech Museum in San Jose (I honestly have no idea where that is from the\u2026","rel":"","context":"In &quot;General&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3568,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2020\/04\/23\/life-with-rona-day-36","url_meta":{"origin":521,"position":2},"title":"Life with Rona &#8212; Day 36","date":"23\/4\/2020","format":false,"excerpt":"Another delayed despatch, up a little later yesterday, and had a roti telur, and later a cauliflower fried rice. I'm about 70% certain they will extend the MCO now\u2026 Ping workouts are good workout days. Malaysia's Covid-19 situation: 5532 (+50), recoveries 3,452 (+103), death toll at 93 (+1). They are\u2026","rel":"","context":"In &quot;General&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1149,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2008\/11\/13\/online-catalogue-software","url_meta":{"origin":521,"position":3},"title":"Online catalogue software?","date":"13\/11\/2008","format":false,"excerpt":"Dear Lazyweb, I was browsing FACES recently, and noticed that they had an e-magazine. Nothing fancy, you have to zoom in and out to read it, making it kind of annoying on a laptop screen (the real experience will come on the 24\" or 30\" screens maybe). What annoyed me\u2026","rel":"","context":"In &quot;General&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2189,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2011\/09\/18\/google-native-client-chrome-aboutflags","url_meta":{"origin":521,"position":4},"title":"Google Native Client &#038; Chrome about:flags","date":"18\/9\/2011","format":false,"excerpt":"I stumbled upon Google Native Client today. It looks really interesting and you can see why Google seems to be targeting their technologies for the Chrome browser first (link with regards to Dart, their future of JavaScript; quote: \"We will strongly encourage Google developers start off targeting Chrome-only whenever possible\u2026","rel":"","context":"In &quot;General&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":224,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2004\/10\/10\/observations","url_meta":{"origin":521,"position":5},"title":"Observations","date":"10\/10\/2004","format":false,"excerpt":"I've been on the nahant-beta-list for a while now and don't notice a heap of posts there, like the users you'd get on Fedora lists, or the testers on fedora-test-list. Either RHEL4-beta \"just works\", or many aren't testing it as rigorously as they are Fedora. I wonder what Red Hat's\u2026","rel":"","context":"In &quot;General&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"amp_enabled":true,"_links":{"self":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts\/521"}],"collection":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/comments?post=521"}],"version-history":[{"count":0,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts\/521\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/media?parent=521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/categories?post=521"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/tags?post=521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}