Mobile unable to handling modal box in Android playback

I am in the process of testing a modal dialog using Katalon Studio. When i recode or spy mobile, katalon can detect all object on modal. But when replay, they can’t.

The AUT is an app that uses native modal.
I tried folow:

Please help. Thanks!

Hi @hanh,

You are missing timeout parameter at the last keyword.

Here is an example

Mobile.tap(findTestObject(` chat ngay`), 50)


1 Like

Thank you for your help. I already try to add timeout but still can’t tap on button on modal :frowning:

Test Cases/0_Chat/3. Chat_Unlock chat_Has only one chatroom FAILED.
com.kms.katalon.core.exception.StepFailedException: Failed to tap on element ‘Object Repository/0_Chat/Locked chat room/android.widget.TextView5 - Mo chat ngay’
at com.kms.katalon.core.keyword.internal.KeywordMain.stepFailed(KeywordMain.groovy:48)

Hi @hanh,

  1. Please show us the full stack trace.
  2. Did you record this element (the Mở chat ngay button) from Katalon Recorder/ Spy?
  3. Please show us some screenshot of the Mở chat ngay button Test Object page. You need to determine it’s XPATH is correct or not?
1 Like

Record mở chat ngay element from Katalon Spy

Mở chat ngay test object

Hi @hanh,

The object seems good. Please copy the execution log on Console tab and paste it to a file the send it here.

Hi a @duyluong
Here is the console file
console_katalon.txt (78.4 KB)

Hi @hanh,

  1. Please uncheck class, instance, text property and remain xpath property only then execute again.
  2. If it doesn’t work, please upgrade to KS v6.1.2 (use Check for Update), execute again and send us the execution log.

Thanksss @duyluong,

  1. I do like this way but it’s still not work
  2. I will try upgrade in tomorrow and post as you guide.
    Thank you so much for your help.

P/s: Cho mình hỏi bên bạn có tổ chức các khóa học sử dụng Katalon không? Cảm ơn.

Hi @hanh,

You are welcome.
Btw, your Test Object structure seems good.

We also provide training service on demand. If you are interesting, please don’t hesitate to contact us:

Hi a @duyluong ,
I updated to KS v6.1.2 and here is Event log and console when i execute test again.
(Our app used react native modalbox.)
console_katalon6.1.2.txt (87.4 KB)

Hi @hanh,

Please open Include/config/ and enable the line and run again. The Console will show the debug to help you can debug better.

Can you please share the xpath property of the element Object Repository/0_Chat/Locked chat room/android.widget.TextView5 - Mo chat ngay?


Thanks a @duyluong

xpath: //hierarchy/android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.FrameLayout[1]/android.view.ViewGroup[1]/android.view.ViewGroup[1]/android.view.ViewGroup[1]/android.view.ViewGroup[1]/android.view.ViewGroup[1]/android.view.ViewGroup[1]/android.view.ViewGroup[1]/android.view.ViewGroup[2]/android.view.ViewGroup[1]/android.view.ViewGroup[3]/android.view.ViewGroup[1]/android.view.ViewGroup[1]/android.widget.TextView[1]

Enablelog_console_katalon6.1.2.txt (97.1 KB)

Please try this xpath property:

//android.widget.TextView[@text='Mở chat ngay']

Woww, it’s work. Thanks you so much @duyluong

1 Like