How to Handle These Check Box
example :
Select : if it is already marked check and don’t click
if it is not check and Click on this
How to Handle These Check Box
example :
Select : if it is already marked check and don’t click
if it is not check and Click on this
You can do a comparison if the element is checked, or not. If element is not checked, check it.
if (WebUI.verifyElementNotChecked(findTestObject(...pathway to Select), 10)) {
WebUI.check(findTestObject(...pathway to Select))
}
or
if (!WebUI.verifyElementChecked(findTestObject(...pathway to Select), 10)) {
WebUI.check(findTestObject(...pathway to Select))
}
Edit: You can make a Keyword of the statement and pass in your Test Object.
CustomKeywords.‘com.Tools.verifyChecked’(findTestObject(…pathway to Select))
CustomKeywords.‘com.Tools.verifyChecked’(findTestObject(…pathway to Create))
CustomKeywords.‘com.Tools.verifyChecked’(findTestObject(…pathway to Email))
/**
* If it is already marked check and don’t click
* if it is not check and Click on this
* @param Katalon test object
*/
@Keyword
public void verifyChecked(TestObject obj) {
if (WebUI.verifyElementNotChecked(obj, 10)) {
WebUI.check(obj)
}
}
Thank you verify much , would you like to guide me on skype, if it is possible ?
If you work only on the Manual page, then I’m not able to assist you much at all. I work on the Script page, so:
After that, repeat the above for all the other checkbox items.
As for the Keyword, there is a document Katalon has that you should review first.
Introduction to custom keywords in Katalon Studio | Katalon Docs
Edit: I will give you a warning that you should NOT make changes and MOVE between the Script page and the Manual page. Save any changes before you move between the Script page and the Manual page. Even then your code may become corrupted. Katalon knows about this issue, but it has not been resolved.
Edit2: If you try to do this on the Manual tab, then the if statement would be called a Decision-making Statement > if statement
Hi @noor.ahmed, we noticed that you have been asking quite a few questions up till now. We just want to check in to see if you have found the solution that you need?
If yes, then don’t forget to mark helpful replies as a solution so that others who may be asking similar questions / running into similar problems can find the solution as well!
Thanks!
We actually would encourage you to keep discussing with other members on our forum until you get the solution(s) that you need. That way, other members who may have the same issues can find the solution here to. Thanks