How to check element exists?

Hello everyone,
I have a scenario where i have to check is element in webpage exists or not, if exits then only send shortcut key.

For example: I have to sent shortcut key on webpage if text “ABCT” is exists, the main concerned is “ABCT” text is more than 50 words which doesn’t matters to me, only thing that is matters is the keyword “ABCT” text is on webpage or not.

How to do this help me out guys !

Hi @prabin_chand1

You can use the check app state activity

Regards!

1 Like

Hey @prabin_chand1
You can use this in modern activity


And like this in the classic activities

Hope this helps you
Cheers.

4 Likes

Hi @prabin_chand1 ,

Could you show us sample structure of the webpage?
if that text “ABCT” position is fixed, you can use activity Get Text/ Get Full text/ Element Exist / Check App State.

if text “ABCT” not fixed, you can try to scraping all data from wepage and use Regex or other method to check is “ABCT” text exist or not.

Regards,

1 Like

Hi,

Can you try CheckkAppState with the following selector (innertext)?

<webctrl tag='BODY' innertext='*ABCT*' />

image

The following is a sample workflow.

Sample20230309-2L.zip (107.0 KB)

regards,

1 Like

Showing dublicate elements found, while validating

@prabin_chand1 Easiest way to do this:

USe Element Exist First then it return a boolean pass it to IF in case it true use short key or true side execution other then goes to false side execution which you want

Hope this will resolve your problem still not pls let me know

1 Like

You can use an anchor, so first map the first element, then search another element that will not change, it could be a title, header, etc, and select it as anchor, you would see green element as the element you want, and blue element as the anchor element

Regards

1 Like

Element exists returning UIelement data type not as Boolean

image


Its boolean Check

1 Like

@prabin_chand1 Yes that return boolean not Ui Element

@Chirag_Shetty_Divakar Correct bro

@prabin_chand1 If its resolve your problem pls close your topic mark it as solution for my hardwork

Thank you guys!

1 Like

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