LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Drive a webserver

I have a client that is curremtly testing a device that has an built in webserver. He now wants to automate this process so has anyone done anything like this before?

 

For example:

 

  • Click on a button.
  • Enter text into a specific textbox
  • Select items on a list

Thanks in advance.

 

Kevin

 

0 Kudos
Message 1 of 10
(5,641 Views)

Hello Kevin,

 

What is the device you/your client are/is using? What do you mean by "built in webserver" - have a website running on the device?

 

Best regards,

Bozhidar 

0 Kudos
Message 2 of 10
(5,597 Views)

Hi Bozhidar,

 

The device is an item they are manuafacturing and has a web interface very much like a router or modern printer. E.g. point your browser at 192.168.1.50 and a web page allows you to configure the device. 

 

Kevin

0 Kudos
Message 3 of 10
(5,590 Views)

Hi Kevin,

 

What is it that you want to automate, I am not particularly clear on what it is you are looking for help with? Is it the testing of the device over the web server using LabWindows, would you be able to provide a bit more information?

 

Warm regards,

 

Luke

0 Kudos
Message 4 of 10
(5,549 Views)

Hi Luke,

 

Currently an operator has to click on a few buttons on the web page and also enter some text (set serial number, configure settings etc). The client wants to automate this process. The only way I can see to do this via the current web interface is to send keys to it.

 

Kevin 

0 Kudos
Message 5 of 10
(5,534 Views)

Hi Kevin,

 

So just to clarify, you are writing a program on Labwindows/CVI that you would like to automate the process of pressing some buttons and inputting some characters over a web server?

 

Regards,

Luke 

0 Kudos
Message 6 of 10
(5,514 Views)

Hi Like,

 

Yep that's it.

 

Kevin

0 Kudos
Message 7 of 10
(5,507 Views)

Hi Kevin,

 

As you want to automate the testing of a piece of kit I would initially think that you would need to have a certain sequence that you would like to complete, i.e. known button presses and string inputs, and then send these in a predefined sequence over using the web server. If you are familiar with Teststand that may be useful for you.

 

We have a few guidelines:

 

  • Automated tests should be completely automated (e.g., no user interaction).
  • Functional automated tests for libraries should be developed/built in CVI (not MSVC).
  • Automated tests should return 0 for pass and 1 for failure
  • Automated tests should output test case results to a log file. The user of the automated test should be able to pass in the location of the log file on the command-line.
  • Any configuration options needed by the automated test should be passed on the command-line.
  • Automated tests should be named:
    • Project files: Automated_<Library>.prj (e.g., Automated_NetworkStreams.prj)
    • Executables: Automated_<Library>_debug32.exe, Automated_<Library>_release32.exe, Automated_<Library>_debug64.exe and Automated_<Library>_release64.exe

I would suggest researching automated testing and then adapt that to work over a network.

 

Luke

0 Kudos
Message 8 of 10
(5,458 Views)

Hi Luke,

 

Thanks but I don't need any guidance on automated test, what I want to do is to interact with a web page either through a browser such as Chrome or directly via HTML from already written CVI automated test code.

 

Kevin

0 Kudos
Message 9 of 10
(5,418 Views)

Hi Kevin,

 

The first thing you should do is inspecting HTML code of the webserver. You can save HTML page on your local drive (or use F12 key in internet explorer to launch the debugger) and inspect HTML source to check actions associated to each buttons and text fields you are interested in. 

Generally, each action corresponds to HTTP POST or GET requests that can be can be emulated using Labwindows TCP library client functions. Of course, depending on the complexity of the webserver, this task could be more or less painful.

 

Regards,

Stéphane

Labwindows/CVI user since version 4.0
0 Kudos
Message 10 of 10
(5,386 Views)