Hello everyone,
I’ve been trying to make the method work on CRM, but it doesn’t seem to be able to locate the text. Basically what I’ve been trying to do is to see if the record I’ve created from the Portal side of my website is also created in CRM Dynamics. Then once it’s been found, click on that element.
Here, it shows that the name of the record is saved in my variable:
Here, it shows that my record is created in CRM:
The error i got is this:
02-25-2019 12:49:01 PM Test Cases/CRM PMT6
Elapsed time: 1m - 24,535s
Test Cases/CRM PMT6 FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to verify text 'LDT EXP 25/02/2019 12:49' is present using regular expression (Root cause: com.kms.katalon.core.exception.StepFailedException: Text 'LDT EXP 25/02/2019 12:49' is not present on page using regular expression)
at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:36)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:65)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:27)
at com.kms.katalon.core.webui.keyword.builtin.VerifyTextPresentKeyword.verifyTextPresent(VerifyTextPresentKeyword.groovy:83)
at com.kms.katalon.core.webui.keyword.builtin.VerifyTextPresentKeyword.execute(VerifyTextPresentKeyword.groovy:68)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:53)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyTextPresent(WebUiBuiltInKeywords.groovy:1693)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$verifyTextPresent$8.call(Unknown Source)
at CRM PMT6.run(CRM PMT6:42)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:319)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:298)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:290)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:224)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:106)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:97)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1551116938175.run(TempTestCase1551116938175.groovy:22)
My code:
import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable
WebUI.callTestCase(findTestCase('Potato Export WIP - Copy'), [:], FailureHandling.STOP_ON_FAILURE)
//WebUI.openBrowser('')
WebUI.navigateToUrl('https://sts-sejs.dev.global.gc.ca/adfs/ls/?wa=wsignin1.0&wtrealm=https%3a%2f%2fesdp-test-cfia-acia-cdt.dev.global.gc.ca%2f&wctx=rm%3d1%26id%3d1c43765b-2449-446f-9093-f4ee73a7c593%26ru%3dhttps%253a%252f%252fesdp-test-cfia-acia-cdt.dev.global.gc.ca%252fmain.aspx%26crmorgid%3d8814f2eb-2d3e-e611-80ef-005056817939&wct=2019-02-19T16%3a34%3a50Z&wauth=urn%3aoasis%3anames%3atc%3aSAML%3a1.0%3aam%3apassword#364847500')
WebUI.setText(findTestObject('Object Repository/CRM PMT6/input_JavaScript requis_UserNa'), 'yoyo@why.ca')
WebUI.setEncryptedText(findTestObject('Object Repository/CRM PMT6/input_JavaScript requis_Passwo'), 'q7GPlJJ7WwlAGos1HEj2aT8r9TL5JOQZ')
WebUI.click(findTestObject('Object Repository/CRM PMT6/span_Connexion'))
WebUI.click(findTestObject('Object Repository/CRM PMT6/input_concat(Take a quick tour (1)'))
WebUI.click(findTestObject('CRM PMT6/a_Microsoft Dynamics CRM_butto'))
WebUI.mouseOver(findTestObject('CRM PMT6/a_Microsoft Dynamics CRM'))
WebUI.delay(1)
WebUI.click(findTestObject('CRM PMT6/a_Export'))
WebUI.mouseOver(findTestObject('CRM PMT6/span_Export'), FailureHandling.STOP_ON_FAILURE)
WebUI.delay(1);
WebUI.click(findTestObject('CRM PMT6/a_Cases'))
System.out.println(GlobalVariable.case_ID);
WebUI.verifyTextPresent(GlobalVariable.case_ID, true)
So I call the first Test Case and save a string value onto my Global Variable called “case_ID” and then use that variable to check if the text exists on CRM.
Can anyone help me figure out a workaround?