Skip to main content

Posts

Java Out of Memory Error

If we get an outofmemory error on java you can do the following: 1. If you are running your java program using eclipse a. right click on project --> Run As --> Java Application --> Select Run Configurations b. Give -Xms1024m in Arguments Tab --> VM arguments: This sets the virtual memory to 1 GB for jvm to run

Profile Error on Chrome - "Your profile can not be used because..."

After upgrading/reinstalling Chrome we get this error when we open Chrome: "Your profile can not be used because it is from a newer version of Google Chrome. Some features may be unavailable. Please specify a different profile directory or use a newer version of Chrome." Solution Posted here: http://www.groovypost.com/howto/how-to/fix-chrome-error-message-profile-can-not-be-used-a-newer-version/

Clipboard Hack

A simple script has it all: var content = clipboardData.getData("Text"); alert(content); put this in the script tag! Didn't know it was that easy! Solution for IE: Go to internet options->security Press custom level In the security settings, select disable under Allow paste operations via script Not every browser seems to be allowing such easy way of protection ;) Solution for Chrome: Go to browser "Options" Choose Under the Hood Tab --> Content Settings Select Javascript -- Don't allow any site to run JavaScript I haven't tested this yet though! Let me know if you know better ways :) and also how to do it on various browsers :) Thanks!

Cron Job

Excellent Post @ http://www.markus-gattol.name/ws/time.html#cron Once we get to know what a cron job is, we can go on an get going on our linux box. This link will help you create your own cronjob: http://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/

XHR Issue with Selenium - Firefox

When we try executing our suite on Firefox, there is an issue with the new Selenium 1.0.3 server: Got result: XHR ERROR: URL = http://www.____.com/ Response_Code = 503 Error_Message = Serrvice Temporarily Unavailable on session b882a11224b7____ This doesn't occur with the older selenium server jar but just the new one. Root Cause: This occurs mainly due to Open command If we alter the open command to have its second argument as TRUE...it works! Reference: Reference2 Also suggest  that you might want to use the latest version of Selenium RC...RC's 2 and above don't throw the XHR error... Get the latest RC here .

Selenium throws an exception when running on Firefox

we get this error when we are trying to run a testng annotated java selenium code on firefox: "[testng] com.thoughtworks.selenium.SeleniumException: this.getCurrentWindow is not a function" Then all the other annotations are SKIPPED. A workaround for such an error would be to put the line of code which gives this error under a try block. In my case it was openReader() I changed the code as below: try{ openReader()} catch(Exception e){System.out.println(e.toString());} The class should throw the Exception too! This solved the problem and after the exception is printed, the execution continues!