PDA

View Full Version : [CLOSED] Textfield concealing value from HTML in Ext.net 2.2



RCM
Jul 19, 2013, 12:25 PM
Our automation team is working to write some automated test scripts for our application and are running into problems getting the value of ext textfields. Unlike ext labels, the value of textfields are not being exposed in the HTML of the page. If I understand them correctly, this is a change from the behavior they experienced in ext.net 2.1.
Is there a configuration option for textfields to set that will expose the value in the HTML of the page? Or is there another way for the test script to retrieve the value of the field using the id?

Thanks

Daniil
Jul 19, 2013, 1:15 PM
Hi @RCM,

I tried with this page.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:TextField runat="server" Text="Test" />
</form>
</body>
</html>


In the output HTML I see an input element with value="Test".

RCM
Jul 19, 2013, 5:40 PM
Thanks for your response. I seems I missed a few points to clarify.

The issue is with user input fields. The textfields are initially empty, but the user inputs data into the field. The automation script is checking the data entered by the user into the textfields, but this value is not available in the output html.

Vladimir
Jul 19, 2013, 6:56 PM
The automation script is checking the data entered by the user into the textfields, but this value is not available in the output html.

Can you clarify it? How the automation script check? Can you post that script? How we can reproduce it?

Daniil
Jul 19, 2013, 10:17 PM
The issue is with user input fields. The textfields are initially empty, but the user inputs data into the field. The automation script is checking the data entered by the user into the textfields, but this value is not available in the output html.

Typing in a TextField changes its dom.value. Do you mean "dom.value" under "output HTML"?

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:TextField ID="TextField1" runat="server" Text="Test" />

<ext:Button runat="server" Text="Get dom.value" Handler="alert(App.TextField1.inputEl.dom.value);" />
</form>
</body>
</html>

RCM
Jul 25, 2013, 12:22 PM
Sorry about the delay in responding, I was assigned to another task and lost track of this.
I've gotten updates from the Automation team about what exactly they're looking for.

When inspecting a label, the value of the label is visible in the page html:
6624
Notice the red underlined portion of the image. The label text, in this case "Username:" is available in the source of the page.

When inspecting a textfield, the value of the field is not visible in the page html:
6623
Notice that the text "Testdata" does not appear as part of the element html.

Is there configuration option to set in the creation of the textfield control to display the current value in teh html of the page, or is there another approach that should be used to get the value of the field?

Daniil
Jul 25, 2013, 1:26 PM
Let's go back to my example in the post #2 (http://forums.ext.net/showthread.php?25731#post113721).

It is what I see in the HTML, the "Test" is there.
6625

Please provide your test case.

RCM
Jul 25, 2013, 6:18 PM
I'm having the problem with the following code (from your example in post #2)



<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />

<ext:TextField ID="TextField1" runat="server" Text="Test" />
</form>
</body>
</html>


The issue isn't with predefined values in textfields, but with user input. When the text in the textfield is changed, there is no change to the html.
6627

The automation team wants to be able to get the user input from textfields. Is this possible?

Baidaly
Jul 26, 2013, 2:40 AM
Hello!

It's default browsers behavior. You can try to check it using this code:


document.getElementById('TextField1-inputEl').value = "Another value"

66286629

You should check input using JavaScript because by default JavaScript doesn't override value property in HTML.

Daniil
Jul 26, 2013, 5:45 AM
I don't think it is somehow related to Ext.NET or ExtJS and its versions. The same behavior is reproducible with a pure HTML page.

Example

<%@ Page Language="C#" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Example</title>
</head>
<body>
<form runat="server">
<input type="text" value="initial" />
</form>
</body>
</html>

But the more important thing is the fact the a DOM's value is actually updated and you can get it as I demonstrated in the example here:
http://forums.ext.net/showthread.php?25731#post113747

Is it not a way how your automation script gets access to TextFields' values? If no, please clarify how?