I am Getting Object not found while try identifying static text object displayed in two lines using verifyElementExist /Wait for property. (Similar issue happen while clicking on dynamic tabs. )
Below is the screen shot of the object spy with the header text to be identified (appears in two lines) and dynamic tab to be clicked (The number changes based on the number of items for approval)

- When I try to identify the object in script it failed telling unable to identify the object.
MobileBuiltInKeywords.waitForElementPresent(findTestObject('OB_Mobile/PendingTransfers/PT-HeaderText - Pending Transfers Same Currency'), 0)if (MobileBuiltInKeywords.verifyElementAttributeValue(findTestObject('OB_Mobile/PendingTransfers/PT-HeaderText - Pending Transfers Same Currency),
'name', 'Pending Transfers Same Currency', 0)) {
KeywordUtil.markPassed('SUCCESS: Navigate to Pending Transfers Same Currency ')} else { KeywordUtil.markFailed('ERROR: Navigate to Pending Transfers Same Currency ')}
I did try using xpath with regular expression, replace the name/label in object with regular expression ( label = Pending Transfers.*) but every time the script fails due to object not found.
Console:
10-29-2018 12:17:42 PM - [WARNING] - Object Object Repository/OB_Mobile/PendingTransfers/PT-HeaderText - Pending Transfers Same Currency not found
Can you please let me know what we need to change?
Note: The app is built using react
You have this code.
MobileBuiltInKeywords.waitForElementPresent( findTestObject('OB_Mobile/PendingTransfers/PT-HeaderText - Pending Transfers Same Currency'), 0)
Why do you specify timeout to be 0 ?
I have a default time out that will over write this to default timeout when 0, so that can be ignored. The main issue is objects that are on two lines in mobile app are not getting identified during run time and no actions can be performed.
Below is the screen shot of the object spy with the header text to be identified (appears in two lines)
Sorry, I can not find where is “the two lines” you mentioned
Could you mark them with some color in the picture?

Highlighted in Green are objects that are coming up in multi line, also To Approve is dynamic it will have number of items to be approved and will change accordingly.
Screen Shot 2018-10-29 at 1.42.05 PM.png
Let me clarify your wording.
You call this an object in single line 
and you call this an object in multi line 
Is that right?
KatalonDiscussion10460_singleline.png
KatalonDiscussion10460_twolines.PNG
I am Getting Object not found while try identifying static text object displayed in two lines using verifyElementExist /Wait for property.
Do you think the reason why you get Object not found is that the object is displayed in two lines?
In other words do you think as follows? :
the value property of the TestObject is
“Pending Transfer Same Currency”
, but what you see on the screen is
“Pending Transfer
Same Currency”
therefore you are getting Object not found.
Yes, reason being I have same element type being identified properly when the data comes in one line on other pages but this page it fails.
Only difference I see is there the name appears in one line but here its two lines.
kazurayam said:
Let me clarify your wording.
You call this an object in single line 
and you call this an object in multi line 
Is that right?
yes correct, also in this case its dynamic value that appears for To Approve (number)
Can anyone please help with this? I am not sure why this is not getting identified, and its affecting the scenarios to be automated in this category
Hi AutoBot,
I wonder if you would have more success identifying the object by xpath, using your idea of a regular expression to just check for the first line:
//*[@type='XCUIElementTypeStaticText' and starts-with(@label, 'Pending Transfers')]
You’ll need to edit the saved object in the Object Repository, unchecking all of the values except for “xpath”, and putting in your own xpath from above.
Hope this helps,
Chris