Tuesday, January 18, 2011

Selenium - Send Email Notifications

Selenium Send Email Notifications

I have already written program to send email notification in my QTP Hybrid Framework using CDO object. Now I have got requirement to send email notifications after executing Selenium scripts. I have decided to reuse my existing code.

How to initiate .vbs file from Java
package Email;
public class ByCDO {
   public static void main(String argv[]) {
      try {
        Process p = Runtime.getRuntime().exec("cscript c:\\SendEmail.vbs ");
      catch (Exception err) {

Link for sending email using Java (Select this link)

If you are running your Selenium scripts using Hudson there is a provision to configure your mail. Attaching screen shot.

In Progress...

Passing Arguments To VB Script

Passing Arguments To VB Script

Recently I had a requirement where in I had to execute .vbs file by passing arguments from the command prompt  , instead of using input box. I am actually trying to initiate this vbs file from JAVA.

VB Script has the provision to pass the command line arguments. At the command prompt you can type following text c:\email.vbs arg1 arg2 arg3.... 

To access the above passed arguments, we need to use WScript.Arguments object, all the values are stored sequentially in an array format with index starting from zero.
Set objArgs = WScript.Arguments
Arg1 = objArgs(0)
Arg2 = objArgs(1)
Arg3 = objArgs(2)

Tuesday, January 11, 2011

SauceLabs - Selenium Company

Selenium - Functional testing tool
Many people have concerns implementing open source tools, as it lack support and bug fix take lot of time.

Now we have SauceLabs which provide commercial support for selenium.
It also help users to run cross-browser functional tests in the cloud, so that you can reduce your testing infrastructure and lot more. Browse the site for complete understanding.

I hope this post will be useful for people implementing selenium.