Web Automation Tools

Web automation training tools

You can select and import a specified source file into the workspace and even specify the filename within the working directory. In the source file field, you can include the %FILENAME% variable. When executed, it will replace the content of the .txt file with the filename as FILENAME within the workspace, achieving dynamic assignment.

You can select a skill and insert it into the workflow as a step. When EMILY reaches this step during execution, it will load and execute all the steps within this subtask sequentially. Checking the Run subtask in new browser box will open a new browser window to execute the selected subtask during runtime, allowing the subtask to operate independently. If this option is not checked, the subtask will execute in the same browser window and must adhere to the rule of no nested loops. To cancel inserting a subtask, simply press the ESC key on your keyboard.

Iteration is provided in two ways: iterate through a table and iterate by conditions. Neither way allows nested loops.

Clicking on Iterate and selecting a .csv format file will enter iterate-through-a-table mode. In this mode, each value in the first row of the table will be saved in a .txt file in the workspace, with the file naming format as row-columnName.txt. Users can access these .txt files containing cell values and apply them within the steps of the iteration. After completing the recording of iteration steps for the first row of data, EMILY will execute the loop sequentially according to each row of data in the CSV file during execution mode.

If you choose a .txt file, you will enter iterate-by-conditions mode. In this mode, the first step recorded within the loop will check whether the content of the specified .txt file meets the set condition before execution. Once the conditions are not met, the loop will be terminated. Hence when training steps within the loop, users must rewrite the content of the specified .txt file explicitly according to the rules they want to achieve.

Bring the browser back to the training mode homepage.

Select all the text content of the element where the cursor is located in the browser.

Copy the selected text from the browser to the clipboard, and you can also save it in the workspace.

Paste the text from the clipboard into the browser at the location where the cursor is.

Select a .txt file and insert the file's text content at the location where the cursor is in the browser.

Select a target node(s) on a webpage in the browser and write a JavaScript script to access it. This is typically used for fine-grained manipulation of web elements or flexible data extraction from web pages. The selected target nodes are represented as an array in the script as nodes[], and this functionality supports the use of lodash.js and moment.js utility libraries, as well as workspace processing functions such as read(filename, encoding='utf8'), write(filename, content), remove(filename), and repeat(true, delay=3000ms)

// Extract the content of each news summary from the news list
nodes.forEach((node, index) => {
  write('news-' + index + '.txt', node.innerText)
})

If you want to execute a script and wait for asynchronous functions within the script to complete before proceeding to the next automation step, you can return a Promise object in the script as follows:

// Scroll to the bottom of the page
// It will take a few seconds for the page data to be fully loaded
document.querySelector("div.bottom").scrollIntoView()

// return a Promise object
// The next automation step will wait for the Promise to resolve before continuing
return new Promise((resolve) => {
  setTimeout(() => {
    write("page.txt", document.body.innerText)
    document.querySelector("a.nextPage").click()
    resolve()
  }, 5000)
})

In the script, you can also call other skills by their identifiers(UUID). The invoked skills will be executed in the current workspace and open a new browser window for execution, thus not being subject to the restrictions of nested loop rules:

// The run() API is an asynchronous function that returns a Promise object and can also be chained
return run("96fcb9b5-e209-4051-b502-ffd142e31a87")
.then(() => run("bb0a7f40-47e8-40ad-a7f9-d839ee8bcc5d"))

Or download files to the working directory within the script:

// The download(url, filename) API is an asynchronous function that returns a Promise object
return download("https://example.com/pricing.pdf", "price.pdf")

If you want to generate mouse events using a script, you can use the following synchronous functions: mouseEnter(node), mouseMove(node, x, y), mouseLeave(node), mouseDown(node, x, y), mouseUp(node, x, y), mouseClick(node), mouseDblClick(node), mouseContextmenu(node, x, y)

// simulate mousedown and mouseup
let node = document.querySelector("BUTTON#send")
mouseDown(node)
mouseUp(node)

Or you could use the DA mouse asynchronous functions to control the mouse or keyboard directly:

// control mouse actions
return mouse.enable(true)
.then(() => mouse.move(nodes[0], 0, 0))
.then(() => mouse.clickLeft())
.then(() => mouse.enable(false))
// control keyboard actions
// enable(true) will disable the anti-mistouch overlay and bring the browser window to the desktop foreground
await keyboard.enable(true) 
await keyboard.type('hello') // Send the keys 'h', 'e', 'l', 'l', and 'o' sequentially
await keyboard.tab() // Send TAB key
await keyboard.escape() // Send ESC key
await keyboard.backspace() // Send BACKSPACE key
await keyboard.enter() // Send ENTER key
await keyboard.enable(false)

For scenarios where you need to clear browser session data, such as cookies, you can use the clearSessionData() function. Please note that clearSessionData() is an asynchronous function.

// clear browser session data
return clearSessionData()

If you want the script to be executed once again before the next step, you can use the repeat() function. This function will re-execute the script before the next step in the workflow and can be called from anywhere within the script.

// If the "Next Page" button is found on the current web page, re-execute the script after 5 seconds
let btn = document.querySelector('Button#nextPage')
if (btn) {
  repeat(true, 5000)
  // Click the "Next Page" button after a 0.5-second delay 
  // ensuring that there is enough time for any remaining tasks within the script to complete
  _.delay(() => btn.click(), 500)
}
// ...

Save the current page in the browser as a PDF file or print it to a printer.

Let EMILY wait for a specified number of seconds before proceeding to the next step.

Find the keyword text in the specified browser window area.

Use the mouse to select the target node in the browser window to retrieve the specified content type and save it as a local file accordingly. The selected node will be highlighted in red, and users can adjust the target node path using a standard CSS selector in the EMILY main window.

When choosing to save text content and selecting a node path with an HTML <Table> tag, if you name the file extension as lowercase ".csv", EMILY the robot will automatically convert the content within the web page's table into .csv format.

Send one of the following keys: ENTER, BACKSPACE, ESCAPE, TAB.

Use the mouse to select a target node in the browser window and specify a timeout period. EMILY will wait for the appearance of the selected node during execution. If the node doesn't appear on the page within the specified time, the process will terminate with an error state. This is typically used for operations on dynamic web pages.

Use the mouse to select a target node in the browser window and input prompt text, EMILY will pause the execution at this step. It will mark the node in red, and display prompt text in the main window to guide the user in taking over the page's operation. Once the user completes the task, they can click "Done," allowing EMILY to resume its automatic execution.

Modify the filename of a file within the working directory. The source filename field can include the %FILENAME% variable, which, during execution, will be replaced with the content of a .txt file named FILENAME located in the workspace, allowing a dynamic assignment.

Open the working directory using Windows File Explorer or Mac Finder. This can be used to check the temporarily stored data of the current execution.

--

We are dedicated to improving our content. Please let us know if you come across any errors, including spelling, grammar, or other mistakes, as your feedback is valuable to us! 🤖️⚡️

Last updated