我有一个复杂的界面,上传文件是三个步骤(论坛不允许我添加窗口的屏幕截图,所以请尝试可视化它)第 1 步单击浏览选项卡并选择要上传的文件(这将创建进度条) 第 2 步单击开始上传按钮 第 3 步单击完成按钮 关于页面上元素的萤火虫信息已粘贴在页面底部。我的浏览按钮的 ID 是 fileInputUploader
我用来尝试上传文件的代码是(在我的测试类中)
WebElement upload = driver.findElement(By.id("fileInputUploader"));
upload.sendKeys("C:/Users/Deepankur/Desktop/Deepankur Folder/selenium Test Cases/test12.jpg");
但它什么也没做
我在第 2 步中看不到上传进度动画,所以我可以点击开始上传并完成它。任何帮助都感激不尽。
这是我页面这一部分的 html
<div style="padding: 20px; border: 2px solid #ccc; margin: 12px 0 0 0; width: 100%;" id="multiUploader">
<input width="110" type="file" height="30" id="fileInput" name="fileInput" style="display: none;"><object width="110" height="30" type="application/x-shockwave-flash" data="/core/webcore/swf/uploadify.swf" id="fileInputUploader" style="visibility: visible;"><param name="quality" value="high"><param name="wmode" value="opaque"><param name="allowScriptAccess" value="always"><param name="flashvars" value="uploadifyID=fileInput&pagepath=/core/root/&script=/core/application/pApproval/uploadify.cfm&folder=//192.168.100.51/client_data/CPM_ConcretePlatform_DEV/userUploads&scriptData=project_id%3D19%26client_id%3D2172%26project_file_type%3D2%26file_zone_id%3D104%26file_zone_group_id%3D17%26parent_project_file_id%3D0%26approval_rule_id%3D10%26job_id%3D519%26status_id%3D17&width=110&height=30&wmode=opaque&method=POST&queueSizeLimit=20&simUploadLimit=1&fileDesc=Please see the list of allowed file extensions under More Help Uploading&fileExt=*.jpg;*.tif;*.pdf;*.qxd;*.eps;*.psd;*.zip;*.doc;*.ppt;*.xls;*.pdf;*.mov;*.ai;*.png;*.bmp;*.ait;*.dwg;*.dxf;*.flv;*.indd;*.txt;*.inx;*.gif;*.cad;*.docx;*.xlsx;*.pptx;*.mpp;*.m2v;*.avi;*.vob;*.mpg;*.wmv;*.mp4;*.m4v;*.misc;*.ppsx&multi=true&sizeLimit=26214400&fileDataName=Filedata"></object><div class="uploadifyQueue" id="fileInputQueue"></div>
<br>
<br>
<a class="uploadButton" href="javascript:$('#fileInput').uploadifyUpload(); uploadStartFinishButton();">Start Upload</a>
</div>