51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 1949|回复: 4
打印 上一主题 下一主题

[求助] 上传图片,input定位不到

[复制链接]
  • TA的每日心情
    奋斗
    2015-12-3 20:30
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]测试小兵

    跳转到指定楼层
    1#
    发表于 2017-7-31 17:35:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    上传图片,"//div[@id='filePicker']/div[2]/input[@name='file']"
    使用sendkeys(),为什么定位不到Input呢?
    <html>

        <head></head>
        <body>
            <div class="container">
                ::before
                <div class="row">
                    ::before
                    <!--

                    left

                    -->
                    <div class="col-xs-10 col-xs-offset-1">
                        <div class="left-container">
                            <form id="uploadFile" class="form-horizontal" action="" method="post" role="form"></form>
                            <form id="form-01" class="form-horizontal datepicker validateFormForAjax" role="form" action="/auditingInfo/submitApplication" novalidate="novalidate">

        <input type="hidden" value="I6F67NKOO6YJQV6LF6SP1PL3C5SBCOQE" name="SPRINGMVC.TOKEN"></input>
        <div class="panel panel-primary"></div>
        <div class="product-one">
            <ul class="nav nav-pills nav-bg" role="tablist"></ul>
            <div class="tab-content">
                <div id="module-one" class="tab-pane " role="tabpanel"></div>
                <div id="module-two" class="tab-pane active" role="tabpanel">
                    <div id="attachMan">
                        <div id="upload-img">
                            <iframe id="webUploader_iframe" width="100%" height="580px" frameborder="0" border="0" src="/attachmentCar/attachManage">
                                #document
                                    <html>

        <head lang="zh-CN"></head>
        <body>
            <!--

             easyUI-layout begin

            -->
            <div id="uploader_layout" class="easyui-layout layout" style="width:100%;height:98%;">

        <div id="attachView"></div>
        <!--

         左侧类型区域

        -->
        <div class="panel layout-panel layout-panel-west layout-split-west" style="left: 0px; top: 0px; width: 225px;">

        <div class="panel-header" style="width: 215px;"></div>
        <div class="panel-body layout-body" style="width: 225px; height: 532px;" title="" data-options="region:'west',split:true"></div>

    </div>
    <!--

    附件上传显示区域

    -->

    <div class="panel layout-panel layout-panel-center" style="left: 230px; top: 0px; width: 1316px;">

        <div class="panel-header" style="width: 1306px;"></div>
        <div id="attachManage_area" class="panel-body layout-body" style="padding: 8px; width: 1300px; height: 516px;" title="" data-options="region:'center'">
            <!--

             内嵌的layout,用来区分按钮和上传结构

            -->
            <!--

             附件操作区域

            -->
            <div style="height:30px" data-options="region:'north',split:true,border:false"></div>
            <div data-options="region:'center',border:false">
                <div id="manage" class="container-fluid" style="padding: 5px 0px 0px 10px">
                    ::before
                    <div id="upload-img">
                        <iframe id="webUploader_iframe" width="1236.8000000000002" height="397.59999999999997" frameborder="0" border="0" src="/attachmentCar/toUploader">
                            #document
                                <!DOCTYPE public>
                                <html>

        <head lang="zh-CN"></head>
        <body>

        <!--

        dom结构部分

        -->
        <!--

         <div id="uploader-demo">

        -->
        <!--

        用来存放item

        -->
        <!--

         <div id="fileList" class="uploader-list"></div>
        <…

        -->
        <form id="attachmentId_form" style="display: none" action=""></form>
        <!--

         webUploader-container   class="container"

        -->
        <div class="page-container">
            <!--

             <h1 id="demo">Demo</h1>
                <p>拖拽,截屏,然后激活窗口后粘贴,或者…

            -->
            <!--

             uploader容器

            -->
            <div id="uploader" class="">
                <!--

                 上传序列预览区,拖拽功能区域

                -->
                <div class="queueList filled">

        <!--

         没选择文件之前的内容

        -->
        <div id="dndArea" class="placeholder element-invisible">
            <div id="filePicker" class="webuploader-container">
                <div class="webuploader-pick"></div>
                <div id="rt_rt_1bmbv4t1h1omibuv1dnigt0a291" style="position: absolute; overflow: hidden; bottom: auto; right: auto; width: 168px; height: 44px; top: 0px; left: 153.483px;">
                    <input class="webuploader-element-invisible" type="file" name="file" multiple="multiple" accept="image/*,application/msword,application/pdf,application/vnd.m…on/zip,application/x-rar-compressed,application/octet-stream"></input>

    <label style="opacity: 0; width: 100%; height: 100%; display: block; curso…er; background: none repeat scroll 0% 0% rgb(255, 255, 255);"></label>

                </div>
            </div>
            <!--

             批量选择文件

            -->
            <p></p>
        </div>
        <ul class="filelist"></ul>

    </div>
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    昨天 07:19
  • 签到天数: 2677 天

    连续签到: 3 天

    [LV.Master]测试大本营

    2#
    发表于 2017-8-1 08:02:34 | 只看该作者
    使用什么工具
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2015-12-3 20:30
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]测试小兵

    3#
     楼主| 发表于 2017-8-1 16:23:49 | 只看该作者

    selenium+java
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2015-12-3 20:30
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]测试小兵

    4#
     楼主| 发表于 2017-8-1 18:37:21 | 只看该作者
    此问题已解决,此结构中有两层iframe,之前一直定位iframe有问题。
    解决办法:定位两次iframe,再使用sendkeys(),就OK了。
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-5-23 00:16 , Processed in 0.064914 second(s), 22 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表