Issue with element exists

Hi,
I am getting element exists as false eventhough the element is present.
All care is taken in selector

Hi @KarthikBallary

Please try to refresh the page and try, your session might have expired.

If this does not help, show me the code. Or tell me the URL I will replicate the steps

Thanks,
Prankur

1 Like

It is not problem with session. I cant share URL it is confidential

Hey @KarthikBallary,

Have you assigned the default value to the output variable returned by the element exist?
If not then initialize the variable with the false value and give it a try.

I have created a variable but not assigned anything

Hey @KarthikBallary,

Can you give it a try.Please assign it false as default value.

ok will try and let u know thnk u

1234
I need to assign before this

What browser are you using?

Hey @KarthikBallary,

Go to variable pane and find this variable there.Then on the right hand side you can assign the value as false.Simple,

chrome

one more issue:
You have already opened this URL in browser(for example facebook)
from uipath it will hit the same url in browser, further opeartions which has done as per the code will done in the other URL(not new url).
I have used attched browser and passed variable

Do you think it will be possible for you to use IE? Most of the UiPath experts recommend IE as it is a much stable browser.

any other option with chrome only?

this strategy didn’t work

Let’s check with the experts.

Any suggestions @Lahiru.Fernando @Jan_Brian_Despi @anil5 @lakshman

iselementexists.Eqauls(True)
iselementexists=true

is it matters?
true or True?

Hello,

Let’s take one question at a time :slight_smile:

First the element exists activity. I saw the screenshot and the configuration seems to be fine. However, I’m not sure whether you have set the selector properly. If the element cannot be found for the selector you have provided, it will always return as false. The best way to check this is, Open UI Explorer and set your selector there, and click on the validate button and see whether it comes as valid. you can also use the highlight option to check whether it highlights the correct element. If that all goes well and still your execution returns as false, I suggest you use the debug mode, and also to use the the highlight elements option so that you can actually see what is being selected in the screen.

To use the debug mode, Have a breakpoint on top of you element exists activity, and run it in debug mode. Once the execution gets there, do a step by step run so that you have full control of what’s happening.

Also a small suggestion on the configuration of the Element Exists activity. Try setting the Wait For Ready property to Complete and see how it goes. This will actually wait for the element to be loaded and ready in the page if it is available :slight_smile:

Next question

These are all boolean variables. Which will only return True or False as we all know. So you don’t really need to check like isElementExists=True or isElemenExists.Equals(True). Just using the variable itself would do the job. For example, let’s say you have a IF condition whicch you want to do something depending on the element availability. So in the Condition of the IF activity,

IF isElementExists
Then
{

}
Else
{

}

This will actually use the variable itself and see whether the condition is true or not :slight_smile:

If you want to check for false by default, you just want to specify as:

IF Not isElementExists

This will check for false

3 Likes

Thank you will take your suggestion

1 Like

Nice Explanation bro

2 Likes