I'm trying to extract an url from email.
I'm using selenium webdriver and I want to check through the test the email account to verify email was sent.
I managed to get to the email account and I did a few testings with it but when trying to use it in my automation it fails with this exception:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/activation/DataHandler
at com.sun.mail.imap.IMAPFolder.newIMAPMessage(IMAPFolder.java:1395)
at com.sun.mail.imap.MessageCache.getMessage(MessageCache.java:146)
at com.sun.mail.imap.IMAPFolder.getMessages(IMAPFolder.java:1860)
at com.YakirSaadia.Tools.EmailVerification.getUrlFromEmail(EmailVerification.java:144)
at com.YakirSaadia.Tools.EmailVerification.runTest(EmailVerification.java:45)
at com.YakirSaadia.VendorTests.RegisterNewComp.registerNewCompany(RegisterNewComp.java:55)
at com.YakirSaadia.VendorTests.RegisterNewComp.runTest(RegisterNewComp.java:26)
at com.YakirSaadia.Vendor.vendorTests(Vendor.java:36)
at com.YakirSaadia.Main.main(Main.java:34)
Caused by: java.lang.ClassNotFoundException: javax.activation.DataHandler
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
... 9 more
If someone could help me it would be great!
Edit:
Couldn't find any other post that answers my questions. I dont need to send the url or something like that, I need to extract it to use it in my automation testing.
This means that activation.jar
is not in your classpath when you run your test. From the JavaMail readme:
Requirements
Note that the JavaMail API requires the JavaBeans(TM) Activation Framework package to be installed as well if you're using JDK 1.5. Download the latest version of the JavaBeans Activation Framework from
http://www.oracle.com/technetwork/java/javase/index-jsp-136939.html
and install it in a suitable location.