0

I'm try to do this statements but not successful. Can anyone help me. Thank you alot

if (WebUI.verifyTextPresent('Nhân viên hiện không rảnh trong khung giờ này', true) {
    WebUI.waitForAlert(2)

    WebUI.click(findTestObject('Page_Trang Qun L (1)/FailConfirm'))

    WebUI.closeBrowser()
} else {
    WebUI.waitForAlert(3)

    WebUI.click(findTestObject('Page_Trang Qun L (1)/ThemButton'))

    WebUI.waitForAlert(2)

    WebUI.click(findTestObject('Page_Trang qun tr SkyAdmin/button_OK'))

    WebUI.waitForAlert(2)

    WebUI.closeBrowser()
}
melpomene
  • 84,125
  • 8
  • 85
  • 148

1 Answers1

1

The second parameter of the WebUI.verifyTextPresent() says if the first parameter is a regular expression.

See https://docs.katalon.com/display/KD/%5BWebUI%5D+Verify+Text+Present.

I do not speak your language, but the text doesn't seem like a regex. Try changing WebUI.verifyTextPresent('Nhân viên hiện không rảnh trong khung giờ này', true) to WebUI.verifyTextPresent('Nhân viên hiện không rảnh trong khung giờ này', false).

Mate Mrše
  • 7,997
  • 10
  • 40
  • 77
  • Thank you but it's not work. I try to verifyTextPresent() in if/else statement. If text presents anywhere in the page source, the browser must close. But if/else statement in this case is not work. – K9_HCM Ng Quang Thnh Sep 04 '18 at 07:05
  • Hmm.. maybe Katalon doesn't recognize all the characters. Maybe you could try to verify this part of the text: 'nh trong khung gi'? – Mate Mrše Sep 04 '18 at 08:08