Creating a method to increment a number within an email
During a test automation journey i am running, i need to verify an email address which must be different each time.
Instead of using multiple different email address's, we have set up an office 365 account that allows +(number) ie test+1@test.com.
Although i know how to create an increment by 1 method i am unsure of how to incorporate that into the email address within a method to give me a different email each time.
Apologies if this is already in stack overflow but i couldn't find it.
Thanks
java selenium-webdriver intellij-idea cucumber
add a comment |
During a test automation journey i am running, i need to verify an email address which must be different each time.
Instead of using multiple different email address's, we have set up an office 365 account that allows +(number) ie test+1@test.com.
Although i know how to create an increment by 1 method i am unsure of how to incorporate that into the email address within a method to give me a different email each time.
Apologies if this is already in stack overflow but i couldn't find it.
Thanks
java selenium-webdriver intellij-idea cucumber
1
if you know how to do increment one, you know how to do this. it's just that, added with a simple String concatenation
– Stultuske
Jan 3 at 11:37
you can have a look at the following answer. stackoverflow.com/questions/45841500/generate-random-emails
– joemokenela
Jan 3 at 11:44
@joemokenela according to the question, that is not what he's looking for
– Stultuske
Jan 3 at 11:55
All, thanks for comments @Stultuske, its the creation of the string im having problems with and incorporating the incremented number into the email.
– M.Dug
Jan 3 at 13:27
@joemokenela im not after a random email as i need it related to the account im using. thanks
– M.Dug
Jan 3 at 13:28
add a comment |
During a test automation journey i am running, i need to verify an email address which must be different each time.
Instead of using multiple different email address's, we have set up an office 365 account that allows +(number) ie test+1@test.com.
Although i know how to create an increment by 1 method i am unsure of how to incorporate that into the email address within a method to give me a different email each time.
Apologies if this is already in stack overflow but i couldn't find it.
Thanks
java selenium-webdriver intellij-idea cucumber
During a test automation journey i am running, i need to verify an email address which must be different each time.
Instead of using multiple different email address's, we have set up an office 365 account that allows +(number) ie test+1@test.com.
Although i know how to create an increment by 1 method i am unsure of how to incorporate that into the email address within a method to give me a different email each time.
Apologies if this is already in stack overflow but i couldn't find it.
Thanks
java selenium-webdriver intellij-idea cucumber
java selenium-webdriver intellij-idea cucumber
asked Jan 3 at 11:36
M.DugM.Dug
32
32
1
if you know how to do increment one, you know how to do this. it's just that, added with a simple String concatenation
– Stultuske
Jan 3 at 11:37
you can have a look at the following answer. stackoverflow.com/questions/45841500/generate-random-emails
– joemokenela
Jan 3 at 11:44
@joemokenela according to the question, that is not what he's looking for
– Stultuske
Jan 3 at 11:55
All, thanks for comments @Stultuske, its the creation of the string im having problems with and incorporating the incremented number into the email.
– M.Dug
Jan 3 at 13:27
@joemokenela im not after a random email as i need it related to the account im using. thanks
– M.Dug
Jan 3 at 13:28
add a comment |
1
if you know how to do increment one, you know how to do this. it's just that, added with a simple String concatenation
– Stultuske
Jan 3 at 11:37
you can have a look at the following answer. stackoverflow.com/questions/45841500/generate-random-emails
– joemokenela
Jan 3 at 11:44
@joemokenela according to the question, that is not what he's looking for
– Stultuske
Jan 3 at 11:55
All, thanks for comments @Stultuske, its the creation of the string im having problems with and incorporating the incremented number into the email.
– M.Dug
Jan 3 at 13:27
@joemokenela im not after a random email as i need it related to the account im using. thanks
– M.Dug
Jan 3 at 13:28
1
1
if you know how to do increment one, you know how to do this. it's just that, added with a simple String concatenation
– Stultuske
Jan 3 at 11:37
if you know how to do increment one, you know how to do this. it's just that, added with a simple String concatenation
– Stultuske
Jan 3 at 11:37
you can have a look at the following answer. stackoverflow.com/questions/45841500/generate-random-emails
– joemokenela
Jan 3 at 11:44
you can have a look at the following answer. stackoverflow.com/questions/45841500/generate-random-emails
– joemokenela
Jan 3 at 11:44
@joemokenela according to the question, that is not what he's looking for
– Stultuske
Jan 3 at 11:55
@joemokenela according to the question, that is not what he's looking for
– Stultuske
Jan 3 at 11:55
All, thanks for comments @Stultuske, its the creation of the string im having problems with and incorporating the incremented number into the email.
– M.Dug
Jan 3 at 13:27
All, thanks for comments @Stultuske, its the creation of the string im having problems with and incorporating the incremented number into the email.
– M.Dug
Jan 3 at 13:27
@joemokenela im not after a random email as i need it related to the account im using. thanks
– M.Dug
Jan 3 at 13:28
@joemokenela im not after a random email as i need it related to the account im using. thanks
– M.Dug
Jan 3 at 13:28
add a comment |
1 Answer
1
active
oldest
votes
You can use a dedicated gmail account and before using it you can append +timestamp in it.
example:
let's say you have a account on gmail ABC@gmail.com
Now, every time you use this email for verification append ABC+timestamp@gmail.com this email is new for you application but you will always receive verification code on ABC@gmail. you can read ABC@gmail every time for the latest mail for verification. I have used this methods and it works fine with gmail.
Try to test it manually make and gmail account with any name say Mdug@gmail.com
Now send email to Mdug+1@gmail.com using different account. you will receive mail at Mdug@gmail.com because in gmail Mdug+anything@gmail.com == Mdug@gmail.com.
Every time you have to read latest mail in Mdug@gmail.com because every verification code will go there
Instead of using random number you can append (Epoch)timestamp after + in email id because it will always be unique
Thanks for your comment. the timestamp is a much better idea then increment by 1 each time. Iv managed to create the string and it now add the time and date within the email address each time its created, this also allows me to know if its the correct email i'm looking at as there can occasionally. Problem solved, thanks all
– M.Dug
Jan 3 at 13:49
integration with third party email sounds awfully slow and fragile,.,.. I'd avoid his
– Corey Goldberg
Jan 3 at 18:03
@CoreyGoldberg yea i agree, i didn't go with something like gmail but i have used my companies email. this issue is now solved for me. thanks all
– M.Dug
Jan 4 at 9:37
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54021508%2fcreating-a-method-to-increment-a-number-within-an-email%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can use a dedicated gmail account and before using it you can append +timestamp in it.
example:
let's say you have a account on gmail ABC@gmail.com
Now, every time you use this email for verification append ABC+timestamp@gmail.com this email is new for you application but you will always receive verification code on ABC@gmail. you can read ABC@gmail every time for the latest mail for verification. I have used this methods and it works fine with gmail.
Try to test it manually make and gmail account with any name say Mdug@gmail.com
Now send email to Mdug+1@gmail.com using different account. you will receive mail at Mdug@gmail.com because in gmail Mdug+anything@gmail.com == Mdug@gmail.com.
Every time you have to read latest mail in Mdug@gmail.com because every verification code will go there
Instead of using random number you can append (Epoch)timestamp after + in email id because it will always be unique
Thanks for your comment. the timestamp is a much better idea then increment by 1 each time. Iv managed to create the string and it now add the time and date within the email address each time its created, this also allows me to know if its the correct email i'm looking at as there can occasionally. Problem solved, thanks all
– M.Dug
Jan 3 at 13:49
integration with third party email sounds awfully slow and fragile,.,.. I'd avoid his
– Corey Goldberg
Jan 3 at 18:03
@CoreyGoldberg yea i agree, i didn't go with something like gmail but i have used my companies email. this issue is now solved for me. thanks all
– M.Dug
Jan 4 at 9:37
add a comment |
You can use a dedicated gmail account and before using it you can append +timestamp in it.
example:
let's say you have a account on gmail ABC@gmail.com
Now, every time you use this email for verification append ABC+timestamp@gmail.com this email is new for you application but you will always receive verification code on ABC@gmail. you can read ABC@gmail every time for the latest mail for verification. I have used this methods and it works fine with gmail.
Try to test it manually make and gmail account with any name say Mdug@gmail.com
Now send email to Mdug+1@gmail.com using different account. you will receive mail at Mdug@gmail.com because in gmail Mdug+anything@gmail.com == Mdug@gmail.com.
Every time you have to read latest mail in Mdug@gmail.com because every verification code will go there
Instead of using random number you can append (Epoch)timestamp after + in email id because it will always be unique
Thanks for your comment. the timestamp is a much better idea then increment by 1 each time. Iv managed to create the string and it now add the time and date within the email address each time its created, this also allows me to know if its the correct email i'm looking at as there can occasionally. Problem solved, thanks all
– M.Dug
Jan 3 at 13:49
integration with third party email sounds awfully slow and fragile,.,.. I'd avoid his
– Corey Goldberg
Jan 3 at 18:03
@CoreyGoldberg yea i agree, i didn't go with something like gmail but i have used my companies email. this issue is now solved for me. thanks all
– M.Dug
Jan 4 at 9:37
add a comment |
You can use a dedicated gmail account and before using it you can append +timestamp in it.
example:
let's say you have a account on gmail ABC@gmail.com
Now, every time you use this email for verification append ABC+timestamp@gmail.com this email is new for you application but you will always receive verification code on ABC@gmail. you can read ABC@gmail every time for the latest mail for verification. I have used this methods and it works fine with gmail.
Try to test it manually make and gmail account with any name say Mdug@gmail.com
Now send email to Mdug+1@gmail.com using different account. you will receive mail at Mdug@gmail.com because in gmail Mdug+anything@gmail.com == Mdug@gmail.com.
Every time you have to read latest mail in Mdug@gmail.com because every verification code will go there
Instead of using random number you can append (Epoch)timestamp after + in email id because it will always be unique
You can use a dedicated gmail account and before using it you can append +timestamp in it.
example:
let's say you have a account on gmail ABC@gmail.com
Now, every time you use this email for verification append ABC+timestamp@gmail.com this email is new for you application but you will always receive verification code on ABC@gmail. you can read ABC@gmail every time for the latest mail for verification. I have used this methods and it works fine with gmail.
Try to test it manually make and gmail account with any name say Mdug@gmail.com
Now send email to Mdug+1@gmail.com using different account. you will receive mail at Mdug@gmail.com because in gmail Mdug+anything@gmail.com == Mdug@gmail.com.
Every time you have to read latest mail in Mdug@gmail.com because every verification code will go there
Instead of using random number you can append (Epoch)timestamp after + in email id because it will always be unique
answered Jan 3 at 13:46
rishav prasherrishav prasher
615
615
Thanks for your comment. the timestamp is a much better idea then increment by 1 each time. Iv managed to create the string and it now add the time and date within the email address each time its created, this also allows me to know if its the correct email i'm looking at as there can occasionally. Problem solved, thanks all
– M.Dug
Jan 3 at 13:49
integration with third party email sounds awfully slow and fragile,.,.. I'd avoid his
– Corey Goldberg
Jan 3 at 18:03
@CoreyGoldberg yea i agree, i didn't go with something like gmail but i have used my companies email. this issue is now solved for me. thanks all
– M.Dug
Jan 4 at 9:37
add a comment |
Thanks for your comment. the timestamp is a much better idea then increment by 1 each time. Iv managed to create the string and it now add the time and date within the email address each time its created, this also allows me to know if its the correct email i'm looking at as there can occasionally. Problem solved, thanks all
– M.Dug
Jan 3 at 13:49
integration with third party email sounds awfully slow and fragile,.,.. I'd avoid his
– Corey Goldberg
Jan 3 at 18:03
@CoreyGoldberg yea i agree, i didn't go with something like gmail but i have used my companies email. this issue is now solved for me. thanks all
– M.Dug
Jan 4 at 9:37
Thanks for your comment. the timestamp is a much better idea then increment by 1 each time. Iv managed to create the string and it now add the time and date within the email address each time its created, this also allows me to know if its the correct email i'm looking at as there can occasionally. Problem solved, thanks all
– M.Dug
Jan 3 at 13:49
Thanks for your comment. the timestamp is a much better idea then increment by 1 each time. Iv managed to create the string and it now add the time and date within the email address each time its created, this also allows me to know if its the correct email i'm looking at as there can occasionally. Problem solved, thanks all
– M.Dug
Jan 3 at 13:49
integration with third party email sounds awfully slow and fragile,.,.. I'd avoid his
– Corey Goldberg
Jan 3 at 18:03
integration with third party email sounds awfully slow and fragile,.,.. I'd avoid his
– Corey Goldberg
Jan 3 at 18:03
@CoreyGoldberg yea i agree, i didn't go with something like gmail but i have used my companies email. this issue is now solved for me. thanks all
– M.Dug
Jan 4 at 9:37
@CoreyGoldberg yea i agree, i didn't go with something like gmail but i have used my companies email. this issue is now solved for me. thanks all
– M.Dug
Jan 4 at 9:37
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54021508%2fcreating-a-method-to-increment-a-number-within-an-email%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
if you know how to do increment one, you know how to do this. it's just that, added with a simple String concatenation
– Stultuske
Jan 3 at 11:37
you can have a look at the following answer. stackoverflow.com/questions/45841500/generate-random-emails
– joemokenela
Jan 3 at 11:44
@joemokenela according to the question, that is not what he's looking for
– Stultuske
Jan 3 at 11:55
All, thanks for comments @Stultuske, its the creation of the string im having problems with and incorporating the incremented number into the email.
– M.Dug
Jan 3 at 13:27
@joemokenela im not after a random email as i need it related to the account im using. thanks
– M.Dug
Jan 3 at 13:28