Having issues with check app state

Hi there,

I am having issues with my code. My bot needs to go to this website and check if there are attachments and image scan. If yes, than we download, if no, we print the whole page.

First I am checking if the first attachment exists

If there is a first attachment, I am using an if condition of: If the name of the first attachment is not equal to the name of the image scan, and the name of the second attachment is not equal to the name of the image scan, download the first attachment. (This seems to not me working either, since it is downloading everything even if it has the same name)

image

Then I check if there is a second attachment (I think my problem is in here somehow)

If the second attachment exists, download it and then check if image scan exists and if exists, download it, if second attachment does not exist, check if the image scan exists

The problem I think I am facing is that the bot is downloading the first attachment that has a different name from the image scan, and there is no second attachment. I think it keeps looking for the second attachment.

@NathaliaFawcett

First thing did you refine your selectors?

Because the selectors can be dynamic you need to refine them to match any scenario

Cheers

I do not believe I did. Could you tell me how? I don’t think I have ever done it

@NathaliaFawcett

While indicating the element you would see the strict selector fuzzy etc…check if there are any id or any numbers in it which might change and remove them and add reliable ones

Cheers

Hi @NathaliaFawcett,

You have a issue with the selectors. You required the analyze and refine the selectors.

Click on you Check App State Activity > Open Property Panel > Expand Target section

image

Note: In my case I have both Strict Selector and Fuzzy Selectors used for the selector. Click on Strict Selector menu option highlighted as … [3 dots]

Click on Open in Ui Explorer option

Choose the attributes of the selectors right to avoid the exception.

Suggestion:

  1. Use aaname as the top priority. It will help in identifying the selected element appropriately.
  2. avoid choosing the number from the attribute list [Id=‘234H6Ur’ or idx=‘1’]
  3. choose the attribute that gives the meaning of the element you scrapped. [Ex: If you choose the SignIn button, the attribute you choose should contain signin keyword to justify the attribute.

Thanks,

I have it changed for a wild card since the attachment name will change every time

@NathaliaFawcett

Can you show the selector you are using and if you have selected only strict selector?

Cheers