Reading the What App chat contact details but having dynamic title

Hi, I’m reading the contact number of what’s app chat through web.whatsapp.com.

However here stuck in one scenario for the selector.

Whenever there are some messages/chats in the whats app, I have to use this selector :

<html app='chrome.exe' title='* WhatsApp*' />
<webctrl aaname='+*' parentid='main' tag='SPAN' />

Here, there is space between * and Whets app in the title tag. I tried to remove it, but still selector requires the space in order to read it using get text activity.

But when there are no messages left(after reading last what app message)

I have to use this selector to read the last what’s app message.

<html app='chrome.exe' title='*WhatsApp' />
<webctrl aaname='+*' parentid='main' tag='SPAN' />

Here there is no space betwen * and Whats app.

Here, I have to give OR condition for title through the dynamic variable.
How can I pass the two variables in the selector, which would use either of any title.

Assign1 - Title1 = * WhatsApp
Assign2 - Title2 = *WhatsApp

Any other solution or work around is welcome !

@Palaniyappan @Sergey_Petrenko @lakshman

Thanks,
Shantanu

Instead of passing two variables to a selector you can pass only one variable but two different values based on a condition
Like use a If condition and inside the THEN and ELSE block pass corresponding value to that one single variable and use the same variable in selectors of both the scenarios

So variable is one but value is decided based on a condition and pass with value accordingly

And I just wonder why it require a space because * wildcard will consider all character that includes a blank space as well

Try upgrading UIAUTOMATION package in your studio and give a try without any space between wildcard and the word you have in title attribute

cheers @Shantanu_More1

2 Likes

Hi Palaniyappan,
Thanks alot man.
Issue was with Ui Automation Package.
As suggested, I have updated the package and selectors working smoothly.
I had same question, even after using *, it should have work for the blank space as well.

Thanks,
Shantanu

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.