IF condiiton to check file

HI,

Using if condition inside sequence how to check file exists in a particular path or not ??

I’m planning to check one excel file(eg:challenege.xlsx) in a particular local drive and if its available am planning to delete that excel file

1 Like

Buddy yoy have an activity called path exists in uipath buddy @vikumars1
With which you can pass the input as filepath and as a outcome we will get the boolean value from the activity path exists…with which we can validate whether we have that file or not with a if conditio buddy…

And if it is available you can delete that path with delete with activity called Delete

Cheers @vikumars1

@vikumars1

use Path Exists activity and select path type as file and specify file path. And it will give you output as boolean variable.
Then use it in IF condition. If it is true then file exists else does not.

3 Likes

Were you able to delete now buddy @vikumars1

Hi Palani ,

How to close all the opened browsers before starting executing

1 Like

@vikumars1

use Kill Process activity and specify process name as:

IE browser - iexplore
chrome browser - chrome

Use kill process buddy…with process name property in it with you browse name as value…
To pass the correct name…go for task manager and under processess, check for the name like fo chrome it it is like chrome.exe mention as “chrome” in processname property in kill process buddy or if its iexplore check the name and place the application name alone without the extension buddy…this applies for application you want to close @vikumars1
Place this before your process begins that would close all the browsers…
Chees @vikumars1

Hi ,

How to make one activity to wait for few seconds before starts executing.

I’m downloading one excel file from browser and then am moving that file to some other driver .
The challenge am facing is it taking some time for downloading meanwhile moveFile activity cannot able to locate the file in source path .

Set a delay activity buddy with some approximate time set… Buddy @vikumars1

1 Like

Were you able to make a delay buddy @vikumars1

Hi ,

IF i use a kill process ,after opening browser very next moment ,this element showing in browser. How to handle it??

Element exists ?? activity or any other idea available???
image

1 Like

Buddy once you close the browser with kill process…i hope you will be opening the browser with a new url…
So when you get to that url…we won get this popup buddy…for that use open browser and mention the URL in tha activity as input buddy
Or still if that appears…you can use element exists followed by click activity buddy that could help you close this buddy @vikumars1

Cheers @vikumars1

Hi ,

In a delay activity --Duration is in which format??
To wait for 3 seconds , how should i pass the value

For eg: I passed it as below UI path hangs
3000.00:00:00

Aaah no buddy it should be like this 00:00:03 and it is type time stamp…in the format of
Day.hours:minutes:seconds
Cheers buddy @vikumars1

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