Use of Scripts in Automation

Use of Scripts in Automation

                          Automation tools support a variety of scripting like Javascript, VBScript, Power shell. These tools provide activities inside which we can write the script code. Once this activity is executed the generated output is saved into a variable. Now let us see how scripts are used in uipath.

Java Script

                          The use of javascript in uipath can be done using Inject Js activity. This activity requires the javascript relative or absolute file path.  

                          Lets consider an example to retrieve data from a webpage which is present in a table. Using inject js and write the following script to fetch entire data in a class and concatenate as string.

function(e)
{
var tableCells = document.getElementsByClassName('CLASS_NAME');
var str="";
var x=12;
while(x<tableCells.length)
{
str = str+tableCells[x+2].innerText+"^"+tableCells[x+6].innerText+"$";
x=x+12;
}
return str;
}

                          The inner html of all the elements present in a table are concatenated and stores them in a string str which is the output. The output  is concatenated by $ for each row and concatenated by ^ for each cell in row.

Power Shell

                           The use of power shell with uipath requires the use of invoke power shell activity. Executes a Power Shell command with specified input parameters. This activity requires Parameters dictionary of PowerShell command parameters and the PowerShell command that is to be executed. 
                            
                           This activity returns a collection of TypeArgument objects returned by the execution of the command. Can be used to pipe several InvokePowerShell activities i.e., the output of one power shell activity can be an input of another power shell activity and so on.

Note: This content will be updated with examples if any one requests. Please comment below.

4 comments:

  1. I was very much confused what to do next in my career, but after going through this article I got a clear version of undergoing RPA Training in Chennai. Thanks for sharing and explaining me in detail about the latest technology. Hope waiting for more posts like this.

    ReplyDelete
  2. My rather long internet look up has at the end of the day been compensated with pleasant insight to talk about with my family and friends.
    RPA Training in chennai

    JAVA Training in chennai

    AWS Training in chennai

    ReplyDelete
  3. Great stuff admin. Really helpful to me, thanks a lot for sharing this interview questions with answers. Share more like this.
    UiPath Training in Chennai | UiPath Training

    ReplyDelete
  4. It is very useful information about Use of Scripts in Automation .Thanx for sharing the answer,keep it up the good work

    https://youtu.be/tZ4BV9Mdn74

    ReplyDelete

Robotic Process Automation

Robotic Process Automation - RPA                       Robotic process automation is the trending technology where soft...