Staying logged into a site

Hi All

Thank you for taking the time to ready my post. Here is my issue that i can’t figure out how to make work.

I am testing a website which you need to log into to access the pages we need to test.

The issue is I need to stay logged into the site and not re-log into with each time my test case runs.

Right now I have a test case where the

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.checkpoint.CheckpointFactory as CheckpointFactory

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords

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.testcase.TestCaseFactory as TestCaseFactory

import com.kms.katalon.core.testdata.TestData as TestData

import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory

import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository

import com.kms.katalon.core.testobject.TestObject as TestObject

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import internal.GlobalVariable as GlobalVariable

import org.openqa.selenium.Keys as Keys

WebUI.openBrowser(‘’)

WebUI.navigateToUrl('{This is the start page URL)

WebUI.setText(findTestObject(‘(1)/input_mat-input-0’), ‘{Username}’)

WebUI.setText(findTestObject(‘(1)/input_mat-input-1’), ‘{Password}’)

WebUI.click(findTestObject(‘(1)/div_mat-checkbox-inner-contain’))

WebUI.click(findTestObject(‘(1)/button_Sign In’))

WebUI.waitForPageLoad(10)

WebUI.navigateToUrl(varURL)

WebUI.switchToWindowTitle(‘Products’)

WebUI.click(findTestObject(‘-/a_Revise Content’))

WebUI.click(findTestObject(‘-/a_Edit Content’))

WebUI.click(findTestObject(‘- (1)/input_saveAndExit’))

WebUI.click(findTestObject(‘-/a_Publish’))

WebUI.click(findTestObject(‘-/input_action-submit’))

And it works great the first time through but when the test suit goes to the next page we are starting all over and I need to log back in again which kill the session

Is there a way to either link the profile from my chrome browser to the driver so the site will see the cookie not need to re log in

Or maintain the session for I am not logged out?

Also if I maintain the session then I assume I need to run two test cases one that first logs into the site then a second that goes to the page and performs the steps?

Thank you again for your help

In this case, the next test cases after the first one should not include ‘Open Browser’ step, otherwise it will open a new session and you will have to login again.

^ also make sure it doesn’t close the browser in the first test case.