![]() However, using GlobalVariables within verifyEqual() will work because they are Objects. It expects Objects and although Strings are supposed to be Objects, KS doesn’t treat variables defined like, “String string1 = …”, as such. Last note, I don’t use WebUI.verifyEqual() with Strings. The above gets the text of the textbox via the value attribute of the element. String string1 = WebUI.getAttribute(findTestObject('Gift order with CC OR/Page_Online Ordering/div_VISA - 1111 33.49'), "value") Note, if your Test Suite goes over several TCs, then you should do as suggests and use GlobalVariables.Īlso, if the first order number is in a textbox, you may use (although you have it as a div): After you have the two Strings, then you can do your comparison. Katalon Studio, out of the box, won’t be enough to help us Introducing Page Object Model This is a test design pattern meant to separate testing/verification concerns from page-interaction ones, as well as abstract away a lot of the gritty details, to make your code easier to reason about and maintain (I’ma drop an article on those at some. When you get the second order number on the screen, get the second then. So after you place your first order, get/collect the order number then. You can’t directly pass an object to verify match instead you can getText or get Attribute from the object and store it into a local variable and pass it into the verifyMactch keyword eg: actualWebUi.getText(findTestObject(Your Object Location in object repository)) expectedWebUi.getAttribute(findTestObject(Your Object Location in object repository),‘value’) WebUi. You need to “capture” the order number when it is on the screen and the object ID exists. Where I was concerned was your stating “ the actual object is in the previous page and not reading the object ID”. You could read up on RegEx for using sometime later. The last item, false, indicates that you want to directly compare the two strings, as compared to using Regular Expressions to find similarities. ![]() WebUI.verifyMatch(String1, String2, false) WebUI.verifyElementPresent(findTestObject(‘Object Repository/Gift order displayed in Order Page OR/Page_Online Ordering/button_CANCEL gave you a method to compare Strings. ![]() WebUI.verifyMatch(string1, string2, false) The problem is that the two objects are being compared as objects, rather than the actual text that makes up the object. String string2 = WebUI.getText(findTestObject(‘Gift OR/Order no displayed on My orders page’)) String string1 = WebUI.getText(findTestObject(‘Gift OR/Order no displayed on order confirmed’)) WebUI.click(findTestObject(‘Object Repository/Gift order displayed in Order Page OR/Page_Online Ordering/span_Orders’)) WebUI.click(findTestObject(‘Object Repository/Gift order displayed in Order Page OR/Page_Online Ordering/span_suhani_k-icon k-menu-expand-arrow k-i-_1b4290’)) Not_run: WebUI.verifyElementText(findTestObject(‘Object Repository/Gift order with CC OR/Page_Online Ordering/div_VISA - 1111 33.49’), This is where the first string will be displayed WebUI.click(findTestObject(‘Object Repository/Gift OR/Page_Online Ordering/button_PLACE MY ORDER’)) WebUI.click(findTestObject(‘Object Repository/Gift OR/Page_Online Ordering/button_SAVE CONTINUE_1_2’))
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |