Example Code

Programmatically Input and Click Buttons on HTML Website Using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This uses ActiveX calls to embed a web browser into the front panel of a VI, and then programmatically input text into the HTML text box, followed by programmatically clicking the button.

 

Description

This uses ActiveX calls to embed a web browser into the front panel of a VI, and then programmatically input text into the HTML text box, followed by programmatically clicking the button. It is a simple VI with a simple HTML page built to demonstrate this functionality for other websites.

 

Requirements:

  • LabVIEW 2012(or compatible)

 

Steps to Implement or Execute Code

  1. Put the HTML page "mypage.html" in your local C: directory, or change the control URL of mypage.html to point to it.
  2. Enter the desired text into Value For Text Box.
  3. Run the VI, and two things should happen.
    • The text you entered should be in the website's text box.
    • Your email client should pop up, indicating that the button was pressed automatically.

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

 

Ravi A.
National Instruments | Applications Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
ross_36
Member
Member
on

Great work - I did notice that I couldn't get the button click to work on the Edge browser though, not sure if it's just my html or a change from IE.