<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3951612577376800728</id><updated>2011-11-27T16:43:48.853-08:00</updated><category term='ruby'/><category term='install'/><category term='flash'/><category term='screengrab'/><category term='Microsoft'/><category term='sysadmin'/><category term='flash selenium'/><category term='user-extensions'/><category term='selenium-server'/><category term='Outlook'/><category term='xp antirus 2009'/><category term='legacy system'/><category term='.Net'/><category term='feature driven development'/><category term='nant'/><category term='iexplore'/><category term='selenium'/><category term='conference'/><category term='iehta'/><category term='jar'/><category term='string'/><category term='firefox'/><category term='test'/><category term='DOM'/><category term='testng'/><category term='IFrame'/><category term='active record'/><category term='BDD'/><category term='browser'/><category term='iexploreproxy'/><category term='rails'/><category term='Kanban'/><category term='xpath'/><category term='Safari'/><category term='waitr'/><category term='windows'/><category term='non-NPObject'/><category term='Web Application'/><category term='Javascipt'/><category term='firefox 3.5'/><category term='scp'/><category term='Events'/><category term='screenshots'/><category term='database'/><category term='deploy'/><category term='xml'/><category term='selenium2'/><category term='selenium server'/><category term='mysql'/><category term='QA'/><category term='onblur'/><category term='automated test'/><category term='cucumber'/><category term='ssh'/><category term='webdriver'/><category term='Java'/><category term='WaitForCondition'/><category term='regex'/><category term='rspec'/><category term='Javascripts'/><category term='Agile'/><category term='wireless'/><category term='link_to'/><category term='html'/><category term='pattern'/><category term='IE'/><category term='microphone'/><category term='Internet Explorer'/><category term='watir'/><category term='ubuntu'/><category term='testing'/><category term='selenium rc'/><category term='Meeting'/><title type='text'>Learn something new each day</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-2349225315360777715</id><published>2011-04-11T08:43:00.000-07:00</published><updated>2011-04-11T08:43:29.607-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='conference'/><category scheme='http://www.blogger.com/atom/ns#' term='webdriver'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium2'/><category scheme='http://www.blogger.com/atom/ns#' term='automated test'/><title type='text'>My notes from the selenium conference 2011</title><content type='html'>I had the opportunity to attend the selenium conference and loads of good stuff, i must tell you. This post is an attempt to highlight the conference talks/ seminar that i really enjoyed.&lt;br /&gt;&lt;br /&gt;1. Page Object 101: This was a workshop delivered by &lt;a href="http://patrickwilsonwelsh.com/"&gt;Patrick Wilson Welsh&lt;/a&gt; and &lt;a href="http://adam.goucher.ca/"&gt;Adam Goucher&lt;/a&gt;. Even though I have done a lot of page objects in the past, at a glance i like the way patrick has approached html elements, (wraping each html elements in a class), it feels like writing selenium code in a watir way. &lt;br /&gt;&lt;br /&gt;The full source code of Patrick's work be found here:&lt;br /&gt;&lt;br /&gt;https://github.com/PillarTechnology/SeleniumPatterns/tree/master/selenium-rc-patterns&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I hope to have a closer look, and learn one or two things to do page object better in the future. Note that Patrick's work has been done in selenium 1.&lt;br /&gt;&lt;br /&gt;2. There were a number of talks about what Selenium 2 bring to the testing table. I noted a few things from several workshops and presentations.&lt;br /&gt;&lt;br /&gt;- Generally Simon Stewart claims that Selenium 2 is much more faster than Selenium 1. This should be evident i believe from some example i hope to explain below.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Locating Elements by XPaths&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;- If i have the followin  code snippet in selenium 1:&lt;br /&gt;&lt;blockquote&gt;selenium.click("//div[@id = 'some_id']//*[@class = 'some_class']");&lt;/blockquote&gt;&lt;br /&gt;This would be written as:&lt;br /&gt;&lt;blockquote&gt;driver.findElement(By.id('some_id')).findElement(By.className('some_class')).click;&lt;/blockquote&gt;&lt;br /&gt;From the example above, this eliminates the need for the use of xPath and as a result would increase the speed of such tests.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Waiting For Elements to Appear&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In selenium 1, if you use the Wait class you would do &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;new Wait("Couldn't find close button!") {&lt;br /&gt;    boolean until() {&lt;br /&gt;        return selenium.isElementPresent("button_Close");&lt;br /&gt;    }&lt;br /&gt;};&lt;br /&gt;&lt;/blockquote&gt;In the code snippet about, the test would spend have some time to wait for the element to appear, and then you would something like:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;selenium.click("button_Close");&lt;/blockquote&gt;&lt;br /&gt;In selenium 2, this would be replaced with &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;WebElement close_button = new WebDriverwait(driver, 10).until() {&lt;br /&gt;      driver.findElement(By.id('button_Close'));&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;close_button.click();&lt;/blockquote&gt;&lt;br /&gt;The difference is that the 'until' methods of the WebDriverWait class waits until the condition evaluates to a value that is neither null nor false. So this means it would return any object be it boolean or a WebElement object.&lt;br /&gt;NB: note that the code is for illustration, you might need to tweak for it to work properly.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Sleeps&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In the talk by Dante Briones, I can remember a section in which he talked about the dangers of using sleeps in tests and I loved his suggestions of wrapping Thread.sleep() in an appropriately named methods such as:&lt;br /&gt;&lt;br /&gt;couldNotDoTheNeccessaryHardWorkAsIWasLazy();&lt;br /&gt;&lt;br /&gt;I think the morale of the story is that using sleep in your tests is evil.&lt;br /&gt;Nice :)&lt;br /&gt;&lt;br /&gt;3. There were also several sessions around Web Performance testing and this was more educating for me as i learnt a few things that i hope to explore in great depths in the future&lt;br /&gt; - I learnt about the &lt;a href="http://proxy.browsermob.com/"&gt;BrowserMob proxy&lt;/a&gt; which can be used as a DesiredCapability in association with Firefox2. These can also be used for blacklisting/whitelisting urls, redirecting urls, setting internet speed and many other uses.  &lt;br /&gt;&lt;br /&gt;- Also learnt that we can do similar things with the &lt;a href="http://fiddler.wikidot.com/fiddlercore"&gt;FiddlerCore Api&lt;/a&gt; but this would only work on .Net platforms. &lt;br /&gt;&lt;br /&gt;- There was also a slide about platform specific tools that can be used to capture performance metrics. &lt;a href="http://www.tcpdump.org/"&gt;Tcpdump&lt;/a&gt; for windows platforms and &lt;a href="http://www.tcpdump.org/"&gt;PCap&lt;/a&gt; for linux/ Unix platforms.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;its always nice to know about more tools that would make me a better technical tester and i hope to explore these tools in depth at a future date.&lt;br /&gt;&lt;br /&gt;4. At the end of the conference, Simon Stewart took a few of us through the selenium source code and he was talking about how to build the source. I can guarantee that it would have been impossible to build the source without someone holding your hand (not literarily). I learnt that the build scripts is based on rake, but the guys have a build grammar called '&lt;a href="http://code.google.com/p/crazy-fun/"&gt;crazy-fun&lt;/a&gt;'.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As i use selenium more and more, i am hoping to be able to contribute to this wonderful tools, but i still have a lot of personal work to do in other to understand all that simon said at that talk.&lt;br /&gt;&lt;br /&gt;There were loads of other talks at the conference and as soon as the source code / slides / videos are posted. I would update this post with some more links.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Enjoy!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-2349225315360777715?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/2349225315360777715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=2349225315360777715' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/2349225315360777715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/2349225315360777715'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2011/04/my-notes-from-selenium-conference-2011.html' title='My notes from the selenium conference 2011'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-1932100572482560046</id><published>2010-12-22T03:27:00.000-08:00</published><updated>2010-12-22T03:48:40.330-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='link_to'/><title type='text'>Rails3 'link_to' displays literal HTML on front end</title><content type='html'>In the last month, I have been working on a rails3 app and I ran across this interesting problem where I need to create a href link to a another page from my current page.&lt;br /&gt;&lt;br /&gt;In my view i have written &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;%= "Please click on this link #{link_to('here', new_house_path)}" %&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;And interestingly this is displayed as &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Please click on this link &amp;lt;a href="http://localhost:3000/houses/new"&amp;gt;here&amp;lt;/a&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;on the front end.&lt;br /&gt;&lt;br /&gt;Hours of frustration and google searches leads me to doing this: &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;%= ("Please click on this link #{link_to('here', new_house_path)}").html_safe %&amp;gt;;&lt;/blockquote&gt;&lt;br /&gt;which then is displayed correctly on front end&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Please click on this link &lt;a href="http://houses/new"&gt;here&lt;/a&gt;&lt;/blockquote&gt;&lt;br /&gt;if that isnt clear enough, the trick is you need to wrap the string with a '&lt;a href="http://yehudakatz.com/2010/02/01/safebuffers-and-rails-3-0/"&gt;html_safe&lt;/a&gt;' method&lt;br /&gt;&lt;br /&gt;Off i go to learn more stuff .....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-1932100572482560046?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/1932100572482560046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=1932100572482560046' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/1932100572482560046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/1932100572482560046'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2010/12/rails3-linkto-displays-literal-html-on.html' title='Rails3 &apos;link_to&apos; displays literal HTML on front end'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-1683306014137216242</id><published>2010-10-12T15:28:00.000-07:00</published><updated>2010-10-12T15:28:06.894-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='install'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><title type='text'>Installing mysql on snow leopard</title><content type='html'>I have always struggled with install mysql on my snow leopard, as a result i have decided to keep a link on this blog for this:&lt;br /&gt;&lt;br /&gt;http://www.icoretech.org/2009/08/install-mysql-and-mysql-ruby-gem-on-snow-leopard-64-bit/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hopefully that link would be up for a very long time and i hope it is useful for someone else as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-1683306014137216242?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/1683306014137216242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=1683306014137216242' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/1683306014137216242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/1683306014137216242'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2010/10/installing-mysql-on-snow-leopard.html' title='Installing mysql on snow leopard'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-2369251717450366310</id><published>2010-09-03T07:55:00.000-07:00</published><updated>2010-09-03T07:57:03.281-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='waitr'/><category scheme='http://www.blogger.com/atom/ns#' term='BDD'/><category scheme='http://www.blogger.com/atom/ns#' term='cucumber'/><category scheme='http://www.blogger.com/atom/ns#' term='Kanban'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='automated test'/><title type='text'>A tester's reflection on kanban plus BDD</title><content type='html'>&lt;div&gt;So i have just finished an engagement with a client where the development process used include &lt;/div&gt;&lt;div&gt;kanban and BDD. Kanban for us meant that we  give priority to work on the right side of the board.&lt;/div&gt;&lt;div&gt;So as a tester, I would rather spent my time doing some manual testing on a story that is in the QA queue, than writing automated acceptance tests for a stroy in the queue for Accetance Tests.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Maybe it would be worth while to draw a representation of the way in which work flows through our kanban board&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Analyis &gt; Queue &gt; Accetance Tests in Progress &gt; Queue &gt; Dev in progress &gt; Queue &gt; QA in progress &gt; Smoke Test &gt; Queue &gt; UAT Deployment in progress &gt; Queue &gt; UAT in progress &gt; Queue &gt; Live Deployment in Progress &gt; Deployed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The good thing is that everyone in the team has a visibility of work up till deployment. For more  information, read up &lt;a href="http://www.limitedwipsociety.org/"&gt;kanban&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The BDD framework used was Cucumber + Watir + Rspec, and developers would only start developing software when the tests have been written for the acceptance criteria. (Acceptance criteria is written by Analysts in a text editor in the cucumber format). The acceptance tests is jointly owned by developers and testers. If as a tester i am busy doing some other tasks further down in the work flow, the developers were happy to write the failing automated test for the acceptance criteria before development commences.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As a result of these good practices:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. The team was always in good spirit and which improves the effectiveness&lt;/div&gt;&lt;div&gt;2. The number of defects raised was low, this was achievable because for a developer to move a story to the QA queue, the automated acceptance criteria must have been passing.&lt;/div&gt;&lt;div&gt;3. There wasnt a defect management system because testing is carried as close to the development time, and if the business believes the defect is critical to the functionality, the functionality of story does not progress further in the kanban board, but it is blocked until fixed and verified.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One downside is that because we wrote acceptance test for virtually every functionality that is testable, the acceptance test grew so quick that the time taken increased from about 20mins to about 1.40mins and this time kept growing. A side defect of this is that feedback time increased and as a result developers would not run the complete test suite before checking their code in. This was however managed by doing some exploratory manual testing around the functionality being developed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;All in all, it was a good experience for me and i just hope i get to work on more projects such as this.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-2369251717450366310?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/2369251717450366310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=2369251717450366310' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/2369251717450366310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/2369251717450366310'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2010/09/testers-reflection-on-kanban-plus-bdd.html' title='A tester&apos;s reflection on kanban plus BDD'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-5338667130040613134</id><published>2010-06-25T08:41:00.001-07:00</published><updated>2010-06-25T08:52:13.722-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='watir'/><category scheme='http://www.blogger.com/atom/ns#' term='automated test'/><title type='text'>Watir: Search for elements on page using multiple attributes</title><content type='html'>I ran into a situation today where i wanted to scan through a page and return a table based on the table matching 3 attributes&lt;br /&gt;&lt;br /&gt;Before:&lt;br /&gt;&lt;br /&gt;browser.tables.find do |table|&lt;br /&gt;     table.class_name == 'my_class_name' and&lt;br /&gt;     table.cell(:class, 'class_1_name').text == 'some_text_1' and&lt;br /&gt;     table.cell(:class, 'class_2_name').text == 'some_text_2'&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;This was taking about 3minutes as there were about 86tables on this page under test. I was worried but the tables on this page was gonna increase with time which meant the time for this stage of the test was bound to increase.&lt;br /&gt;&lt;br /&gt;In my search for how to search for a single table using multiple attributes:&lt;br /&gt;&lt;br /&gt;I found this:&lt;br /&gt;&lt;br /&gt;After:&lt;br /&gt;&lt;br /&gt;browser.table(:class =&gt;  'my_class_name', :text =&gt; /#{'some_text_1}/, :text =&gt; /#{'some_text_2}/)&lt;br /&gt;&lt;br /&gt;Believe it or not, i got my test time reduced to 3secs, awesome isnt it?&lt;br /&gt;&lt;br /&gt;Enjoy!!!!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-5338667130040613134?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/5338667130040613134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=5338667130040613134' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/5338667130040613134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/5338667130040613134'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2010/06/watir-search-for-elements-on-page-using.html' title='Watir: Search for elements on page using multiple attributes'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-2194888705993964936</id><published>2010-04-23T03:22:00.000-07:00</published><updated>2010-04-23T07:00:15.726-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='active record'/><category scheme='http://www.blogger.com/atom/ns#' term='legacy system'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><title type='text'>Implement 'Select column_name from table_name where condition' in Active Record</title><content type='html'>I need an array from the data contained in a particular database column based on a condition, so i get the array of &lt;a href="http://rails.rubyonrails.org/classes/ActiveRecord/Base.html"&gt;active record&lt;/a&gt; rows:&lt;br /&gt;&lt;br /&gt;array_of_rows =  TableName.find(:all, :conditions =&gt; {:column_name =&gt; ['col_data1','col_data2']})&lt;br /&gt;&lt;br /&gt;Then use the &lt;a href="http://ruby-doc.org/core/classes/Array.html#M002189"&gt;array map!&lt;/a&gt; function to replace the active record objects with the column_name value&lt;br /&gt;array_of_rows.map!{|item| item.column_name}&lt;br /&gt;&lt;br /&gt;Doing some search got me:&lt;br /&gt;&lt;br /&gt;array_of_rows = TableName .find(:all,:select=&gt;'column_name' :conditions =&gt; {:column_name =&gt; ['col_data1','col_data2']}).map(&amp;amp;:column_name)&lt;br /&gt;&lt;br /&gt;And i like this better, concise ....&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;update:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I've had to update the active record query  above by removing the :select option&lt;br /&gt;&lt;br /&gt;array_of_rows = TableName .find(:all, :conditions  =&gt; {:column_name =&gt;  ['col_data1','col_data2']}).map(&amp;amp;:column_name)&lt;br /&gt;&lt;br /&gt;This is because if i have a method&lt;br /&gt;&lt;br /&gt;def find_some_data&lt;br /&gt;       TableName .find(:all,:select=&gt;'column_name' :conditions =&gt;  {:column_name =&gt; ['col_data1','col_data2']})&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;I am able to do:&lt;br /&gt;&lt;br /&gt;find_some_data.map(&amp;amp;:column_name)&lt;br /&gt;&lt;br /&gt;but i cannot do&lt;br /&gt;&lt;br /&gt;find_some_data.map(&amp;amp;:another_column_name)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;throws:&lt;/span&gt;   missing attribute: another_column_name (ActiveRecord::MissingAttributeError)&lt;br /&gt;&lt;br /&gt;because i have only retrieved  'column_name' values from the table&lt;br /&gt;&lt;br /&gt;In other to be able to create any array composed of data from any column_name, i have&lt;br /&gt;&lt;br /&gt;def find_some_data&lt;br /&gt;       TableName .find(:all, :conditions =&gt;  {:column_name =&gt; ['col_data1','col_data2']})&lt;br /&gt;end&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-2194888705993964936?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/2194888705993964936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=2194888705993964936' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/2194888705993964936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/2194888705993964936'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2010/04/implement-select-columnname-from.html' title='Implement &apos;Select column_name from table_name where condition&apos; in Active Record'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-4524820913310112504</id><published>2010-04-06T09:29:00.000-07:00</published><updated>2010-04-06T09:36:53.355-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='active record'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>Active Record find by Column Name</title><content type='html'>In recent days been doing a lot of ruby, which means i tend to use &lt;a href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html"&gt;Active Record&lt;/a&gt; as well.&lt;br /&gt;&lt;br /&gt;I had written some scripts where i was selecting records that matched a criteria such as:&lt;br /&gt;&lt;br /&gt;@table1.table2s.select{|e| e.column_name == 1234}&lt;br /&gt;&lt;br /&gt;but as i need to sort my result and also give some more conditions to filter the data, i need alternatives to this above query and i ended up with the two lines of code below:&lt;br /&gt;&lt;br /&gt;@table1.table2s.find(:all, :conditions =&gt; {:column_name =&gt; 1234})&lt;br /&gt;@table1.table2s.find_all_by_column_name(1234)&lt;br /&gt;&lt;br /&gt;Please note that the two lines above does same thing, the second one is just a lil but shorter and more readable the the 1st one.&lt;br /&gt;&lt;br /&gt;using the second one i can now do stuff like&lt;br /&gt;&lt;br /&gt;@table1.table2s.find_all_by_column_name(1234, :order =&gt; "col_2 ASC")&lt;br /&gt;&lt;br /&gt;which would order my results based on the column that i have specified and i could have ASC - ascending and DESC - descending.&lt;br /&gt;&lt;br /&gt;I have learnt something else today .... Have you?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-4524820913310112504?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/4524820913310112504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=4524820913310112504' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/4524820913310112504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/4524820913310112504'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2010/04/active-record-find-by-column-name.html' title='Active Record find by Column Name'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-4410883198437831086</id><published>2010-03-27T06:02:00.000-07:00</published><updated>2010-03-27T06:16:50.133-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xp antirus 2009'/><category scheme='http://www.blogger.com/atom/ns#' term='sysadmin'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><title type='text'>Fixing the annoying XP Antivirus 2009 OR 2010</title><content type='html'>This is not a post directly related to my blog but i am sure there are few people out there that might be facing same issues. In the last one week i had friends whose windows machines have been infected the XP Antivirus 2010, which seems to be a clone of XP Antivirus 2009. The symptoms include that you are get annoyings popups asking you to pay for an antivirus, i hope you have exposed yourself already.&lt;br /&gt;&lt;br /&gt;There are so many ways to fix this problems.&lt;br /&gt;&lt;br /&gt;The first one is a biased solution, which is ditch your windows machine and buy a macOsx or format your machine and install ubuntu. Well i guess that wouldnt be a popular option.&lt;br /&gt;&lt;br /&gt;So i have an alternative:&lt;br /&gt;&lt;br /&gt;1. Install &lt;a href="http://www.malwarebytes.org/"&gt;Malwarebytes&lt;/a&gt;, it is quite a good tool to remove malware from your machine.&lt;br /&gt; You would notice that it would detect quite a number of malware, make sure after the full scan, you remove all the infections detected.&lt;br /&gt;&lt;br /&gt;You are also gonna notice that, .exe files would not work after you have deleted the threats discovered by Malwarebytes.&lt;br /&gt;&lt;br /&gt;2. To fix .exe files not working, follow the steps described below.&lt;br /&gt;&lt;br /&gt;Have the following text copied into a notepad :-&lt;br /&gt;&lt;br /&gt;------Start --------Do not copy this line, copy starting next line ----------------&lt;br /&gt;&lt;br /&gt;Windows Registry Editor Version 5.00&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\.exe]&lt;br /&gt;@="exefile"&lt;br /&gt;"Content Type"="application/x-msdownload"&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\.exe\PersistentHandler]&lt;br /&gt;@="{098f2470-bae0-11cd-b579-08002b30bfeb}"&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\exefile]&lt;br /&gt;@="Application"&lt;br /&gt;"EditFlags"=hex:38,07,00,00&lt;br /&gt;"TileInfo"="prop:FileDescription;Company;FileVersion"&lt;br /&gt;"InfoTip"="prop:FileDescription;Company;FileVersion;Create;Size"&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\exefile\DefaultIcon]&lt;br /&gt;@="%1"&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\exefile\shell]&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\exefile\shell\open]&lt;br /&gt;"EditFlags"=hex:00,00,00,00&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\exefile\shell\open\command]&lt;br /&gt;@="\"%1\" %*"&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\exefile\shell\runas]&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\exefile\shell\runas\command]&lt;br /&gt;@="\"%1\" %*"&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\exefile\shellex]&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\exefile\shellex\DropHandler]&lt;br /&gt;@="{86C86720-42A0-1069-A2E8-08002B30309D}"&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\exefile\shellex\PropertySheetHandlers]&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\exefile\shellex\PropertySheetHandlers\PEAnalyser]&lt;br /&gt;@="{09A63660-16F9-11d0-B1DF-004F56001CA7}"&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\exefile\shellex\PropertySheetHandlers\PifProps]&lt;br /&gt;@="{86F19A00-42A0-1069-A2E9-08002B30309D}"&lt;br /&gt;&lt;br /&gt;[HKEY_CLASSES_ROOT\exefile\shellex\PropertySheetHandlers\ShimLayer Property Page]&lt;br /&gt;@="{513D916F-2A8E-4F51-AEAB-0CBC76FB1AF8}"&lt;br /&gt;&lt;br /&gt;-----------End--------------Do not copy this line. Copy till the end of previous line------------&lt;br /&gt;&lt;br /&gt;Boot the computer in safe mode with networking&lt;br /&gt;&lt;br /&gt;- Usually by tapping F8 when the computer boots up&lt;br /&gt;&lt;br /&gt;Open My Computer, Click on tools and then folder options.&lt;br /&gt;&lt;br /&gt;Select - "Show hidden files and folders"&lt;br /&gt;              - Uncheck "Hide protected operating system files"&lt;br /&gt;&lt;br /&gt;Apply and then OK&lt;br /&gt;&lt;br /&gt;For XP :-&lt;br /&gt;&lt;br /&gt;5. Navigate to C:\Documents and Settings\%userprofile%\Local Settings\Application Data&lt;br /&gt;Look for either of the following files :-&lt;br /&gt;&lt;br /&gt;- av.exe&lt;br /&gt;- msascui.exe&lt;br /&gt;&lt;br /&gt;And delete these files .... Hopefully these should have been removed by the malwarebytes.&lt;br /&gt;&lt;br /&gt;Now open the notepad file saved on your desktop earlier&lt;br /&gt;&lt;br /&gt;Click on file-&gt; save as&lt;br /&gt;&lt;br /&gt;           - Select file type as all files&lt;br /&gt;           - Name the file as fix.reg&lt;br /&gt;           - Encoding should be Unicode&lt;br /&gt;Run that file, it will edit the registry accordingly&lt;br /&gt;&lt;br /&gt;Now restart the computer in normal mode and everything should working fine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-4410883198437831086?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/4410883198437831086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=4410883198437831086' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/4410883198437831086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/4410883198437831086'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2010/03/fixing-annoying-xp-antivirus-2009-or.html' title='Fixing the annoying XP Antivirus 2009 OR 2010'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-5383854736349290220</id><published>2010-03-10T15:44:00.000-08:00</published><updated>2010-03-10T16:12:24.290-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='rspec'/><category scheme='http://www.blogger.com/atom/ns#' term='QA'/><category scheme='http://www.blogger.com/atom/ns#' term='BDD'/><category scheme='http://www.blogger.com/atom/ns#' term='feature driven development'/><category scheme='http://www.blogger.com/atom/ns#' term='cucumber'/><category scheme='http://www.blogger.com/atom/ns#' term='watir'/><category scheme='http://www.blogger.com/atom/ns#' term='test'/><category scheme='http://www.blogger.com/atom/ns#' term='automated test'/><title type='text'>Blank cells in step tables in cucumber 0.3.11 is represented as nil</title><content type='html'>In my current job, I have been doing a lot of acceptance test using &lt;a href="http://cukes.info/"&gt;Cucumber&lt;/a&gt;, &lt;a href="http://watir.com/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Watir&lt;/span&gt;&lt;/a&gt; and &lt;a href="http://rspec.info/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;RSpec&lt;/span&gt;&lt;/a&gt;, obvious all in &lt;a href="http://www.ruby-lang.org/en/"&gt;Ruby&lt;/a&gt;. I have been using &lt;a href="http://cukes.info/"&gt;Cucumber&lt;/a&gt; 0.6.x, in which blank cells in the step table are represented by empty string (""). This was okay for me until today when i had to use a previous version of &lt;a href="http://cukes.info/"&gt;Cucumber&lt;/a&gt; 0.3.11 due to reasons including compatibility with other projects in the CI build. And my tests start failing because blank cells are represented as nil.&lt;br /&gt;&lt;br /&gt;There was f&lt;a href="https://rspec.lighthouseapp.com/projects/16211/tickets/396-nil-values-in-a-fixture-table"&gt;ix put in the current release of cucumber to change blanks to be represented &lt;/a&gt;as empty and not as nil(for whatever reason, which i don't really care, as both nil and "" has got its own arguments.)&lt;br /&gt;&lt;br /&gt;Some code to explain this, Assuming i have a step table as below:&lt;br /&gt;&lt;br /&gt;Given that i have the following detail in my app&lt;br /&gt;|Header1|Header2|Header3|Header4|&lt;br /&gt;|Body1    |Body2    |Body3    |           |&lt;br /&gt;&lt;br /&gt;Notice that the last column of the second row is blank, this would be represented as nil in cucumber 0.3.11 while it is represented as empty string "" in cucumber 0.6.x&lt;br /&gt;&lt;br /&gt;In my step definition file, I have fixed this by converting every nil value to empty ("")&lt;br /&gt;&lt;br /&gt;Given /have the following detail/ do |table|&lt;br /&gt;     table.rows.each do |row|&lt;br /&gt;            row.map! {|value| convert_nil_to_empty_string(value)}&lt;br /&gt;           # do some other stuff with row as every nil object has been converted to empty string&lt;br /&gt;           # The map! method for Array, allow you to invoke the block for the array and it amends&lt;br /&gt;           #  the &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;existing&lt;/span&gt; array    &lt;br /&gt;     end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;The method which i call to convert nil to empty is below:&lt;br /&gt;&lt;br /&gt;def convert_nil_to_empty_string(test_string)&lt;br /&gt;     if (test_string.nil?)&lt;br /&gt;         return ""&lt;br /&gt;    else&lt;br /&gt;        return test_string&lt;br /&gt;    end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;There might have been a better way to do this but this surely worked for me in this scenario and the reason i decided to use a method was that the map! method would only allow me use the variable "value" only once in the block. I am sure there are some &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;rubyist&lt;/span&gt; out there, that could advice me on some shorthand for this  .......  Hope it helps you too&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-5383854736349290220?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/5383854736349290220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=5383854736349290220' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/5383854736349290220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/5383854736349290220'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2010/03/blank-cells-in-step-tables-in-cucumber.html' title='Blank cells in step tables in cucumber 0.3.11 is represented as nil'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-8467806623253726813</id><published>2010-02-24T03:55:00.000-08:00</published><updated>2010-02-24T04:01:12.599-08:00</updated><title type='text'>selenium.open timeouts for strange reasons</title><content type='html'>Have you ever been in situations when your selenium RC test times out after the selenium.open command, the page is loaded but selenium just tells you that it has timed out after 30000ms.&lt;br /&gt;&lt;br /&gt;I had same problem in Java today when i got the selenium RC 1.0.3 and i fixed the problem by setting the selenium timeout to be "0". so i have done&lt;br /&gt;&lt;br /&gt;@BeforeClass&lt;br /&gt;   public void setUp(){&lt;br /&gt;       selenium = new DefaultSelenium("localHost", 4444, "*iexplore", url);&lt;br /&gt;       selenium.start();&lt;br /&gt;    &lt;span style="font-weight: bold;"&gt;   selenium.setTimeout("0");&lt;/span&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;and then i have used a waitForPageToLoad in each of the selenium methods that needs to wait - open, click .....&lt;br /&gt;&lt;br /&gt;       selenium.open(url);&lt;br /&gt;       &lt;span style="font-weight: bold;"&gt;selenium.waitForPageToLoad("5000");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;       selenium.click("btnG");&lt;br /&gt;       &lt;span style="font-weight: bold;"&gt;selenium.waitForPageToLoad("5000");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hopefully you find this useful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-8467806623253726813?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/8467806623253726813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=8467806623253726813' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/8467806623253726813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/8467806623253726813'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2010/02/seleniumopen-timeouts-for-strange.html' title='selenium.open timeouts for strange reasons'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-9038171144709733796</id><published>2010-01-11T13:25:00.000-08:00</published><updated>2010-01-11T13:30:13.339-08:00</updated><title type='text'>Regex for pipe "|" character</title><content type='html'>I was trying to split a string using a regex today and i had this problem&lt;br /&gt;&lt;br /&gt;my string of format&lt;br /&gt;&lt;br /&gt;A | B | C&lt;br /&gt;&lt;br /&gt;My intent was to split this string using the Regex match for "|"&lt;br /&gt;&lt;br /&gt;The regex that worked for me was "\\|" - escaping pipe and then escaping the slash the escapes the pipe&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-9038171144709733796?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/9038171144709733796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=9038171144709733796' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/9038171144709733796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/9038171144709733796'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2010/01/regex-for-pipe-character.html' title='Regex for pipe &quot;|&quot; character'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-9152146162122378383</id><published>2009-11-23T04:04:00.000-08:00</published><updated>2009-11-23T04:18:11.090-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox'/><category scheme='http://www.blogger.com/atom/ns#' term='firefox 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='non-NPObject'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><category scheme='http://www.blogger.com/atom/ns#' term='flash selenium'/><title type='text'>Workaround: Flash selenium test would not run in firefox 3.5 except when the browser mode is *firefoxProxy</title><content type='html'>I looked into &lt;a href="http://code.google.com/p/flash-selenium/"&gt;flash selenium&lt;/a&gt; a few weeks back and  i thought it was a great way for me to test certain part of the apps i have been ignoring for some time.&lt;br /&gt;&lt;br /&gt;However after knocking up a few test i discovered that my test would not run in my version of firefox (3.5). I got this error:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt; INFO - Got result: ERROR: Threw an exception: NPMethod called on non-NPObject wrapped JSObject! on session 471c65508e46457fa43f4deb873d0592&lt;/blockquote&gt;Then i read in some &lt;a href="http://code.google.com/p/flash-selenium/issues/detail?id=27"&gt;issue&lt;/a&gt; raised in the flash selenium site that flash selenium would only work in firefox 3.0 and it worked fine in IE for me.&lt;br /&gt;&lt;br /&gt;Today while i was investigating another &lt;a href="http://samadesoga.blogspot.com/2009/11/selenium-failed-to-start-browser-in.html"&gt;issue&lt;/a&gt;, i decided to try running the flashSelenium test  in the "*firefoxproxy" mode and my tests ran succcessfully.&lt;br /&gt;&lt;br /&gt;I am sure this workaround would be welcome by people facing this issue as well, please leave a comment if this is any help.&lt;br /&gt;&lt;br /&gt;Thanks&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-9152146162122378383?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/9152146162122378383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=9152146162122378383' title='20 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/9152146162122378383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/9152146162122378383'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2009/11/workaround-flash-selenium-test-would.html' title='Workaround: Flash selenium test would not run in firefox 3.5 except when the browser mode is *firefoxProxy'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>20</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-3714980921993085407</id><published>2009-11-23T03:53:00.000-08:00</published><updated>2009-11-23T04:04:11.147-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium server'/><category scheme='http://www.blogger.com/atom/ns#' term='iexploreproxy'/><category scheme='http://www.blogger.com/atom/ns#' term='test'/><category scheme='http://www.blogger.com/atom/ns#' term='iexplore'/><category scheme='http://www.blogger.com/atom/ns#' term='iehta'/><title type='text'>selenium failed to start browser in iexplore mode when selenium server is started dynamically in code</title><content type='html'>In a &lt;a href="http://samadesoga.blogspot.com/2009/11/start-selenium-server-dynamically.html"&gt;previous post&lt;/a&gt;, i have written about how i have been starting/ stoping the selenium server dynamically. What i didnt mention was that i was not able to run my tests using Internet Explorer. I got this error&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;11:56:55.272 INFO - Command request: getNewBrowserSession[*iexplore, http://localhost:8080, ] on session null&lt;br /&gt;11:56:55.272 INFO - creating new remote session&lt;br /&gt;11:56:55.381 INFO - Allocated session 688eff769c8b4751b5fb9477bba213f3 for http://localhost:8080, launching...&lt;br /&gt;11:56:55.397 ERROR - Failed to start new browser session, shutdown browser and clear all session data&lt;br /&gt;java.lang.RuntimeException: java.io.FileNotFoundException: C:\DOCUME~1\SAdesoga\LOCALS~1\Temp\customProfileDir688eff769c8b4751b5fb9477bba213f3\core\RemoteRunner.html (The system cannot find the file specified)&lt;br /&gt;    at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.createHTAFiles(HTABrowserLauncher.java:100)&lt;br /&gt;    at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.launch(HTABrowserLauncher.java:60)&lt;br /&gt;    at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.launchRemoteSession(HTABrowserLauncher.java:140)&lt;br /&gt;    at org.openqa.selenium.server.browserlaunchers.InternetExplorerLauncher.launchRemoteSession(InternetExplorerLauncher.java:77)&lt;br /&gt;    at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:357)&lt;br /&gt;    at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:122)&lt;br /&gt;    at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:84)&lt;br /&gt;    at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:712)&lt;br /&gt;    at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:393)&lt;br /&gt;    at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:364)&lt;br /&gt;    at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:125)&lt;br /&gt;    at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)&lt;br /&gt;    at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)&lt;br /&gt;    at org.mortbay.http.HttpServer.service(HttpServer.java:909)&lt;br /&gt;    at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)&lt;br /&gt;    at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)&lt;br /&gt;    at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)&lt;br /&gt;    at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)&lt;br /&gt;    at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)&lt;br /&gt;    at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)&lt;br /&gt;Caused by: java.io.FileNotFoundException: C:\DOCUME~1\SAdesoga\LOCALS~1\Temp\customProfileDir688eff769c8b4751b5fb9477bba213f3\core\RemoteRunner.html (The system cannot find the file specified)&lt;br /&gt;    at java.io.FileInputStream.open(Native Method)&lt;br /&gt;    at java.io.FileInputStream.&lt;init&gt;(Unknown Source)&lt;br /&gt;    at org.apache.tools.ant.types.resources.FileResource.getInputStream(FileResource.java:185)&lt;br /&gt;    at org.apache.tools.ant.util.ResourceUtils.copyResource(ResourceUtils.java:372)&lt;br /&gt;    at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:475)&lt;br /&gt;    at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:438)&lt;br /&gt;    at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:404)&lt;br /&gt;    at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:379)&lt;br /&gt;    at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:317)&lt;br /&gt;    at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.createHTAFiles(HTABrowserLauncher.java:97)&lt;br /&gt;    ... 19 more&lt;/blockquote&gt;This points out that selenium is trying to start in the iehta mode, even though i have specified that it start in iexplore mode. Doing i quick search i discovered that there has been &lt;a href="http://clearspace.openqa.org/message/49240"&gt;some work&lt;/a&gt; to start up selenium in iehta even when iexplore is being specified. And the only way to get the original *iexplore is to try *iexploreproxy or piiexplore&lt;br /&gt;&lt;br /&gt;So i changed my config file to start selenium using "*iexploreproxy" instead of "*iexplore" and voila i am able run my test on ie.&lt;br /&gt;&lt;br /&gt;Hope this helps you too&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-3714980921993085407?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/3714980921993085407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=3714980921993085407' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/3714980921993085407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/3714980921993085407'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2009/11/selenium-failed-to-start-browser-in.html' title='selenium failed to start browser in iexplore mode when selenium server is started dynamically in code'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-394940270037804078</id><published>2009-11-18T04:24:00.000-08:00</published><updated>2009-11-18T04:39:15.380-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='pattern'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='regex'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='test'/><category scheme='http://www.blogger.com/atom/ns#' term='string'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium'/><title type='text'>Search for a single digit within a string using regex as provided in java api</title><content type='html'>In my current work, i have been writing a lot of test in Java, which obviously means i need to learn a lot more about the Java api, which is good i think?????&lt;br /&gt;&lt;br /&gt;Well i needed to match the single digit in this string "home-area-1" and return this digit. With a quick google i found this piece of code &lt;a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Pattern p = Pattern.compile("a*b");&lt;br /&gt;Matcher m = p.matcher("aaaaab");&lt;br /&gt;boolean b = m.matches();&lt;br /&gt;System.out.println(b);&lt;br /&gt;&lt;br /&gt;A quick run of this code printed "true" which means the code works.&lt;br /&gt;&lt;br /&gt;So i wrote this:&lt;br /&gt;&lt;br /&gt;Pattern p = Pattern.compile("[1,2,3,4]");&lt;br /&gt;Matcher m = p.matcher("promo-area-3");&lt;br /&gt;System.out.println(m.group());&lt;br /&gt;&lt;br /&gt;and guess what this fails ...... giving me an "illegal state exception"&lt;br /&gt;&lt;br /&gt;Pattern p = Pattern.compile("[1,2,3,4]");&lt;br /&gt;Matcher m = p.matcher("promo-area-3");&lt;br /&gt;boolean b = m.matches();&lt;br /&gt;System.out.println(b);&lt;br /&gt;&lt;br /&gt;This returns false which suggests that matching is not working properly.&lt;br /&gt;&lt;br /&gt;After a lot of guesses and try and errors , i did&lt;br /&gt;&lt;br /&gt;Pattern p = Pattern.compile("[1,2,3,4]");&lt;br /&gt;      Matcher m = p.matcher("promo-area-3");&lt;br /&gt;     while (m.find()) {&lt;br /&gt;       System.out.println("regex stuff " + m.group());&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;My thinking is this, the first code with this pattern "Pattern.compile("a*b");" was searching for a text which the subsequent one "Pattern.compile("[1,2,3,4]")" was a search for a character within a sequence and maybe this account for the while loop with m.find ........&lt;br /&gt;&lt;br /&gt;Am not sure, maybe if anyone has a better explanation ... i would appreciate&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-394940270037804078?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/394940270037804078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=394940270037804078' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/394940270037804078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/394940270037804078'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2009/11/search-for-single-digit-within-string.html' title='Search for a single digit within a string using regex as provided in java api'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-822971421507143370</id><published>2009-11-16T07:26:00.000-08:00</published><updated>2009-11-16T08:13:09.189-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='selenium rc'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='testng'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium-server'/><title type='text'>Start the Selenium Server dynamically</title><content type='html'>I have been working on a test suite in java using testng as the testing framework. I could not have suggested any other test frame work as it allows me to do a lot of configurable setups and teardowns. Yeah am not gonna promote testng anymore, lol.&lt;br /&gt;&lt;br /&gt;I could have started using selenium server using a usual batch file that maven could call in one of its targets but i think doing it this way is cleaner.&lt;br /&gt;&lt;br /&gt;public class SeleniumManager {&lt;br /&gt;   private SeleniumServer seleniumServer;&lt;br /&gt;&lt;br /&gt;   private static Selenium selenium;&lt;br /&gt;&lt;br /&gt;   private RemoteControlConfiguration rcc;&lt;br /&gt;&lt;br /&gt;   @BeforeSuite&lt;br /&gt;   @Parameters( { "selenium.port" })&lt;br /&gt;   public void startSeleniumServer(String port) {&lt;br /&gt;&lt;br /&gt;       rcc = new RemoteControlConfiguration();&lt;br /&gt;       rcc.setPort(Integer.parseInt(port));         &lt;br /&gt;     &lt;br /&gt;       try {&lt;br /&gt;           seleniumServer = new SeleniumServer(false, rcc);&lt;br /&gt;       //    seleniumServer= new SeleniumServer();&lt;br /&gt;           seleniumServer.start();&lt;br /&gt;         &lt;br /&gt;       } catch (Exception e) {&lt;br /&gt;           throw new IllegalStateException("Can't start selenium server", e);&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   @AfterSuite(alwaysRun = true)&lt;br /&gt;   public void stopSeleniumServer() {&lt;br /&gt;       if (seleniumServer != null) {&lt;br /&gt;           seleniumServer.stop();&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public static Selenium startSelenium(String host, String port, String browser, String url) {&lt;br /&gt;       selenium = new DefaultSelenium(host, Integer.parseInt(port), browser, url);&lt;br /&gt;       selenium.start();&lt;br /&gt;       return selenium;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public static void stopSelenium(Selenium selenium) {&lt;br /&gt;       selenium.stop();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;As you can see i have a seleniumManager class which would dynamically start the selenium server before my testSuite starts and kill the SeleniumServer after the test suite is completed.&lt;br /&gt;&lt;br /&gt;Please try this out and leave comments&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-822971421507143370?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/822971421507143370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=822971421507143370' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/822971421507143370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/822971421507143370'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2009/11/start-selenium-server-dynamically.html' title='Start the Selenium Server dynamically'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-8063617915281114129</id><published>2009-11-16T07:17:00.000-08:00</published><updated>2009-11-16T08:12:27.741-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='selenium rc'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Javascipt'/><category scheme='http://www.blogger.com/atom/ns#' term='test'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium-server'/><category scheme='http://www.blogger.com/atom/ns#' term='user-extensions'/><title type='text'>Setting user extensions when the Selenium Server has been started dynamically</title><content type='html'>I hope this helps someone someday, I needed to set user extension for a selenium test suite, dynamically in the code as i was starting the &lt;a href="http://samadesoga.blogspot.com/2009/11/start-selenium-server-dynamically.html"&gt;Selenium server via same&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;public void startSeleniumServer(String port) {&lt;br /&gt;&lt;br /&gt;      rcc = new RemoteControlConfiguration();&lt;br /&gt;      rcc.setPort(Integer.parseInt(port));&lt;br /&gt;  &lt;br /&gt;   &lt;br /&gt;      try {&lt;br /&gt;          seleniumServer = new SeleniumServer(false, rcc);&lt;br /&gt;          seleniumServer.start();&lt;br /&gt;       &lt;br /&gt;      } catch (Exception e) {&lt;br /&gt;          throw new IllegalStateException("Can't start selenium server", e);&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;   public void stopSeleniumServer() {&lt;br /&gt;      if (seleniumServer != null) {&lt;br /&gt;          seleniumServer.stop();&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;i was setting the user extension file using the remoteControlConfiguration object&lt;br /&gt;&lt;br /&gt;so i had typed:&lt;br /&gt;         &lt;br /&gt;            rcc.setUserExtensions(new File({path_location_to_user_extension.js}));&lt;br /&gt;&lt;br /&gt;This didnt work and an extensive search in the api wasnt very useful.&lt;br /&gt;A colleague however found out that doing a&lt;br /&gt;&lt;br /&gt;seleniumServer.boot(); would make the user-extension file to work.&lt;br /&gt;&lt;br /&gt;Great isn't it ...........&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-8063617915281114129?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/8063617915281114129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=8063617915281114129' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/8063617915281114129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/8063617915281114129'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2009/11/setting-user-extensions-when-selenium.html' title='Setting user extensions when the Selenium Server has been started dynamically'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-3955389998685473641</id><published>2009-09-04T07:45:00.000-07:00</published><updated>2009-09-09T01:13:14.584-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='QA'/><category scheme='http://www.blogger.com/atom/ns#' term='firefox'/><category scheme='http://www.blogger.com/atom/ns#' term='jar'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Application'/><title type='text'>Selenium Remote cant start firefox session due to lock on file</title><content type='html'>I am sure you have on this page, because you have run into problem with selenium not been able to run due to a lock on some profile files. Yes, you know what the error is. I really found useful two blogs &lt;a href="http://www.lostechies.com/blogs/joshua_lockwood/archive/2008/11/13/selenium-with-firefox-3.aspx"&gt;here&lt;/a&gt; and &lt;a href="http://notetodogself.blogspot.com/2008/10/use-selenium-rc-in-firefox-3.html"&gt;here.&lt;/a&gt; However, inas much as i don not want to repeat what has been saidin the blogs i would paste and quote what i found useful and explain a little bit more.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;i&gt;&lt;/i&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;i&gt;Preparing Firefox profile...&lt;/i&gt;&lt;/p&gt; &lt;p&gt;The source of the problem is in the *.rdf files inside the selenium server jar.  The Selenium guys have  hardcoded a version ceiling for Firefox at version 2.0.0.* (in my case it was 3.5.*). The fix is really simple.&lt;/p&gt; &lt;p&gt;&lt;b&gt;Step 1: Extract the files needing change (from the directory where you have the jar). - &lt;/b&gt;&lt;br /&gt;&lt;/p&gt; &lt;pre class="twilight"&gt;jar xf selenium-server.jar customProfileDirCUSTFFCHROME/&lt;br /&gt;      extensions/readystate@openqa.org/install.rdf&lt;br /&gt;jar xf selenium-server.jar customProfileDirCUSTFFCHROME/&lt;br /&gt;      extensions/{538F0036-F358-4f84-A764-89FB437166B4}/install.rdf&lt;br /&gt;jar xf selenium-server.jar customProfileDirCUSTFFCHROME/&lt;br /&gt;      extensions/&lt;span class="Constant"&gt;\{&lt;/span&gt;503A0CD4-EDC8-489b-853B-19E0BAA8F0A4&lt;span class="Constant"&gt;\}&lt;/span&gt;/install.rdf&lt;br /&gt;jar xf selenium-server.jar customProfileDirCUSTFF/extensions/&lt;br /&gt;      readystate&lt;span class="Constant"&gt;\@&lt;/span&gt;openqa.org/install.rdf&lt;br /&gt;jar xf selenium-server.jar customProfileDirCUSTFF/extensions/&lt;br /&gt;&lt;span class="Constant"&gt;       \{&lt;/span&gt;538F0036-F358-4f84-A764-89FB437166B4&lt;span class="Constant"&gt;\}&lt;/span&gt;/install.rdf&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;&lt;b&gt;Step 2: Change the max version in the rdf (Resource Description Framework) files.&lt;/b&gt;&lt;/p&gt; &lt;p&gt;The line of interest looks like this: &lt;em:maxversion&gt;2.0.0.*&lt;/em:maxversion&gt;&lt;/p&gt; &lt;p&gt;&lt;i&gt;* you can change this to 4.*, should buy some time.&lt;/i&gt;&lt;/p&gt; &lt;p&gt;&lt;b&gt;Step 3: Update the jar with your changes.&lt;/b&gt;&lt;/p&gt; &lt;pre class="twilight"&gt;jar uf selenium-server.jar customProfileDirCUSTFFCHROME/&lt;br /&gt;      extensions/readystate@openqa.org/install.rdf&lt;br /&gt;jar uf selenium-server.jar customProfileDirCUSTFFCHROME/&lt;br /&gt;      extensions/{538F0036-F358-4f84-A764-89FB437166B4}/install.rdf&lt;br /&gt;jar uf selenium-server.jar customProfileDirCUSTFFCHROME/&lt;br /&gt;     extensions/&lt;span class="Constant"&gt;\{&lt;/span&gt;503A0CD4-EDC8-489b-853B-19E0BAA8F0A4&lt;span class="Constant"&gt;\}&lt;/span&gt;/install.rdf&lt;br /&gt;jar uf selenium-server.jar customProfileDirCUSTFF/&lt;br /&gt;     extensions/readystate&lt;span class="Constant"&gt;\@&lt;/span&gt;openqa.org/install.rdf&lt;br /&gt;jar uf selenium-server.jar customProfileDirCUSTFF/&lt;br /&gt;     extensions/&lt;span class="Constant"&gt;\{&lt;/span&gt;538F0036-F358-4f84-A764-89FB437166B4&lt;span class="Constant"&gt;\}&lt;/span&gt;/install.rdf&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;That's it, once that's changed you should be good to go for testing against Firefox 3!&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;So that was a summary of what i found, but my case was a bit different as the version of firefox that was hardcoded  in the selenium-server 1.0.1 was 3.5.* and my version of firefox was 3.5.2, so naturally i expected firefox to work for me. But as it did not work,  as a trail and error, i changed the hardcoded version to 4.5.*. and voila it worked for me.&lt;br /&gt;&lt;br /&gt;Also i did not use the jar uf command, what i did was to temporarily change the extension of the selenium server jar file to a .zip file and then i opened the zipped file created with winzip.&lt;br /&gt;&lt;br /&gt;I then extracted the 5files which i need to amended to my desktop, amended the file with a text utility and then drop the files back into the zippped selenium server file. Lastly i changed the extensions back to .jar.&lt;br /&gt;&lt;br /&gt;And it worked. i hope this works for someone as well&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-3955389998685473641?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/3955389998685473641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=3955389998685473641' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/3955389998685473641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/3955389998685473641'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2009/09/selenium-remote-cant-start-firefox.html' title='Selenium Remote cant start firefox session due to lock on file'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-7171382112746858792</id><published>2009-07-13T00:38:00.000-07:00</published><updated>2009-07-13T00:44:33.421-07:00</updated><title type='text'>css selectors in place of xpath for selenium locators</title><content type='html'>yeah so in all these year, i have always resolved to using xpath whenever i am creating selenium scripts and i need to do stuff with element that have no id. well as you would probably know, xpath executes so slow on IE.&lt;br /&gt;&lt;br /&gt;For intance i have a test suite that would run in 1hr 30mins on firefox/ safari but the same test suites would take over 4hrs to run to completion on IE.&lt;br /&gt;&lt;br /&gt;So with the help of a colleagues, i have been using css selectors from last week and i can say this has drastically improved the speed of our test and you would notice too much difference between IE and FF/Safari anymore.&lt;br /&gt;&lt;br /&gt;It takes some time to get used to but these are some link that might be useful to get start with ....&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt; A summary or cheat sheet could be found &lt;a href="http://www.princexml.com/doc/6.0/selectors/"&gt;here&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Other links are: &lt;a href="http://www.w3.org/TR/CSS2/selector.html"&gt;W3C CSS2&lt;/a&gt; and &lt;a href="http://www.w3.org/TR/2001/CR-css3-selectors-20011113/"&gt;W3C CSS3&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;Enjoy .....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-7171382112746858792?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/7171382112746858792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=7171382112746858792' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/7171382112746858792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/7171382112746858792'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2009/07/css-selectors-in-place-of-xpath-for.html' title='css selectors in place of xpath for selenium locators'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-589776665051191847</id><published>2009-04-30T12:18:00.001-07:00</published><updated>2009-04-30T12:18:52.120-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IE'/><category scheme='http://www.blogger.com/atom/ns#' term='xpath'/><category scheme='http://www.blogger.com/atom/ns#' term='Agile'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='Safari'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><title type='text'>Selenium Test execution speed on Safari vs Internet Explorer</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; "&gt;&lt;div style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; width: auto; font: normal normal normal 100%/normal Georgia, serif; text-align: left; "&gt;I have been working on a selenium test suite that contains about 150 tests.&lt;div&gt;These test would normally take about 4hrs 30&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0" style="background-color: rgb(255, 255, 0); "&gt;mins&lt;/span&gt; for it to execute to completion.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I tried to run same tests on Safari today, and it took exactly 1hr 9min. This is such a big difference &lt;/div&gt;&lt;div&gt;and i think it is because of the extreme use of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1" style="background-color: rgb(255, 255, 0); "&gt;Xpath&lt;/span&gt; in the test suite. And as it is known that&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2" style="background-color: rgb(255, 255, 0); "&gt;Xpath&lt;/span&gt; execute &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3" style="background-color: rgb(255, 255, 0); "&gt;soooo&lt;/span&gt; slow in IE.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is quite good as i have decided to run &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4" style="background-color: rgb(255, 255, 0); "&gt;intraday&lt;/span&gt; tests in safari so as to get faster feedback, cos up until now i am unable to kick off these test because a test suite that takes 4hr 30min to executes would have taken almost half of my day and does little good.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I would be writing another post that talk about how to efficiently use &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5" style="background-color: rgb(255, 255, 0); "&gt;Xpath&lt;/span&gt; in your tests whenever you need to ......&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Any comments ............&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-589776665051191847?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/589776665051191847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=589776665051191847' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/589776665051191847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/589776665051191847'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2009/04/selenium-test-execution-speed-on-safari.html' title='Selenium Test execution speed on Safari vs Internet Explorer'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-2801076583879058662</id><published>2009-03-04T07:03:00.000-08:00</published><updated>2009-03-04T07:32:28.677-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Meeting'/><category scheme='http://www.blogger.com/atom/ns#' term='Outlook'/><category scheme='http://www.blogger.com/atom/ns#' term='Agile'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Not able to accept meetings in Outlook</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_RIhwOK2k5D8/Sa6fAJUAvCI/AAAAAAAAA60/HKATNzjKU2o/s1600-h/error.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 80px;" src="http://1.bp.blogspot.com/_RIhwOK2k5D8/Sa6fAJUAvCI/AAAAAAAAA60/HKATNzjKU2o/s400/error.jpg" alt="" id="BLOGGER_PHOTO_ID_5309355835565063202" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Need to say i got an error displaying on the invite: This meeting is not in the calendar, it may have been moved or deleted.&lt;br /&gt;&lt;br /&gt;Discovered that when i click on the "Accept Button" for meetings which i have been invited, the Accept button doesn't do anything. The invite sent to me,looks like this :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Doing a bit of google got me &lt;a href="http://forums.techguy.org/business-applications/584211-outlook-2003-cannot-accept-meetings.html"&gt;this&lt;/a&gt; &lt;a href="http://forums.techguy.org/business-applications/584211-outlook-2003-cannot-accept-meetings.html"&gt;link&lt;/a&gt;, and it worked for me&lt;br /&gt;&lt;br /&gt;Just incase the link goes down some day, here is what you need to do&lt;br /&gt;&lt;br /&gt;1. Kill all services relating to Microsoft products (i.e. Word, Outlook, Messenger etc.)&lt;br /&gt;2. Then from the Run line, enter "outlook.exe /cleanfreebusy".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-2801076583879058662?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/2801076583879058662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=2801076583879058662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/2801076583879058662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/2801076583879058662'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2009/03/not-able-to-accept-meetings-in-outlook.html' title='Not able to accept meetings in Outlook'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_RIhwOK2k5D8/Sa6fAJUAvCI/AAAAAAAAA60/HKATNzjKU2o/s72-c/error.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-3822793175374241291</id><published>2009-02-25T03:08:00.000-08:00</published><updated>2009-02-26T04:48:13.687-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IFrame'/><category scheme='http://www.blogger.com/atom/ns#' term='WaitForCondition'/><category scheme='http://www.blogger.com/atom/ns#' term='Javascipt'/><category scheme='http://www.blogger.com/atom/ns#' term='DOM'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium'/><title type='text'>Waiting for Elements in an IFrame on a WebPage to Load</title><content type='html'>Waiting for  a page to load while writing selenium scripts is pretty straightforward using the&lt;br /&gt;selenium.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;WaitForPageToLoad&lt;/span&gt;("timeout") timeout is time in millisecond.&lt;br /&gt;&lt;br /&gt;Sometimes using this command &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;doesn't&lt;/span&gt; work, especially when you the whole page is not loaded or reloaded but a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;popup&lt;/span&gt; is loaded in a div on the page. In situation like this i would used the&lt;br /&gt;selenium.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;WaitForCondition&lt;/span&gt;("&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;ScriptToReturnwhich ReturnTrue OrFalse&lt;/span&gt;",  "timeout");&lt;br /&gt;e.g. of scripts would be&lt;br /&gt;&lt;br /&gt;selenium.WaitForCondition(selenium.browserbot.get CurrentWindow().document&lt;br /&gt;.getElement ById('idOfElement ToBelocated')!=null", "60000");       &lt;br /&gt;&lt;br /&gt;This has always worked well for well until today, i had a special case where the element that i needed to wait for it to load was inside an &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;IFrame&lt;/span&gt;, which is loaded within a parent page. Using the Wait for condition as above kept timing out as the Javascript could not access the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;IFrame&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;what worked for me after several hours of trying is:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;selenium.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;WaitForCondition&lt;/span&gt;("selenium.browserbot.getCurrent Window()&lt;br /&gt;.frames['Name Of IFrame'].document.get Element ById&lt;br /&gt;'idOfElement ToBelocated')!= null", "60000");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This brilliantly eliminated my nightmare .......&lt;br /&gt;&lt;br /&gt;Comments are welcome&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-3822793175374241291?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/3822793175374241291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=3822793175374241291' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/3822793175374241291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/3822793175374241291'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2009/02/waiting-for-elements-in-iframe-on.html' title='Waiting for Elements in an IFrame on a WebPage to Load'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-1976555709996348492</id><published>2009-01-31T02:31:00.000-08:00</published><updated>2009-03-04T07:12:36.998-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='QA'/><category scheme='http://www.blogger.com/atom/ns#' term='Internet Explorer'/><category scheme='http://www.blogger.com/atom/ns#' term='Javascipt'/><category scheme='http://www.blogger.com/atom/ns#' term='DOM'/><category scheme='http://www.blogger.com/atom/ns#' term='Agile'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Application'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><title type='text'>Need to get a value of an attribute using selenium</title><content type='html'>I was in this situation when i needed to get the value of an html attribute and i found the selenium.getattribute very handy .....&lt;br /&gt;&lt;br /&gt;Okay the scenario was such that there was an element which is collapsible on the page and the only attibute for that element that indictated the status of the collapsible element was the 'Class'. when the element was collapsed, the value of the class attribute was 'asleep' and when the element was expanded, the value of the class atttribute was 'awake'.&lt;br /&gt;&lt;br /&gt;The script used to determine the status of this element is&lt;br /&gt;&lt;pre&gt;selenium.GetAttribute("elementLocator@nameofAttribute");&lt;br /&gt;&lt;br /&gt;so if the id of my element is FundingClass and the attribute we are interested in is the 'Class'&lt;br /&gt;&lt;br /&gt;The selenium code will be&lt;br /&gt;selenium.GetAttribute("FundingClass@Class");&lt;br /&gt;&lt;br /&gt;Hope this helps someone .....&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-1976555709996348492?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/1976555709996348492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=1976555709996348492' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/1976555709996348492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/1976555709996348492'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2009/01/need-to-get-value-of-attribute-using.html' title='Need to get a value of an attribute using selenium'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-7032641387734314956</id><published>2008-12-23T00:55:00.001-08:00</published><updated>2008-12-23T01:38:50.153-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='QA'/><category scheme='http://www.blogger.com/atom/ns#' term='Javascripts'/><category scheme='http://www.blogger.com/atom/ns#' term='DOM'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Application'/><title type='text'>Using selenium.GetEval(script)to execute Javascript</title><content type='html'>The task at hand was to navigate through the DOM of a particular webpage and check the&lt;br /&gt;style.display attribute of an object or element if you prefer. There are two elements on this page that displayed either success or failure messages.(msgSuccess and msgFailed)&lt;br /&gt;For perfomance reasons, if previously a successful message was displayed and subsequently the you get a failure message, what the developers of the page did was to amend the style.display attribute.&lt;br /&gt;&lt;br /&gt;&amp;lt;span style="display: none;" id="msgSuccess" class="MyMsgSuccess"&amp;gt;&lt;br /&gt;&lt;br /&gt;The HTML code above implies the element 'msgSuccess' would not be displayed&lt;br /&gt;&lt;br /&gt;&amp;lt;span style="" id="msgSuccess" class="MyMsgSuccess"&amp;gt;&lt;br /&gt;&lt;br /&gt;In the second case, the msg success would be displayed ....&lt;br /&gt;&lt;br /&gt;The problem i encountered was, sometimes i would have&lt;br /&gt;&lt;br /&gt;&amp;lt; span style="display: none;" id="msgSuccess" class="MyMsgSuccess" &amp;gt; Operation Successful &amp;lt;/span &amp;gt;&lt;br /&gt;&lt;br /&gt;If i do a selenium.GetText("msgSuccess"), i get the text returned even though the style.display is set to none. Hence the need for the Selenium.GetEval to check the value of the style.display attribute as that seem as a true test for the web page&lt;br /&gt;&lt;br /&gt;I have done:&lt;br /&gt;&lt;br /&gt;const string script = "document.getElementById(\"msgSuccess\").style.display";&lt;br /&gt;string evalResult = selenium.GetEval(script);&lt;br /&gt;&lt;br /&gt;The above script failed as selenium was executing the javascript in the selenium console and not on the Application under test (AUT)&lt;br /&gt;and searching the internet got me doing:&lt;br /&gt;&lt;br /&gt;const string script = "selenium.browserbot.getCurrentWindow().document.getElementById(\"msgSuccess\").style.display";&lt;br /&gt;string evalResult = selenium.GetEval(script);&lt;br /&gt;&lt;br /&gt;This way i got the javascript to be run on the Application under test ....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-7032641387734314956?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/7032641387734314956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=7032641387734314956' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/7032641387734314956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/7032641387734314956'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2008/12/using-seleniumgetevalscriptto-execute.html' title='Using selenium.GetEval(script)to execute Javascript'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-5299962691060837760</id><published>2008-11-08T17:48:00.000-08:00</published><updated>2008-11-08T17:53:24.457-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Internet Explorer'/><category scheme='http://www.blogger.com/atom/ns#' term='xpath'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium'/><title type='text'>Internet Explorer doesnt handle xpath to locate images exceptionally well</title><content type='html'>So i have been doing a lot of selenium and the website i am trying to automate test for&lt;br /&gt;doesnt have a lot of element with id, name, or any other HTML attributes that makes selenium testing a bit easier.&lt;br /&gt;&lt;br /&gt;So i have been using of xpath, my intent was to click on an image and i have used the src attribute of the image element.&lt;br /&gt;&lt;br /&gt;so my original command,&lt;br /&gt;&lt;br /&gt;selenium.click ("xpath=//img[@src="location/of/image/on/disc"]");&lt;br /&gt;&lt;br /&gt;This works excellently on firefox but on IE, i keep getting the error "Element not found!"&lt;br /&gt;&lt;br /&gt;so after several tries, this definitely work on both IE and firefox ......&lt;br /&gt;&lt;br /&gt;selenium.click ("xpath=//img[@contains(@href, "google.com")]");&lt;br /&gt;The second parameter of the  xpath "contains" a segment of the link that the image element points to.Note that the img element has a href and that is why i am able to use the "contains" method of the xpath to locate the img.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-5299962691060837760?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/5299962691060837760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=5299962691060837760' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/5299962691060837760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/5299962691060837760'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2008/11/internet-explorer-cannot-locate-images.html' title='Internet Explorer doesnt handle xpath to locate images exceptionally well'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-6151803217831310671</id><published>2008-11-06T08:44:00.000-08:00</published><updated>2008-11-06T08:48:15.343-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='screengrab'/><category scheme='http://www.blogger.com/atom/ns#' term='screenshots'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium'/><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><title type='text'>Use selenium to create screenshot</title><content type='html'>I just stunbled across selenium as a tool to take screenshot.&lt;br /&gt;Thuis could be useful for anything.&lt;br /&gt;&lt;br /&gt;In my case i used it to take the screenshot of a page just before it throws an error in my selenium test. and that i could have a look and investigate what the problem might have been.&lt;br /&gt;&lt;br /&gt;very simple command and the great thing is it can be easily used for screenshots of a page across different browsers.&lt;br /&gt;&lt;br /&gt;browser.CaptureEntirePageScreenshot("C:\\actual _path_to_where_you_want the_file _placed\\screenshot.png");&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-6151803217831310671?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/6151803217831310671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=6151803217831310671' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/6151803217831310671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/6151803217831310671'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2008/11/use-selenium-to-create-screenshot.html' title='Use selenium to create screenshot'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-1153086148937078913</id><published>2008-11-06T08:26:00.000-08:00</published><updated>2008-11-06T08:42:16.340-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascripts'/><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium'/><category scheme='http://www.blogger.com/atom/ns#' term='onblur'/><title type='text'>Selenium and Javascript events</title><content type='html'>Have you ver been in situattion when youhave typed a value into a text box and you expect a&lt;br /&gt;Javascript event to be called such as "OnBlur"&lt;br /&gt;&lt;br /&gt;welll selenium has a method "FireEvent" which triggers the event for you, but then the trick is you have to strip the "on" and name for the event wouldbe "OnBlur"&lt;br /&gt;&lt;br /&gt;I guess abit of example would make more sense, lol.&lt;br /&gt;This is what my html look like&lt;br /&gt;&lt;br /&gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;&amp;quot; onblur=&amp;quot;JavaScript:ValidateSimpleMail(true);&amp;quot; size=&amp;quot;25&amp;quot; name=&amp;quot;EMAIL_1&amp;quot; id=&amp;quot;EMAIL_1&amp;quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;selenium command to type into an email box, which doesnt fire the event attached to the text box&lt;br /&gt;&lt;br /&gt;browser.Type("EMAIL_1", "sam@sam.com");&lt;br /&gt;&lt;br /&gt;The work around is to use selenium to fire the event after it has typed in the textbox&lt;br /&gt;FireEvent(locator, eventName) which in my case is&lt;br /&gt;&lt;br /&gt;browser.FireEvent("EMAIL_1", "blur");&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-1153086148937078913?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/1153086148937078913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=1153086148937078913' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/1153086148937078913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/1153086148937078913'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2008/11/selenium-and-javascript-events.html' title='Selenium and Javascript events'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-4320770642159722447</id><published>2008-11-03T05:22:00.000-08:00</published><updated>2008-11-06T08:43:26.187-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xpath'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='selenium'/><title type='text'>Selenium: Xpath locator can not be used as Option Locator</title><content type='html'>In my new job been doing a lot of selenium and i needed to scroll through the list of&lt;br /&gt;options in a select element and click on a particular options.&lt;br /&gt;&lt;br /&gt;i have initially used the browser.DoubleClick&lt;br /&gt;&lt;br /&gt;browser.DoubleClick("xpath=//select/option[child::text()='Option_Label']");)&lt;br /&gt;&lt;br /&gt;But then this didnt work because selenium doesn't have the functionality to scroll down the select element in other to make my desired option visible.&lt;br /&gt;&lt;br /&gt;Looking through the selenium api, i have used another method, which take in two parameters, the select locator and the option locator.&lt;br /&gt;&lt;br /&gt;so i used:&lt;br /&gt;&lt;br /&gt;browser.Select("xpath=//select", "xpath =//option[child::text()='Option_Label']");&lt;br /&gt;&lt;br /&gt;that hasnt work either as the option locator type cannot be xpath. it has to be a label, id, atrribute, name or any other html locator&lt;br /&gt;&lt;br /&gt;so i have done&lt;br /&gt;&lt;br /&gt;browser.Select("xpath=//select", "label=Option_Label");&lt;br /&gt;&lt;br /&gt;which in myown opinion i think is good as it is robust for a selenium test.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-4320770642159722447?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/4320770642159722447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=4320770642159722447' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/4320770642159722447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/4320770642159722447'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2008/11/selenium-xpath-locator-can-not-be-used.html' title='Selenium: Xpath locator can not be used as Option Locator'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-6556340787390200517</id><published>2008-10-18T03:18:00.000-07:00</published><updated>2008-11-06T08:44:37.687-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='microphone'/><category scheme='http://www.blogger.com/atom/ns#' term='wireless'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Sorting out devices - Wireless, Inbuilt Microphone on Ubuntu Hardy Heron</title><content type='html'>Faced with the reality of having to hand in my MAC to my former workplace, i decided to buy a Windows machine (HP 6735s Laptop, AMD Athlon TM X2 Dual Core QL-60 1.9Ghz, 4GB memory, 250GB HDD, DVD+-RW SMDL LightScribe writer, Webcam 15.4" WXGA (1280 x 800) WLAN Bluetooth Microsoft Windows Vista Home Premium )&lt;br /&gt;&lt;br /&gt;and being a MAC - convert, coupled with the numerous negative feedback about Vista. I have installed Ubuntu Hardy Heron on a seperate partition. For some reason i have been spending about 4hours each day trying to sort Ubuntu to recognise my hardware, the first was my wireless wasnt working, ubuntu did not recognise the Broadcom wireless hardware which the laptop.&lt;br /&gt;&lt;br /&gt;I am not gonna start copying stuff, there is a lot of blogs out there, two which helped me are:&lt;br /&gt;http://ubuntuforums.org/showthread.php?t=766560&lt;br /&gt;https://help.ubuntu.com/community/WifiDocs/Driver/bcm43xx/Feisty_No-Fluff#head-bc33832c0547766a33c3a84f13f971ca757b2851&lt;br /&gt;&lt;br /&gt;Well my wireless now work , the next huddle is to get the Microphone to work, so i should get that done next week, if i get some time to get round to it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-6556340787390200517?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/6556340787390200517/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=6556340787390200517' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/6556340787390200517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/6556340787390200517'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2008/10/sorting-out-devices-wireless-inbuilt.html' title='Sorting out devices - Wireless, Inbuilt Microphone on Ubuntu Hardy Heron'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3951612577376800728.post-2826357015488533493</id><published>2008-08-29T04:10:00.000-07:00</published><updated>2008-11-06T08:44:10.076-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='deploy'/><category scheme='http://www.blogger.com/atom/ns#' term='nant'/><category scheme='http://www.blogger.com/atom/ns#' term='ssh'/><category scheme='http://www.blogger.com/atom/ns#' term='scp'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>Nant SCP Task: deploy file to a remote server</title><content type='html'>Actually started the task by attempting to use MSBuild to deploy my application to a remote server.&lt;br /&gt;which would require some secure means, scp, sftp or something of that sort.&lt;br /&gt;The closest i got was &lt;a href="http://www.tamirgal.com/home/dev.aspx?Item=SharpSsh"&gt;SSHSharp&lt;/a&gt; which was written by a third party and not thoroughly tested,&lt;br /&gt;i then decided maybe that wasn't the path to go.&lt;br /&gt;&lt;br /&gt;Tried to go for Nant instead, and found that Nant core doesnt have a task for secure copy,&lt;br /&gt;Hence, the other option was &lt;a href="http://nantcontrib.sourceforge.net/"&gt;NantContrib&lt;/a&gt; which seem okay to an extent, except for incomplete documentation.&lt;br /&gt;&lt;br /&gt;Once big issue was having a "scp" failed to start ---&gt; The file cannot be found error when i tried to execute the build file. I spent a great deal of my time trying to figure out what file was not found, thinking it was my file that i intend to copy that wasn't found.&lt;br /&gt;&lt;br /&gt;Actually it was the program "&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;scp&lt;/span&gt;.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;exe&lt;/span&gt;" that could not be found, it took a lot of time and guesses, as there weren't a lot of resources on  the&lt;br /&gt;search engines about this. May be i was just being dumb. So i had to install &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;pscp&lt;/span&gt; on my machine and add that to the path.&lt;br /&gt;&lt;br /&gt;and it works fine...........&lt;br /&gt;&lt;br /&gt;Summary is that you for you to use the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;scp&lt;/span&gt; task,&lt;br /&gt;&lt;br /&gt;Download the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;nantcontrib&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;dll&lt;/span&gt; files and read the "&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;ReadMe&lt;/span&gt;.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;txt&lt;/span&gt;"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And add that to your Target with uses the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;SCP&lt;/span&gt; task&lt;br /&gt;&lt;br /&gt;loadtasks assembly="${project::get-base-directory()}/lib_build/nantcontrib-0.85/bin/NAnt.Contrib.Tasks.dll"&lt;br /&gt;&lt;br /&gt;This would the directory where your .&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;dll&lt;/span&gt; files are.&lt;br /&gt;Make sure that that &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;scp&lt;/span&gt; which is default is installed on your machine, you could actually use other application , e.g  &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;pscp&lt;/span&gt;, ssh bu that would have to the specified in the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;SCP&lt;/span&gt; task.&lt;br /&gt;&lt;br /&gt;Finally, This is what my file looked like:&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;br /&gt;&amp;lt;project name="Project Name" default="DeployToPlay" basedir="."&amp;gt;&lt;br /&gt;&amp;lt;property name="debug" value="true" overwrite="false" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;target name ="DeployToServer"&amp;gt;&lt;br /&gt;  &amp;lt;loadtasks assembly="${project::get-base-directory()}/lib_build/nantcontrib-0.85/bin/NAnt.Contrib.Tasks.dll" /&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;zip zipfile="myapplication.zip" &amp;gt;&lt;br /&gt;    &amp;lt;fileset&amp;gt;&lt;br /&gt;      &amp;lt;include name = "*.aspx;*.asax;web.config"/&amp;gt;&lt;br /&gt;      &amp;lt;include name = "Content\**\*.*"/&amp;gt;&lt;br /&gt;      &amp;lt;include name = "home\**\*.*"/&amp;gt;&lt;br /&gt;      &amp;lt;include name = "Views\**\*.*"/&amp;gt;&lt;br /&gt;      &amp;lt;include name = "bin\Debug\**\*.*"/&amp;gt;&lt;br /&gt;    &amp;lt;/fileset&amp;gt;&lt;br /&gt;  &amp;lt;/zip&amp;gt;&lt;br /&gt;  &amp;lt;scp file="myapplication.zip" server="myservername" path="/pathOnTheServer" /&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/project&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;target name="DeployToServer"&gt;&lt;br /&gt;&lt;loadtasks assembly="${project::get-base-directory()}/lib_build/nantcontrib-0.85/bin/NAnt.Contrib.Tasks.dll"&gt;&lt;br /&gt;&lt;br /&gt;&lt;zip zipfile="myapplication.zip"&gt;&lt;br /&gt;  &lt;fileset&gt;&lt;br /&gt;    &lt;include name="*.aspx;*.asax;web.config"&gt;&lt;br /&gt;    &lt;include name="Content\**\*.*"&gt;&lt;br /&gt;    &lt;include name="home\**\*.*"&gt;&lt;br /&gt;    &lt;include name="Views\**\*.*"&gt;&lt;br /&gt;    &lt;include name="bin\Debug\**\*.*"&gt;&lt;br /&gt;  &lt;/include&gt;&lt;br /&gt;&lt;/include&gt;&lt;br /&gt;&lt;scp file="myapplication.zip" server="myservername" path="/pathOnTheServer"&gt;&lt;br /&gt;&lt;/scp&gt;&lt;br /&gt;&lt;/include&gt;&lt;/include&gt;&lt;/include&gt;&lt;/fileset&gt;&lt;/zip&gt;&lt;/loadtasks&gt;&lt;/target&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3951612577376800728-2826357015488533493?l=samadesoga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://samadesoga.blogspot.com/feeds/2826357015488533493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3951612577376800728&amp;postID=2826357015488533493' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/2826357015488533493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3951612577376800728/posts/default/2826357015488533493'/><link rel='alternate' type='text/html' href='http://samadesoga.blogspot.com/2008/08/nant-scp-task-deploy-file-to-remote.html' title='Nant SCP Task: deploy file to a remote server'/><author><name>leumascom</name><uri>http://www.blogger.com/profile/06167812764083309460</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://1.bp.blogspot.com/_RIhwOK2k5D8/S-b0EWLbBOI/AAAAAAAABoo/wakLgsXqFhk/S220/sam.jpg'/></author><thr:total>0</thr:total></entry></feed>
