Hi,
thanks for the reply. Find below the code of the testlistener.
One more hint: I tried to pass to the openBrowser()-method the GlobalVariable (which was the original state), then I tried to pass it a single quoted, yet empty String (’’) and now I pass, as you can see, a double quoted, empty String. When I passed the Global Variable directly to the openBrowser()-method, the result and exception was the same.
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.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 com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import internal.GlobalVariable as GlobalVariable
import com.kms.katalon.core.annotation.BeforeTestCase
import com.kms.katalon.core.annotation.BeforeTestSuite
import com.kms.katalon.core.annotation.AfterTestCase
import com.kms.katalon.core.annotation.AfterTestSuite
import com.kms.katalon.core.context.TestCaseContext
import com.kms.katalon.core.context.TestSuiteContext
class TSuiteOpenCloseBrowser {
/**
* Executes before every test suite starts.
* @param testSuiteContext: related information of the executed test suite.
*/
@BeforeTestSuite
def sampleBeforeTestSuite(TestSuiteContext testSuiteContext) {
println testSuiteContext.getTestSuiteId()
WebUI.openBrowser("")
WebUI.navigateToUrl(GlobalVariable.G_URL_Home)
WebUI.click(findTestObject('BWR17_Overlay/span_acceptCookiesButton'))
WebUI.maximizeWindow()
CustomKeywords.'com.at.util.LoginLogout.login'(GlobalVariable.G_User1, GlobalVariable.G_PW_MwendlerG_User1)
CustomKeywords.'com.at.util.FinalCheck.checkOverlay'()
CustomKeywords.'com.at.util.LoginLogout.logout'()
CustomKeywords.'com.at.util.LoginLogout.login'(GlobalVariable.G_User2, GlobalVariable.G_PW_User2)
CustomKeywords.'com.at.util.FinalCheck.checkOverlay'()
CustomKeywords.'com.at.util.LoginLogout.logout'()
WebUI.navigateToUrl(GlobalVariable.G_URL_Home)
}
/**
* Executes after every test suite ends.
* @param testSuiteContext: related information of the executed test suite.
*/
@AfterTestSuite
def sampleAfterTestSuite(TestSuiteContext testSuiteContext) {
println testSuiteContext.getTestSuiteId()
WebUI.navigateToUrl(GlobalVariable.G_URL_Home)
CustomKeywords.'com.at.util.LoginLogout.login'(GlobalVariable.G_User1, GlobalVariable.G_PW_User1)
CustomKeywords.'com.at.util.FinalCheck.checkOverlay'()
CustomKeywords.'com.at.util.LoginLogout.logout'()
CustomKeywords.'com.at.util.LoginLogout.login'(GlobalVariable.G_User2, GlobalVariable.G_PW_User2)
CustomKeywords.'com.at.util.FinalCheck.checkOverlay'()
CustomKeywords.'com.at.util.LoginLogout.logout'()
WebUI.closeBrowser()
}
}