Hello team Katalon,
I am new in katalon
I am trying to set a text on the textbox with integer type and when I run it, it keep freezing and it does not get an error. Here is my code
Mobile.setText(findTestObject(‘VitalSign/VitalSign_tab/temperature_editText’), String.valueOf(‘10’), 0)
Attached file is my object reposiroty
KS did not freeze, but it was trying to find your object that means your object location may not correct.
Please check at the
xpath property only and execute again. If the execution is failed, please send us the execution log (copy the Console log then send us in text file).
Not 100% sure but may be useful checking what object is identifiable by, I have found it easier in some scenarios to enable class/attribute etc and use these to correctly and reliably identify an element.
I checked the xpath property only and execute again. The execution is not failed but the execution on the setText did not continued. Here are the screenshots of log viewer and console log
Console Log —
Log Viewer —
I tried also to enabled the class and instance and this is the result
I’ve often had more luck with the
Mobile.sendKeys() function instead of
setText(). Note that when using
sendKeys, it’s expected that the text field is focused, so you’ll need to perform the
tap action on the field first.
If that doesn’t work, it might be worth checking what Katalon and Appium think are on the screen at the time you’re trying to set your text. If you want to see some more detail about exactly what Appium/Katalon detects on the screen you can log out the XML contents of the screen. You should be able to do that by putting the following import statements at the top of your test case:
Then in the code for your test, add the following right before you set the text:
AppiumDriver<?> driver = MobileDriverFactory.getDriver()
KeywordLogger log = new KeywordLogger()
When the test runs, you should see an entry in the Log Viewer for “Statement - log.logInfo(driver.getPageSource())” that shows the start of the XML for the screen. If you tap on it, you’ll see all of the XML for the screen on the right-hand pane.
If you could attach that XML in a reply that would be helpful for troubleshooting.
Hope this helps,
Change the 0 at the end to 3 or something relatively small otherwise it will not time out or take a very long time to time out and not fail the execution, this way you can be sure which step it is failing on.
Not sure on how to resolve the issue with send text, possibly have a step before to ensure that it is clicking inside the expected text field first.
Thanks sir @adam.cane sir @Chris_Trevarthen sir @duyluong for your response. Everything is OK now I tried all your solution and it’s working. I appreciated it a lot
Here is my question again
When I switch to another phone, this simple script is working
Mobile.setText(findTestObject(‘VitalSign/VitalSign_tab/respiration_editText’), ‘12’, 0)
What is the problem on the other phone that is not working? the Xpath of that textbox is also correct
tried inspecting and saving the object? Then compare side by side; maybe some very small difference.
What are the 2 devices you’re testing on (manufacturer, model, and OS version)? Which works and which does not?
That info could help us troubleshoot some more.
Yes sir maybe it saves different object. Thank You sir @adam.cane
Hello sir @Chris_Trevarthen
manufacturer: NOKIA 3
OS version: 7.1.1
OS version: 8.1.0
Other than the different Android versions, the other major difference I see in the phones is that the Nokia has hardware menu buttons where the Oppo has software buttons. I’m not sure that this should impact the ability to use Appium or Katalon Studio, but it’s obviously causing different behavior.
If you’d like to dig further, you could try logging out the screen contents per my previous post to see if Appium detects different objects on the screen depending on which phone you’re using.
As I mentioned, I usually use
Mobile.sendKeys() now instead of
Mobile.setText() because of inconsistencies with
setText. Note that for
sendKeys to work, I think you will need to make sure the keyboard is already open by having your test tap on the text field first.
Hope this helps,