Hello, I want to look for a specific name starting with the letter ‘B’ in the 3rd col. only. Once it gets the expected name, the loop stops. Then it captures the name with its EMP ID and *clicking on the checkbox.
There are many pages. In a page, there are 15 rows per page with different data.
You have not stated any question yet. What is your question? Please do not let others guess what your question is.
The screenshot shows a few error messages. Therefore your code must have some problems. But you haven’t explained what you have done to fix the errors. It seems you do not mind them at all. It seems you haven’t done any study about the errors yet. I wonder what you want others to do.
If you want to be answered, you should clearly ask questions.
Hello, it’s just been 7 days I started using Katalon for automation. I am still on the learning and research phase. I am studying every aspect on it little by little.
My question is: How can we find a specific name for eg “Ben Issa” on the 3rd column if it is on the 12th page?
Once it gets the expected name, how to capture it with its EMP ID?
I am still working to fix the errors you know. But some object locators work well when you inspect them in developer mode but same are used in Katalon, there are errors.
The codes:
def TrimName=GlobalVariable.Value.substring(0,1)
println(TrimName) // In our case it is ‘B’
def alphabet_B=WebUI.modifyObjectProperty(findTestObject(‘Object Repository/Reported By/Filter’), ‘text’, ‘equals’, TrimName, false)
WebUI.click(alphabet_B)
WebUI.delay(5)
int Counter=0
def CheckName=true
while(CheckName) {
Counter=Counter+1
if (Counter<50) {
correctName=WebUI.modifyObjectProperty(findTestObject(‘Object Repository/Reported By/ApplicationAccount2 - Copy’), ‘text’, ‘equals’, ExactName, true)
if (WebUI.waitForElementVisible((correctName),3)) {
CheckName=true
break
}
else {
WebUI.click(findTestObject('Object Repository/Reported By/Next'))
WebUI.delay(2)
}
}
else {
CheckName=false
println "Name is not present in the directory"
break
}
}
Please show us the error messages. You can see the errors, but others can not. You should explain what the error message you got.
The error message would indicate which line of the test case script is causing the error. The line# of script wehre Error occured, with message from the system “”.
Then you should tell others which line of code is problematic. You should make best effor why you got that error, and ask questions about it specifically. Do not say just “please help me”.
I have never used WebUI.modifyObjectProperty() keyword. I was not aware of this keyword at all up until now. I have never seen any post in this forum where somebody using this.
If you want your loop to stop, then I think you have this incorrect. To stop your “while” loop, you
need to make your loop condition become false, so you want:
if (WebUI.waitForElementVisible(correctName, 3)) {
CheckName = false
break; // and you really don't need this
}
I also have never used modifyObjectProperty, so good show if it works.