Forgot Password

I wants to automate forgot password scenario but I cant understand how can I track my email inbox message and read the forgot password link then click on that link and set new password from that link.
Andrej, Can you please look into this?
I found some differences in your code you have not used ‘value’ while fetching value from that email site

nazneen, like really?
ok, i’ll write high level scenario you can use, but now you should have enough knowledge to make it happen by yourself
you will need: 10minute mail service - just google it
1. create new mail account on 10minute mail service
2. with created mail register yourself to your application
3. logout
4. try forgot password link
5. open 10 minute mail page - mail will be there
6. parse/process check
7. finish process of retrieving password in your app

advantages - 10 minute mail is webapp so you should be able to access it using Katalon
it’s fast enough to be used in such test
disadvantage - security - sendind login/password to world - in case it’s not live app - you need to decide

using solution with google or other mail services required programming on rest api level and i dont think this will be way to go for you. (or undertaken by me)

Andrej, But before proceeding to forgot password, I got stuck in Sign Up page. Please help me on the below page:
http://forum.katalon.com/discussion/7846/sign-up#latest

Thanks,

nazneen said:

I wants to automate forgot password scenario but I cant understand how can I track my email inbox message and read the forgot password link then click on that link and set new password from that link.

So for this,

I am using temp email which is generated random email id but my concern is how can I get that random email id value and use it into my forgot password page and before go to forgot password I need to do sign up each time for random email ids. So am I on the right track?

If yes then, I am using here two tab for two different window one for temp email and one for my site page where I need to first create sign up and then click on forgot password. Also I am using two test cases for managing two different scenarios.

Here are my code:
//----------------------- Test Case 1…for creating tem email

WebUI.openBrowser(’’)

WebUI.navigateToUrl(‘https://temp-mail.org/en/’)

WebUI.callTestCase(findTestCase(‘Forgot Password’),[(‘path’):‘https://www.workilo.com/’]

//-- for storing the random email id into text variable
text = WebUI.getAttribute(findTestObject(‘Object Repository/Forgot Password/Page_Temp Mail - Disposable Tempora/input_mail’), ‘value’)

return text

//------------------------Test Case 2…For creating sign up and then forgot password

String currentPage = WebUI.getUrl()

int currentTab = WebUI.getWindowIndex()

WebDriver driver = DriverFactory.getWebDriver()

JavascriptExecutor js = ((driver) as JavascriptExecutor)

js.executeScript(‘window.open();’)

WebUI.switchToWindowIndex(currentTab + 1)

WebUI.navigateToUrl(path)

WebUI.maximizeWindow()

WebUI.waitForElementVisible(findTestObject(‘Page_Workilo Welcome/a_Sign Up (1)’), 0)

WebUI.click(findTestObject(‘Page_Workilo Welcome/a_Sign Up (1)’))

WebUI.click(findTestObject(‘Page_Workilo Welcome/a_Customer (1)’))

String returnText= WebUI.callTestCase(‘Create Tem Email’)

WebUI.setText(findTestObject(‘Page_Workilo Welcome/input_email_address (1)’), ‘text’)

But the above line not works and show errors. I also think this is not the correct way to call any value.Kindly Help @Andrej Podhajský or any senior expertise…

Thanks,

nazneen,
setup global variable so you can hand over value you need
also last command 2nd parameter would be without ‘’ around it

WebUI.setText(findTestObject('Page_Workilo  Welcome/input_email_address (1)'), returnText)

Showing this error:
Test Cases/Create Tem Email FAILED because (of) groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.callTestCase() is applicable for argument types: (java.lang.String) values: [Create Tem Email]

Possible solutions: callTestCase(com.kms.katalon.core.testcase.TestCase, java.util.Map), callTestCase(com.kms.katalon.core.testcase.TestCase, java.util.Map, com.kms.katalon.core.model.FailureHandling)

did you try global variables?

Andrej Podhajský said:

did you try global variables?

How can I apply Global variable after getting email from the temp email site?

Here is my code for getting text:

def varTemEmail = WebUI.getAttribute(findTestObject(‘Object Repository/Forgot Password/Page_Temp Mail - Disposable Tempora/input_mail’), ‘value’)

return varTemEmail

okay So what I did is mentioned below:

////…declare global variable:


--------Create Temp Email Test case 1

WebUI.openBrowser(‘’)

WebUI.navigateToUrl(‘https://temp-mail.org/en/’)

WebUI.waitForPageLoad(5)

WebUI.callTestCase(findTestCase(‘ForgotPassword’),[(‘path’):‘https://www.workilo.com/’])

def varTemEmail = WebUI.getAttribute(findTestObject(‘Object Repository/Forgot Password/Page_Temp Mail - Disposable Tempora/input_mail’), ‘value’)

return varTemEmail

//-------Declare global variable in another test case forgot passw

WebUI.setText(findTestObject(‘Page_Workilo Welcome/input_email_address (1)’),GlobalVariable.varTemEmail )

and the error generated:

Test Cases/CreateTemEmail FAILED because (of) Unable to set text ‘null’ of object ‘Object Repository/Page_Workilo Welcome/input_email_address (1)’ (Root cause: java.lang.IllegalArgumentException: Text is null)

Looking for urgently help @Andrej Podhajský

global var.png

TC1:

GlobalVariable.varTemEmail = WebUI.getAttribute(findTestObject('Object Repository/Forgot Password/Page_Temp Mail - Disposable Tempora/input_mail'), 'value')

Found this error:

Test Cases/CreateTemEmail FAILED because (of) Unable to set text ‘null’ of object ‘Object Repository/Page_Workilo Welcome/input_email_address (1)’ (Root cause: java.lang.IllegalArgumentException: Text is null)

please try following and post console output

GlobalVariable.varTemEmail = WebUI.getAttribute(findTestObject('Object Repository/Forgot Password/Page_Temp Mail - Disposable Tempora/input_mail'), 'value')
println GlobalVariable.varTemEmail

Unable to set text ‘null’ of object ‘Object Repository/Forgot Password/input_mail’ (Root cause: java.lang.IllegalArgumentException: Text is null)

07-17-2018 07:14:54 PM - [END] - End action : setText

07-17-2018 07:14:54 PM - [FAILED] - Test Cases/ForgotPassword FAILED because (of) Unable to set text ‘null’ of object ‘Object Repository/Forgot Password/input_mail’ (Root cause: java.lang.IllegalArgumentException: Text is null)

07-17-2018 07:14:54 PM - [END] - End Test Case : Test Cases/ForgotPassword

07-17-2018 07:14:54 PM - [FAILED] - Unable to call Test Case with id ‘Test Cases/ForgotPassword’ (Root cause: Call Test Case ‘Test Cases/ForgotPassword’ failed)

07-17-2018 07:14:54 PM - [END] - End action : callTestCase

07-17-2018 07:14:54 PM - [FAILED] - Test Cases/CreateTemEmail FAILED because (of) Unable to set text ‘null’ of object ‘Object Repository/Forgot Password/input_mail’ (Root cause: java.lang.IllegalArgumentException: Text is null)

07-17-2018 07:14:54 PM - [END] - End Test Case : Test Cases/CreateTemEmail

nazneen,

Here are my code:
//----------------------- Test Case 1…for creating tem email
WebUI.openBrowser(’’)
WebUI.navigateToUrl('https://temp-mail.org/en/’)
WebUI.callTestCase(findTestCase(‘Forgot Password’),[(‘path’):'https://www.workilo.com/’]
//-- for storing the random email id into text variable
text = WebUI.getAttribute(findTestObject(‘Object Repository/Forgot Password/Page_Temp Mail - Disposable Tempora/input_mail’), ‘value’)
return text
//------------------------Test Case 2…For creating sign up and then forgot password
String currentPage = WebUI.getUrl()
int currentTab = WebUI.getWindowIndex()
WebDriver driver = DriverFactory.getWebDriver()
JavascriptExecutor js = ((driver) as JavascriptExecutor)
js.executeScript(‘window.open();’)
WebUI.switchToWindowIndex(currentTab + 1)
WebUI.navigateToUrl(path)
WebUI.maximizeWindow()
WebUI.waitForElementVisible(findTestObject(‘Page_Workilo Welcome/a_Sign Up (1)’), 0)
WebUI.click(findTestObject(‘Page_Workilo Welcome/a_Sign Up (1)’))
WebUI.click(findTestObject(‘Page_Workilo Welcome/a_Customer (1)’))
String returnText= WebUI.callTestCase(‘Create Tem Email’)
WebUI.setText(findTestObject(‘Page_Workilo Welcome/input_email_address (1)’), ‘text’)

in TC1 you are trying to read temp. email that will be used in TC2? if yes, call for TC2 must be after setting variable with temporary email address

Andrej Podhajský said:

nazneen,

Here are my code:
//----------------------- Test Case 1…for creating tem email
WebUI.openBrowser(‘’)
WebUI.navigateToUrl('https://temp-mail.org/en/')
WebUI.callTestCase(findTestCase(‘Forgot Password’),[(‘path’):'https://www.workilo.com/']
//-- for storing the random email id into text variable
text = WebUI.getAttribute(findTestObject(‘Object Repository/Forgot Password/Page_Temp Mail - Disposable Tempora/input_mail’), ‘value’)
return text
//------------------------Test Case 2…For creating sign up and then forgot password
String currentPage = WebUI.getUrl()
int currentTab = WebUI.getWindowIndex()
WebDriver driver = DriverFactory.getWebDriver()
JavascriptExecutor js = ((driver) as JavascriptExecutor)
js.executeScript(‘window.open();’)
WebUI.switchToWindowIndex(currentTab + 1)
WebUI.navigateToUrl(path)
WebUI.maximizeWindow()
WebUI.waitForElementVisible(findTestObject(‘Page_Workilo Welcome/a_Sign Up (1)’), 0)
WebUI.click(findTestObject(‘Page_Workilo Welcome/a_Sign Up (1)’))
WebUI.click(findTestObject(‘Page_Workilo Welcome/a_Customer (1)’))
String returnText= WebUI.callTestCase(‘Create Tem Email’)
WebUI.setText(findTestObject(‘Page_Workilo Welcome/input_email_address (1)’), ‘text’)

in TC1 you are trying to read temp. email that will be used in TC2? if yes, call for TC2 must be after setting variable with temporary email address

Yes in 2nd test case testcase 1 is used only to read dynamic email which is generated randomly and that’s why I have used global variable to store that value and then used that global value in test case 2.
Please see the below screenshots for global definition

and I have already called 2nd into 1 test case. So should it be right approach to again call 1st test case into 2nd???

i mean TC1 should look something like:

WebUI.openBrowser('')
WebUI.navigateToUrl('https://temp-mail.org/en/')
//-- for storing the random email id into text variable
GlobalVariable.varTemEmail = WebUI.getAttribute(findTestObject('Object Repository/Forgot Password/Page_Temp Mail - Disposable Tempora/input_mail'), 'value')
println GlobalVariable.varTemEmail
WebUI.callTestCase(findTestCase('Forgot Password'),[('path'):'https://www.workilo.com/']

I have pasted your above code but it throw this error:

Test Cases/CreateTemEmail FAILED because (of) Unable to get attribute ‘value’ of object ‘Object Repository/Forgot Password/Page_Temp Mail - Disposable Tempora/input_mail’ (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Forgot Password/Page_Temp Mail - Disposable Tempora/input_mail’ located by ‘By.xpath: id(“mail”)[count(. | //[@value = ‘tidefobum@99pubblicita.com’]) = count(//[@value = ‘tidefobum@99pubblicita.com’])]’ not found)

in definition of test object
‘Object Repository/Forgot Password/Page_Temp Mail - Disposable Tempora/input_mail’
set xpath to id(“mail”)

again found issue:
Test Cases/CreateTemEmail FAILED because (of) Unable to get attribute ‘value’ of object ‘Object Repository/Forgot Password/Page_Temp Mail - Disposable Tempora/input_mail’ (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/Forgot Password/Page_Temp Mail - Disposable Tempora/input_mail’ located by ‘By.xpath: id(“mail”)[count(. | //[@value = ‘tidefobum@99pubblicita.com’]) = count(//[@value = ‘tidefobum@99pubblicita.com’])]’ not found)

i already told you what to do … setup correct xpath to object … script cannot find your object