Convert String Variable to Image Variable

Hi All,

I need to select yesterday date on Citrix. So I have taken one String variable and saved yesterday date in that variable. Now I need to select the date in Calendar which is image type So unable to select the date. Could you please suggest any solution for this???
If That string variable could be converted into image variable i can pass that image variable in click activity.

Regards,
Keshav

Hi @keshav,
If you can get the calendar date UiElement (selector) then you could make it dynamic and inject the string as an variable to this selector. But this depends if you have possibility to get selector.

Hi @Pablito Could you please tell how to get Calender date selector??

Regards,
Keshav

For selectors you can use Click activity as an example. Please check out the documentation:

Hi @Pablito As I am working on Citrix So I am not getting the selector option in activity.

On Citrix XenApp/XenDesktop worker you need to have runtime installed:


And on machine where you have Studio you need to install Citrix extension:

This should allows you to interact with UiElements in Citrix environment.

Hi keshav

Is the application on Citrix environment is desktop or web or terminal

Thanks
Ashwin.S

@AshwinS2 Application on Citrix and It’s Web

Probably StoreFront yes? Then your connection to the Citrix desktop is working based on secure RDP connection. My solution with runtime and extension should work but you need to have administrative right to install runtime on citrix workers.

@Pablito For time being I dont have admin rights… will see this later. Is there any other solution for this???

If you don’t have admin privileges the only approach which seems to be reliable is to use Computer Vision activities. They based on OCR and cloud technology but can recognize very well many elements :slight_smile:

:slight_smile: :slight_smile:

Hi,

Try “Click Text”. Click text searches for a text in an image, so basically it scrapes and then with the scrape it clicks the text. For more info, check the below URL. Also, Uipath Academy has a full tutorial on how to automate Citrix.

  • Click Image - action you can use to click on mostly anything (as long as the image you choose is unique): buttons, menus, text, or even somewhere relative to such an element.
  • Click Text - it uses OCR to scan the screen of the virtual machine, enables you to extract a specified piece of text and clicks on it (or next to it, depending on your choice).
  • Select & Copy - is the easiest output method being used in Citrix automation, but works only for selectable text, like text boxes.
  • Scrape Relative - allows you to scrape just a portion of an image, relative to an anchor.

Tip: For faster automation in virtual machines (such as Citrix), you can avoid using mouse interactions, and replace them with keyboard actions such as navigating with the Tab key, and using keyboard shortcuts to activate different functions of the application.

Hi @keshav

do you have any text box to type date in that date picker?

one of my projects we faced this scenario, where we used type into to enter the date instead of selecting from the datepicker calendar.

Hi @Karun No textbox is not editable so we have only one option to select from calendar only. :frowning:

@keshav

what about Sendhotkey it also did’t help

otherwise can you share a screen shot

@amaresan image

once I am taking activity as CV Click text and indicating on screen it is taking an image of calendar and always clicks on 12 (Center click) so I guess one thing we can do that we have yesterday date in variable like as of today (in variable 19) we can send “Tab” hotkey 7 times so it can able to select 19. but again problem will be if on tomorrow if we want to select 20 we need to send “Tab” hotkey 8 times and so on…

So how can we achieve it on every new date??

@keshav

Use below code to get number of Tab need to use
cstr(if(now.Day>11,now.Day-11,11-now.Day))

after that put for each method in range value put output of the above code
inside put send hot key Tab values

This is one method

Hi @amaresan

This also won’t work. once month will change it will click some other date which is in middle like for may month it will clicks on 15 for april its 17 …(its not always 12) :frowning:

By the way Nice effort by u :+1:

@amaresan I have tried with click OCR text But its also throwing an error
“Exception Type: UiPath.Core.Activities.ActivityTimeoutException” .

If Click OCR text will work then we can pass the variable of yesterday date today.AddDays(-1).ToString(“dd”) and achieve the solution.