Forum Discussion

royd's avatar
royd
Regular Contributor
8 years ago
Solved

How can I access url and a string from email (web mail)?

I am using TestComplete version 12.10602.7 with Jscript.

 

I'm trying to access an URL and password for new user sign-up process. I am using webmail by mail the mailinator.com (saw a suggesion in this board for mailinatior email) for this process. The new user receives two separate email, one with the sign-up URL and another with a security code. Here are the examples of the message users will receive.

 

"John Doe has important information regarding AMG - Facility. Please click here: https://<singup_page>.com/EngagementPlatform/access/AMG7QP8EP7 for more information."

 

and

 

"Your AMG - Facility forms access code is 22RP3DPM. You will receive a link to your forms using your primary email address. You will need this access code to use the forms link. Further instructions will be available after using the access code to access the forms."

 

I need to access the url and the access code to continue with signup process. I would really appreciate some help.

 

I should probably also mention, that I am relatively new to TestComplete as well as JavaScript/J script. Therefore, I can really use some examples.

 

Thanks in advance!

  • tristaanogre's avatar
    tristaanogre
    8 years ago

    Also, if the e-mail as received is in HTML format, it's possible that the URL in the email body is an actual HTML link. In which case, finding the URL could be a matter of using something like a FindChild call on the email body to find the link and grab the URL from there.  I'm GUESSING that there is a static portion of that link that is common no matter who gets the e-mail (perhaps the https://<signupage.com> portion) that you can use as part of the search parameters.

3 Replies

  • How far have you got?

     

    Have you got to the point where you're finding the mail, opening it, and extracting the content text?

     

    I'm not a JScript/JavaScript guy so can't really help with examples. But I have done this in the past (using VBScript) and I suspect the basics will be the same.

     

    Find the mail.

    Open it.

    Extract the content text.

    Find relevant keywords in the content text - eg "HTTPS:" - to give you start/end points of URL's.

    Use these start/end points to extract the URL string.

    Drop it into a browser.

    Away you go ....

     

    But it would help to know how far you've got in the above list ....

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Also, if the e-mail as received is in HTML format, it's possible that the URL in the email body is an actual HTML link. In which case, finding the URL could be a matter of using something like a FindChild call on the email body to find the link and grab the URL from there.  I'm GUESSING that there is a static portion of that link that is common no matter who gets the e-mail (perhaps the https://<signupage.com> portion) that you can use as part of the search parameters.

  • royd's avatar
    royd
    Regular Contributor

    Thank you both Colin and Robert! 

    I have not started yet. At lease I have an idea. I am going to try few things and get back here.