Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

» Selenium IDE Verify different Maps (Hybridview, Mapview etc.)
Fri Nov 25, 2016 9:56 pm by DJ87

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Send email automatically

View previous topic View next topic Go down

Send email automatically

Post by dkpune on Sat Mar 24, 2012 2:49 am

I want to send an email (from outlook) automatically from script when smoke test is compelted. Please share the java code which can be used in Selenium.

dkpune

Posts : 6
Join date : 2012-03-14

Back to top Go down

Re: Send email automatically

Post by rohit13 on Tue Apr 10, 2012 3:31 pm

I don't have idea regarding mail functionality by outlook but here is code for Gmail

Just need to add code at the end of your script, n it will send email.

Code:
public class email extends SeleneseTestCase {
    @Before
    public void setUp() throws Exception {
        selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://selenium.brodos.net/");
        selenium.start();
    }

    @Test
    public void testEmail() throws Exception {
        selenium.open("http://www.gmail.com");
        selenium.type("id=Email", "test");
        selenium.type("id=Passwd", "test");
        selenium.click("id=signIn");
        selenium.waitForPageToLoad("30000");
        selenium.clickAt("//div[@id=':oy']/div/div", "");
        selenium.type("name=to", "test@test.com");
        selenium.type("name=subject", "testSubject");
        selenium.type("css=body[class='editable  LW-avf']", "asdasd");
        selenium.keyPress("//div/b[text()='Send']", "13");
    }

    @After
    public void tearDown() throws Exception {
        selenium.stop();
    }
}


Hope it will work for you..

_________________
Radical QA
http://radical-qa.blogspot.in/

rohit13
Master
Master

Posts : 180
Join date : 2012-03-29
Age : 30
Location : INDIA

http://radical-qa.blogspot.in/

Back to top Go down

Re: Send email automatically

Post by tarun3kumar on Thu Apr 12, 2012 1:29 pm

A better approach could be to use build tool like ant to send email of test results. I assume that you are not using any CI system else it would have been way easier.
You could find more on ant mail task here - http://ant.apache.org/manual/Tasks/mail.html

_________________
Thanks
Tarun K
Free Selenium Training

tarun3kumar
Master
Master

Posts : 186
Join date : 2012-02-14

http://seleniumtests.com

Back to top Go down

Re: Send email automatically

Post by Sponsored content Today at 1:14 am


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum