gmail is very difficult to automate I can't specify an xpath in gmail without working directly.
but here is a resource, it might help you in figuring out how to automate gmail.
http://stackoverflow.com/questions/16135329/how-to-automate-new-gmail-ui-to-send-email-by-using-selenium-ide