无法读取网页中的字段 [英] not able to read fields in the web page

查看:48
本文介绍了无法读取网页中的字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在为TFS weblayout开发自定义控件。在开发过程中,我需要找到一个字段并将其类型更改为"密码"

I'm developing custom controls for TFS weblayout. During thedevelopment, I need to find a field and change its type to 'Password'

我能够在旧模型中实现此目的,在那里我找到了一个有价值的标签'密码'using 

I was able to achieve this in the old model where I used to find a label which has value 'Password' using 


$ " label:contains('Password ')"

推荐答案

我还观察到生成了一个iframe,我所指的文件就在其中。

I also observed that an Iframe is generated inside which the document i'm referring to.

现在从子文档中,我需要导航到父(最顶层)文档,然后找到该元素。我怎样才能做到这一点。

Now from the child document, I need to navigate to the parent(top most) document and then find the element. How can I achieve this.

这就是我的页面结构的样子

this is how my page structure looks like

< html页面级标记>

  &NBSP; < head>

  &NBSP; &NBSP; &NBSP; < script>

  &NBSP; &NBSP; &NBSP;这是我的js文件所在的位置

  &NBSP; &NBSP; &NBSP; < / script>

  &NBSP; < / head>

< body>

  &NBSP; < input type =" text" ID = QUOT; witc_25_txt"自动填充= QUOT;脱" MAXLENGTH = QUOT; 255" aria-invalid =" false">

  &NBSP; &NBSP; &NBSP; < iframe>

  &NBSP; &NBSP; &NBSP; #document

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < html>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < head>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < script>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;这是我的js文件所在的位置

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < / script>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < / head>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < body>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < / body>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < / html>

  &NBSP; &NBSP; &NBSP; < / iframe>

< / body>

< / html>

<html page level tag>
    <head>
        <script>
        Here is where my js file resides
        </script>
    </head>
<body>
    <input type="text" id="witc_25_txt" autocomplete="off" maxlength="255" aria-invalid="false">
        <iframe >
        #document
            <html>
                <head>
                    <script>
                    Here is where my js file resides
                    </script>
                </head>
            <body>
            </body>
            </html>
        </iframe>
</body>
</html>

我需要从中访问输入元素js文件在html标签旁边。

I need to access input element from the js file out side the html tag.

感谢您的回复。


这篇关于无法读取网页中的字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆