diff --git a/Object Repository/Page_My ID/a_Sign out.rs b/Object Repository/Page_My ID/a_Sign out.rs new file mode 100644 index 0000000000000000000000000000000000000000..d7775277a9b3c8cbbff0660e63613b2a677baaee --- /dev/null +++ b/Object Repository/Page_My ID/a_Sign out.rs @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebElementEntity> + <description></description> + <name>a_Sign out</name> + <tag></tag> + <elementGuidId>957a67ed-093c-434b-8c87-91c659be40ba</elementGuidId> + <selectorCollection> + <entry> + <key>CSS</key> + <value></value> + </entry> + <entry> + <key>XPATH</key> + <value>//ul[@id='side-menu']/li[7]/a</value> + </entry> + </selectorCollection> + <selectorMethod>XPATH</selectorMethod> + <useRalativeImagePath>true</useRalativeImagePath> + <webElementProperties> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>tag</name> + <type>Main</type> + <value>a</value> + </webElementProperties> + <webElementProperties> + <isSelected>true</isSelected> + <matchCondition>equals</matchCondition> + <name>href</name> + <type>Main</type> + <value>https://myid.buu.ac.th/profile/signout</value> + </webElementProperties> + <webElementProperties> + <isSelected>true</isSelected> + <matchCondition>equals</matchCondition> + <name>text</name> + <type>Main</type> + <value> ออกจากระบบ Sign out</value> + </webElementProperties> + <webElementProperties> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath</name> + <type>Main</type> + <value>id("side-menu")/li[7]/a[1]</value> + </webElementProperties> + <webElementXpaths> + <isSelected>true</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath:idRelative</name> + <type>Main</type> + <value>//ul[@id='side-menu']/li[7]/a</value> + </webElementXpaths> + <webElementXpaths> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath:neighbor</name> + <type>Main</type> + <value>//*/text()[normalize-space(.)='ออกจากระบบ']/parent::*</value> + </webElementXpaths> + <webElementXpaths> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath:href</name> + <type>Main</type> + <value>//a[contains(@href, 'https://myid.buu.ac.th/profile/signout')]</value> + </webElementXpaths> + <webElementXpaths> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath:position</name> + <type>Main</type> + <value>//li[7]/a</value> + </webElementXpaths> + <webElementXpaths> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath:customAttributes</name> + <type>Main</type> + <value>//a[@href = 'https://myid.buu.ac.th/profile/signout' and (text() = ' ออกจากระบบ Sign out' or . = ' ออกจากระบบ Sign out')]</value> + </webElementXpaths> +</WebElementEntity> diff --git a/Scripts/Logout/Script1647005708330.groovy b/Scripts/Logout/Script1647005708330.groovy new file mode 100644 index 0000000000000000000000000000000000000000..525b091f489ae976101a0575b4a3d7fc420b4693 --- /dev/null +++ b/Scripts/Logout/Script1647005708330.groovy @@ -0,0 +1,42 @@ +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 static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject +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.testng.keyword.TestNGBuiltinKeywords as TestNGKW +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.windows.keyword.WindowsBuiltinKeywords as Windows +import internal.GlobalVariable + +import org.junit.Assert +import org.openqa.selenium.Keys as Keys + +WebUI.openBrowser('') + +WebUI.navigateToUrl('https://myid.buu.ac.th/') + +WebUI.setText(findTestObject('Object Repository/Page_My ID/input_(Username)_user'), '62160299') + +WebUI.setEncryptedText(findTestObject('Object Repository/Page_My ID/input_(Password)_pass'), 'GwWY4dc3lpOeU9zC0JPIpw==') + +WebUI.click(findTestObject('Object Repository/Page_My ID/button_Sign in')) + +WebUI.click(findTestObject('Object Repository/Page_My ID/a_Sign out')) + +acturalUrl = WebUI.getUrl() + +expectedUrl = 'https://myid.buu.ac.th/' + + +Assert.assertEquals(expectedUrl, acturalUrl) + +WebUI.closeBrowser() + diff --git a/Test Cases/Logout.tc b/Test Cases/Logout.tc new file mode 100644 index 0000000000000000000000000000000000000000..a8330cbbd356225180d3e7c794c13bc1463d047e --- /dev/null +++ b/Test Cases/Logout.tc @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<TestCaseEntity> + <description></description> + <name>Logout</name> + <tag></tag> + <comment></comment> + <testCaseGuid>1ad64481-9c2d-4777-ad35-b4894687f0a2</testCaseGuid> +</TestCaseEntity>