LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Web manipulation with ActiveX, setAttribute

Hello

 

I'm close to get a Labview VI to update the hostname in my domain with a new dynamic IP address, but I've got a small problem.

 

The VI have been able to successfully log in and click the correct box to fill in the new IP address (2.2.2.2 , just for test), which is shown in the enclosed front panel image with green ring before saving.

When continued by clicking the button "Save Zone File", the website is updated, and unfortunately, the old IP address will return, 2.2.2.1 (this is the old test IP address also seen in the attached HTML file). Same result happens if I stop the VI before saving and at that point I'm clicking on save button.

 

If I enter the new IP address manually with the web browser in Labview front panel, the result is that the new IP address is saved, as expected.

think I'm not doing right with setAttribute call. Please, can someone help me see where the problem lies.

I'm sorry for only attaching images of the current VI and sub-VI, in that they contain other sensitive information.

Attached is also a part of the HTML code where the labels are found for the IP address.

 

(I'm using Labview 2013, Professional Development System)

 

/Karl

 

FxDomains front panel.png

Download All
0 Kudos
Message 1 of 4
(2,765 Views)

I inserted a getAttribute to see what is stored as the old value to be compared with the variant to store. I was surprised when I see the difference in characters between the old (getAttribute indicator) and the new to be saved (variant Value to apply).
The conversion from string to variant does not do what I had envisioned.

 

Is there anyone who can help me, if this transformation must be done in a different way?

 

I have saved the values ​​in the attached VI as default, so you can see the result.

 

 

/Karl

 

IE Set Element value (debug).png

 

0 Kudos
Message 2 of 4
(2,715 Views)

Here is the updated VI with getAttribute....

 

 

Download All
0 Kudos
Message 3 of 4
(2,711 Views)

During the last evening I converted my IP address without using the "string to variant.vi". Instead I converted the string to a variant with OLE format, same format as I got from getAttribute call. The output was then fed into setAttribute as Value to apply. Unfortunately, it gave no better result.

After a lot of searching in the forum I found a post about sending keyboard characters to another windows program. Sendtext.vi (in Sendkey.zip) works partially for my application, but it requires that my VI window must be active.

I also see many questions about keyboard problems from 2005 to 2006 but now we have much newer Labview versions!

The sub-vi I use "IE Set Element Value.vi" does not work in the window where the IP address should be entered, but it works on the login page for username and password. The difference that I see is that the login page is a form.

I begin to suspect that my problem is an old bug in Labview, which has not been fixed. Is there anyone who can and are able to give a small response on how to update an input window with modern technology in a web browser?

The name of the input window in the HTML code is "tblARecords_1_txtPointsto", the value 2.2.2.1 is the old IP address to be updated.

 

Please HELP !  Smiley Frustrated

 

/Karl

 

 

 

HTML code:


<TD id="tblARecords_1_pointstotd" class="datacell OneLinkNoTx" align="left">
<INPUT id="tblARecords1hdnPreviousPointsto" value="2.2.2.1" type="hidden" name="tblARecords_1_hdnPreviousPointsto">
<TABLE border="0" cellSpacing="0" cellPadding="0" width="100%">
<TR>
<TD>
<TABLE border="0" cellSpacing="0" cellPadding="0">
<TR>
<TD>

<A id="tblARecords_1_hlPointsto" class="textLink" onfocus="ARecordEditFocusRow('tblARecords_1', true, 'ddlTTLId');
" onclick="ARecordEditRow('tblARecords_1', true, 'ddlTTLId');" href="#" title="2.2.2.1">2.2.2.1</A>

 <INPUT onkeypress="EnterKeyLeaves(this.id,event);" onblur="LeaveTextBox(this.id, 'tblARecords_1_hlPointsto', 'tblARecords_1'
, 'arecord', 'data', 'tblARecords_1_pointstotd', 'Points to');" onfocus="CheckForSameRow('tblARecords_1');" onclick="ARecordNoEdit=true;
" onchange="ARecordChange('tblARecords1hdnRecModified', 'tblARecords_1', 0, '1');" style="WIDTH: 400px; DISPLAY: none;
" id="tblARecords_1_txtPointsto" value="2.2.2.1" type="text" name="tblARecords_1_txtPointsto">

 

0 Kudos
Message 4 of 4
(2,687 Views)