From a20da4578fe66c867138e446bdcc2c25679bf97b Mon Sep 17 00:00:00 2001 From: Watcharanat Klinkeson <62160299@go.buu.ac.th> Date: Fri, 11 Mar 2022 20:03:31 +0700 Subject: [PATCH] change pass fail 1 --- ... 25 Password more than 8 - 25 character.rs | 103 ++ ...navigation _59e80b.rs | 878 ++++++++++++++++++ .../Script1647003203026.groovy | 49 + Test Cases/Change Password Fail1.tc | 8 + 4 files changed, 1038 insertions(+) create mode 100644 Object Repository/Page_My ID/div_8 25 Password more than 8 - 25 character.rs create mode 100644 Object Repository/Page_My ID/div_Toggle navigation _59e80b.rs create mode 100644 Scripts/Change Password Fail1/Script1647003203026.groovy create mode 100644 Test Cases/Change Password Fail1.tc diff --git a/Object Repository/Page_My ID/div_8 25 Password more than 8 - 25 character.rs b/Object Repository/Page_My ID/div_8 25 Password more than 8 - 25 character.rs new file mode 100644 index 0000000..01c2bae --- /dev/null +++ b/Object Repository/Page_My ID/div_8 25 Password more than 8 - 25 character.rs @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebElementEntity> + <description></description> + <name>div_8 25 Password more than 8 - 25 character</name> + <tag></tag> + <elementGuidId>223cba38-6e67-4b0a-83a9-4869b072edcf</elementGuidId> + <selectorCollection> + <entry> + <key>CSS</key> + <value>div.alert.alert-danger.text-center</value> + </entry> + <entry> + <key>XPATH</key> + <value>//small[@id='alert-js']/div</value> + </entry> + </selectorCollection> + <selectorMethod>XPATH</selectorMethod> + <useRalativeImagePath>true</useRalativeImagePath> + <webElementProperties> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>tag</name> + <type>Main</type> + <value>div</value> + </webElementProperties> + <webElementProperties> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>class</name> + <type>Main</type> + <value>alert alert-danger text-center</value> + </webElementProperties> + <webElementProperties> + <isSelected>true</isSelected> + <matchCondition>equals</matchCondition> + <name>text</name> + <type>Main</type> + <value>รหัสผ่านของท่านต้องมีความยาวขั้นต่ำ 8 ตัวอักษร แต่ไม่เกิน 25 ตัวอักษรPassword more than 8 - 25 character</value> + </webElementProperties> + <webElementProperties> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath</name> + <type>Main</type> + <value>id("alert-js")/div[@class="alert alert-danger text-center"]</value> + </webElementProperties> + <webElementXpaths> + <isSelected>true</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath:idRelative</name> + <type>Main</type> + <value>//small[@id='alert-js']/div</value> + </webElementXpaths> + <webElementXpaths> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath:neighbor</name> + <type>Main</type> + <value>(.//*[normalize-space(text()) and normalize-space(.)='number'])[1]/following::div[1]</value> + </webElementXpaths> + <webElementXpaths> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath:neighbor</name> + <type>Main</type> + <value>(.//*[normalize-space(text()) and normalize-space(.)='symbol'])[1]/following::div[1]</value> + </webElementXpaths> + <webElementXpaths> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath:neighbor</name> + <type>Main</type> + <value>(.//*[normalize-space(text()) and normalize-space(.)='Change Password'])[1]/preceding::div[1]</value> + </webElementXpaths> + <webElementXpaths> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath:neighbor</name> + <type>Main</type> + <value>(.//*[normalize-space(text()) and normalize-space(.)='© 2018 COMPUTER CENTER BURAPHA UNIVERSITY ALL RIGHTS RESERVED.'])[1]/preceding::div[9]</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:position</name> + <type>Main</type> + <value>//small/div</value> + </webElementXpaths> + <webElementXpaths> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath:customAttributes</name> + <type>Main</type> + <value>//div[(text() = 'รหัสผ่านของท่านต้องมีความยาวขั้นต่ำ 8 ตัวอักษร แต่ไม่เกิน 25 ตัวอักษรPassword more than 8 - 25 character' or . = 'รหัสผ่านของท่านต้องมีความยาวขั้นต่ำ 8 ตัวอักษร แต่ไม่เกิน 25 ตัวอักษรPassword more than 8 - 25 character')]</value> + </webElementXpaths> +</WebElementEntity> diff --git a/Object Repository/Page_My ID/div_Toggle navigation _59e80b.rs b/Object Repository/Page_My ID/div_Toggle navigation _59e80b.rs new file mode 100644 index 0000000..c52c2d5 --- /dev/null +++ b/Object Repository/Page_My ID/div_Toggle navigation _59e80b.rs @@ -0,0 +1,878 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebElementEntity> + <description></description> + <name>div_Toggle navigation _59e80b</name> + <tag></tag> + <elementGuidId>55fa78ff-5522-4d86-b280-6bc76d31b2cc</elementGuidId> + <selectorCollection> + <entry> + <key>CSS</key> + <value>#wrapper</value> + </entry> + <entry> + <key>XPATH</key> + <value>//div[@id='wrapper']</value> + </entry> + </selectorCollection> + <selectorMethod>XPATH</selectorMethod> + <useRalativeImagePath>true</useRalativeImagePath> + <webElementProperties> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>tag</name> + <type>Main</type> + <value>div</value> + </webElementProperties> + <webElementProperties> + <isSelected>true</isSelected> + <matchCondition>equals</matchCondition> + <name>id</name> + <type>Main</type> + <value>wrapper</value> + </webElementProperties> + <webElementProperties> + <isSelected>true</isSelected> + <matchCondition>equals</matchCondition> + <name>text</name> + <type>Main</type> + <value> + + + + + + Toggle navigation + + + + + + + + + + + + + + + + + + + + + + + ข้อมูลส่วนบุคคล Profile + + + + ลงทะเบียนอีเมล + Register e-mail + + + เปลี่ยนรหัสผ่าน/ต่ออายุรหัสผ่าน Change Password/Renew password + + + Short URL Short URL + + + บัญชีอีเมลส่วนงาน email official + + + + ติดต่อเรา Contact Us + + + ออกจากระบบ Sign out + + + คู่มือการใช้งาน Manual + + + คู่มือ Digital Cert for Windows + + + คู่มือ Digital Cert for Mac + + + + + + + + + + + + +/* Style the container for inputs */ +.container { + background-color: #f1f1f1; + padding: 20px; +} + +/* The message box is shown when the user clicks on the password field */ +#message { + display:none; + background: #f1f1f1; + color: #000; + position: relative; + padding: 20px; + margin-top: 10px; +} + +#message p { + padding: 10px 35px; + font-size: 18px; +} + +/* Add a green text color and a checkmark when the requirements are right */ +.valid { + color: green; +} + +.valid:before { + position: relative; + left: -35px; + content: "✔"; +} + +/* Add a red text color and an "x" when the requirements are wrong */ +.invalid { + color: red; +} + +.invalid:before { + position: relative; + left: -35px; + content: "✖"; +} + +เปลี่ยนรหัสผ่าน (Change Password) + + + + + + + คำแนะนำ + รหัสผ่านต้องไม่น้อยกว่า 8 ตัวอักษร แต่ไม่เกิน 25 ตัวอักษร + รหัสผ่านต้องประกอบด้วย 3 สิ่ง ดังต่อไปนี้ + - ตัวอักษรภาษาอังกฤษตัวใหญ่หรือเล็ก (A-Z, a-z) + - ตัวเลข (0-9) + - อักขระพิเศษ (! " # $ % & ( ) * + , - . / : ; < = > ? @ [ ] ^ _ ` { | } ~) + + [Password Rules and Requirements] + Your password must contain ALL of the following: + - A minimum of 8 characters (maximum 25) + - Contain at least 1 uppercase or lowercase letter (A-Z, a-z) + - Contain at least 1 number (0-9) + - Contain at least 1 symbol (! " # $ % & ( ) * + , - . / : ; < = > ? @ [ ] ^ _ ` { | } ~) + + + บัญชีผู้ใช้ (Username) + + + + + รหัสผ่านใหม่ (New Password) + + + + + รหัสผ่านใหม่อีกครั้ง (Re-New Password) + + + Show Password + + + Password must contain the following (รหัสผ่านประกอบไปด้วย) : + A lowercase or uppercase letter (ตัวอักษรตัวเล็กหรือตัวใหญ่) + A symbol letter (อักขระพิเศษ) + A number (ตัวเลข) + Minimum 8 characters (ขั้นต่ำ 8 ตัว) + + + + + + + Change Password + + + + + + + + + + + + +function myFunction() { + var x = document.getElementById("newpass"); + var y = document.getElementById("renewpass"); + if (x.type === "password") { + x.type = "text"; + y.type = "text"; + } else { + x.type = "password"; + y.type = "password"; + } +} + +function check(event){ + var ew = event.which; + + if(33 <= ew && ew <= 38) + return true; + if(40 <= ew && ew <= 126) + return true; + if(ew == 39){ + alert("Don't use ' (single quote) ห้ามใช้เครื่องหมาย ' (เขาเดี่ยว)"); + return false; + } + alert("กรุณาเปลี่ยนภาษา"); + return false; +} + +var myInput = document.getElementById("newpass"); +var letter = document.getElementById("letter"); +var capital = document.getElementById("capital"); +var number = document.getElementById("number"); +var length = document.getElementById("length"); + +// When the user clicks on the password field, show the message box +myInput.onfocus = function() { + document.getElementById("message").style.display = "block"; +} + +// When the user clicks outside of the password field, hide the message box +myInput.onblur = function() { + document.getElementById("message").style.display = "none"; +} + +// When the user starts to type something inside the password field +myInput.onkeyup = function() { + // Validate lowercase letters + var lowerCaseLetters = /[a-zA-Z]/g; + if(myInput.value.match(lowerCaseLetters)) { + letter.classList.remove("invalid"); + letter.classList.add("valid"); + } else { + letter.classList.remove("valid"); + letter.classList.add("invalid"); + } + + // Validate capital letters + var upperCaseLetters = /[\/\:\;\(\)\$\&\@\"\.\,\?\!\[\]\{\}\#\%\^\*\+\-\_\\\|\~\<\> ]{1,}/g; + if(myInput.value.match(upperCaseLetters)) { + capital.classList.remove("invalid"); + capital.classList.add("valid"); + } else { + capital.classList.remove("valid"); + capital.classList.add("invalid"); + } + + // Validate numbers + var numbers = /[0-9]/g; + if(myInput.value.match(numbers)) { + number.classList.remove("invalid"); + number.classList.add("valid"); + } else { + number.classList.remove("valid"); + number.classList.add("invalid"); + } + + // Validate length + if(myInput.value.length >= 8) { + length.classList.remove("invalid"); + length.classList.add("valid"); + } else { + length.classList.remove("valid"); + length.classList.add("invalid"); + } +} + + + + + + + + + + </value> + </webElementProperties> + <webElementProperties> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath</name> + <type>Main</type> + <value>id("wrapper")</value> + </webElementProperties> + <webElementXpaths> + <isSelected>true</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath:attributes</name> + <type>Main</type> + <value>//div[@id='wrapper']</value> + </webElementXpaths> + <webElementXpaths> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath:position</name> + <type>Main</type> + <value>//div</value> + </webElementXpaths> + <webElementXpaths> + <isSelected>false</isSelected> + <matchCondition>equals</matchCondition> + <name>xpath:customAttributes</name> + <type>Main</type> + <value>//div[@id = 'wrapper' and (text() = concat(" + + + + + + Toggle navigation + + + + + + + + + + + + + + + + + + + + + + + ข้อมูลส่วนบุคคล Profile + + + + ลงทะเบียนอีเมล + Register e-mail + + + เปลี่ยนรหัสผ่าน/ต่ออายุรหัสผ่าน Change Password/Renew password + + + Short URL Short URL + + + บัญชีอีเมลส่วนงาน email official + + + + ติดต่อเรา Contact Us + + + ออกจากระบบ Sign out + + + คู่มือการใช้งาน Manual + + + คู่มือ Digital Cert for Windows + + + คู่มือ Digital Cert for Mac + + + + + + + + + + + + +/* Style the container for inputs */ +.container { + background-color: #f1f1f1; + padding: 20px; +} + +/* The message box is shown when the user clicks on the password field */ +#message { + display:none; + background: #f1f1f1; + color: #000; + position: relative; + padding: 20px; + margin-top: 10px; +} + +#message p { + padding: 10px 35px; + font-size: 18px; +} + +/* Add a green text color and a checkmark when the requirements are right */ +.valid { + color: green; +} + +.valid:before { + position: relative; + left: -35px; + content: "✔"; +} + +/* Add a red text color and an "x" when the requirements are wrong */ +.invalid { + color: red; +} + +.invalid:before { + position: relative; + left: -35px; + content: "✖"; +} + +เปลี่ยนรหัสผ่าน (Change Password) + + + + + + + คำแนะนำ + รหัสผ่านต้องไม่น้อยกว่า 8 ตัวอักษร แต่ไม่เกิน 25 ตัวอักษร + รหัสผ่านต้องประกอบด้วย 3 สิ่ง ดังต่อไปนี้ + - ตัวอักษรภาษาอังกฤษตัวใหญ่หรือเล็ก (A-Z, a-z) + - ตัวเลข (0-9) + - อักขระพิเศษ (! " # $ % & ( ) * + , - . / : ; < = > ? @ [ ] ^ _ ` { | } ~) + + [Password Rules and Requirements] + Your password must contain ALL of the following: + - A minimum of 8 characters (maximum 25) + - Contain at least 1 uppercase or lowercase letter (A-Z, a-z) + - Contain at least 1 number (0-9) + - Contain at least 1 symbol (! " # $ % & ( ) * + , - . / : ; < = > ? @ [ ] ^ _ ` { | } ~) + + + บัญชีผู้ใช้ (Username) + + + + + รหัสผ่านใหม่ (New Password) + + + + + รหัสผ่านใหม่อีกครั้ง (Re-New Password) + + + Show Password + + + Password must contain the following (รหัสผ่านประกอบไปด้วย) : + A lowercase or uppercase letter (ตัวอักษรตัวเล็กหรือตัวใหญ่) + A symbol letter (อักขระพิเศษ) + A number (ตัวเลข) + Minimum 8 characters (ขั้นต่ำ 8 ตัว) + + + + + + + Change Password + + + + + + + + + + + + +function myFunction() { + var x = document.getElementById("newpass"); + var y = document.getElementById("renewpass"); + if (x.type === "password") { + x.type = "text"; + y.type = "text"; + } else { + x.type = "password"; + y.type = "password"; + } +} + +function check(event){ + var ew = event.which; + + if(33 <= ew && ew <= 38) + return true; + if(40 <= ew && ew <= 126) + return true; + if(ew == 39){ + alert("Don" , "'" , "t use " , "'" , " (single quote) ห้ามใช้เครื่องหมาย " , "'" , " (เขาเดี่ยว)"); + return false; + } + alert("กรุณาเปลี่ยนภาษา"); + return false; +} + +var myInput = document.getElementById("newpass"); +var letter = document.getElementById("letter"); +var capital = document.getElementById("capital"); +var number = document.getElementById("number"); +var length = document.getElementById("length"); + +// When the user clicks on the password field, show the message box +myInput.onfocus = function() { + document.getElementById("message").style.display = "block"; +} + +// When the user clicks outside of the password field, hide the message box +myInput.onblur = function() { + document.getElementById("message").style.display = "none"; +} + +// When the user starts to type something inside the password field +myInput.onkeyup = function() { + // Validate lowercase letters + var lowerCaseLetters = /[a-zA-Z]/g; + if(myInput.value.match(lowerCaseLetters)) { + letter.classList.remove("invalid"); + letter.classList.add("valid"); + } else { + letter.classList.remove("valid"); + letter.classList.add("invalid"); + } + + // Validate capital letters + var upperCaseLetters = /[\/\:\;\(\)\$\&\@\"\.\,\?\!\[\]\{\}\#\%\^\*\+\-\_\\\|\~\<\> ]{1,}/g; + if(myInput.value.match(upperCaseLetters)) { + capital.classList.remove("invalid"); + capital.classList.add("valid"); + } else { + capital.classList.remove("valid"); + capital.classList.add("invalid"); + } + + // Validate numbers + var numbers = /[0-9]/g; + if(myInput.value.match(numbers)) { + number.classList.remove("invalid"); + number.classList.add("valid"); + } else { + number.classList.remove("valid"); + number.classList.add("invalid"); + } + + // Validate length + if(myInput.value.length >= 8) { + length.classList.remove("invalid"); + length.classList.add("valid"); + } else { + length.classList.remove("valid"); + length.classList.add("invalid"); + } +} + + + + + + + + + + ") or . = concat(" + + + + + + Toggle navigation + + + + + + + + + + + + + + + + + + + + + + + ข้อมูลส่วนบุคคล Profile + + + + ลงทะเบียนอีเมล + Register e-mail + + + เปลี่ยนรหัสผ่าน/ต่ออายุรหัสผ่าน Change Password/Renew password + + + Short URL Short URL + + + บัญชีอีเมลส่วนงาน email official + + + + ติดต่อเรา Contact Us + + + ออกจากระบบ Sign out + + + คู่มือการใช้งาน Manual + + + คู่มือ Digital Cert for Windows + + + คู่มือ Digital Cert for Mac + + + + + + + + + + + + +/* Style the container for inputs */ +.container { + background-color: #f1f1f1; + padding: 20px; +} + +/* The message box is shown when the user clicks on the password field */ +#message { + display:none; + background: #f1f1f1; + color: #000; + position: relative; + padding: 20px; + margin-top: 10px; +} + +#message p { + padding: 10px 35px; + font-size: 18px; +} + +/* Add a green text color and a checkmark when the requirements are right */ +.valid { + color: green; +} + +.valid:before { + position: relative; + left: -35px; + content: "✔"; +} + +/* Add a red text color and an "x" when the requirements are wrong */ +.invalid { + color: red; +} + +.invalid:before { + position: relative; + left: -35px; + content: "✖"; +} + +เปลี่ยนรหัสผ่าน (Change Password) + + + + + + + คำแนะนำ + รหัสผ่านต้องไม่น้อยกว่า 8 ตัวอักษร แต่ไม่เกิน 25 ตัวอักษร + รหัสผ่านต้องประกอบด้วย 3 สิ่ง ดังต่อไปนี้ + - ตัวอักษรภาษาอังกฤษตัวใหญ่หรือเล็ก (A-Z, a-z) + - ตัวเลข (0-9) + - อักขระพิเศษ (! " # $ % & ( ) * + , - . / : ; < = > ? @ [ ] ^ _ ` { | } ~) + + [Password Rules and Requirements] + Your password must contain ALL of the following: + - A minimum of 8 characters (maximum 25) + - Contain at least 1 uppercase or lowercase letter (A-Z, a-z) + - Contain at least 1 number (0-9) + - Contain at least 1 symbol (! " # $ % & ( ) * + , - . / : ; < = > ? @ [ ] ^ _ ` { | } ~) + + + บัญชีผู้ใช้ (Username) + + + + + รหัสผ่านใหม่ (New Password) + + + + + รหัสผ่านใหม่อีกครั้ง (Re-New Password) + + + Show Password + + + Password must contain the following (รหัสผ่านประกอบไปด้วย) : + A lowercase or uppercase letter (ตัวอักษรตัวเล็กหรือตัวใหญ่) + A symbol letter (อักขระพิเศษ) + A number (ตัวเลข) + Minimum 8 characters (ขั้นต่ำ 8 ตัว) + + + + + + + Change Password + + + + + + + + + + + + +function myFunction() { + var x = document.getElementById("newpass"); + var y = document.getElementById("renewpass"); + if (x.type === "password") { + x.type = "text"; + y.type = "text"; + } else { + x.type = "password"; + y.type = "password"; + } +} + +function check(event){ + var ew = event.which; + + if(33 <= ew && ew <= 38) + return true; + if(40 <= ew && ew <= 126) + return true; + if(ew == 39){ + alert("Don" , "'" , "t use " , "'" , " (single quote) ห้ามใช้เครื่องหมาย " , "'" , " (เขาเดี่ยว)"); + return false; + } + alert("กรุณาเปลี่ยนภาษา"); + return false; +} + +var myInput = document.getElementById("newpass"); +var letter = document.getElementById("letter"); +var capital = document.getElementById("capital"); +var number = document.getElementById("number"); +var length = document.getElementById("length"); + +// When the user clicks on the password field, show the message box +myInput.onfocus = function() { + document.getElementById("message").style.display = "block"; +} + +// When the user clicks outside of the password field, hide the message box +myInput.onblur = function() { + document.getElementById("message").style.display = "none"; +} + +// When the user starts to type something inside the password field +myInput.onkeyup = function() { + // Validate lowercase letters + var lowerCaseLetters = /[a-zA-Z]/g; + if(myInput.value.match(lowerCaseLetters)) { + letter.classList.remove("invalid"); + letter.classList.add("valid"); + } else { + letter.classList.remove("valid"); + letter.classList.add("invalid"); + } + + // Validate capital letters + var upperCaseLetters = /[\/\:\;\(\)\$\&\@\"\.\,\?\!\[\]\{\}\#\%\^\*\+\-\_\\\|\~\<\> ]{1,}/g; + if(myInput.value.match(upperCaseLetters)) { + capital.classList.remove("invalid"); + capital.classList.add("valid"); + } else { + capital.classList.remove("valid"); + capital.classList.add("invalid"); + } + + // Validate numbers + var numbers = /[0-9]/g; + if(myInput.value.match(numbers)) { + number.classList.remove("invalid"); + number.classList.add("valid"); + } else { + number.classList.remove("valid"); + number.classList.add("invalid"); + } + + // Validate length + if(myInput.value.length >= 8) { + length.classList.remove("invalid"); + length.classList.add("valid"); + } else { + length.classList.remove("valid"); + length.classList.add("invalid"); + } +} + + + + + + + + + + "))]</value> + </webElementXpaths> +</WebElementEntity> diff --git a/Scripts/Change Password Fail1/Script1647003203026.groovy b/Scripts/Change Password Fail1/Script1647003203026.groovy new file mode 100644 index 0000000..1aab3fc --- /dev/null +++ b/Scripts/Change Password Fail1/Script1647003203026.groovy @@ -0,0 +1,49 @@ +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_Change PasswordRenew password')) + +WebUI.setEncryptedText(findTestObject('Object Repository/Page_My ID/input_(New Password)_newpass'), 'SRhyFUEt3dY=') + +WebUI.setEncryptedText(findTestObject('Object Repository/Page_My ID/input_(Re-New Password)_renewpass'), 'SRhyFUEt3dY=') + +WebUI.click(findTestObject('Object Repository/Page_My ID/button_Change Password')) + +actualResult = WebUI.getText(findTestObject('Object Repository/Page_My ID/div_8 25 Password more than 8 - 25 character')) + +expectedResult = 'รหัสผ่านของท่าน\nต้องมีความยาวขั้นต่ำ 8 ตัวอักษร แต่ไม่เกิน 25 ตัวอักษร\nPassword more than 8 - 25 character' + +Assert.assertEquals(expectedResult, actualResult) + + + +WebUI.closeBrowser() + diff --git a/Test Cases/Change Password Fail1.tc b/Test Cases/Change Password Fail1.tc new file mode 100644 index 0000000..4734360 --- /dev/null +++ b/Test Cases/Change Password Fail1.tc @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<TestCaseEntity> + <description></description> + <name>Change Password Fail1</name> + <tag></tag> + <comment></comment> + <testCaseGuid>bb4a903f-f72a-454e-8328-13cfa92a3b52</testCaseGuid> +</TestCaseEntity> -- GitLab