简体   繁体   English

我无法获得精确的框架,也无法使用硒网络驱动器选择精确的元素

[英]I am not able to get Exact frame and not able to select exact element using selenium web drive

    <script>
        document.cookie='_srn=;expires=Thu, 01 Jan 0000 00:00:00 GMT;';    
    </script>    
    <script>
        var strWindowId = "3pfb5VLw8QBMYH8eEuW2DFosHws0sm6e8da7mBeEXqsb";
    </script>
    <script language="javascript">
        navigator.id = "1433841867";</script>
    <script language="javascript">
        top._swescript = window;
    </script>
    <script language="javascript" src="23016/scripts/rtcEditor.js"></script>    
    <script language="javascript" src="23016/scripts/swecommon_top.js"></script>    
    <script language="javascript" src="23016/scripts/swecommon.js"></script>
    <script language="javascript" src="23016/scripts/navctrl.js"></script>
    <script language="javascript" src="23016/scripts/sweutil_keyboard.js"></script>
</head>

    <frameset rows="100%,*" border="0" frameborder="No" onunload="SWEUnloadApp(&quot;/esales_enu/start.swe&quot;,&quot;&quot;,&quot;3pfb5VLw8QBMYH8eEuW2DFosHws0sm6e8da7mBeEXqsb&quot;)">
        <frame name="_sweclient" title="" src="/esales_enu/start.swe?SWECmd=GetCachedFrame&amp;SWEACn=20956&amp;SWEC=1&amp;SWEFrame=top._sweclient&amp;SRN=3pfb5VLw8QBMYH8eEuW2DFosHws0sm6e8da7mBeEXqsb" marginheight="0" marginwidth="0" noresize="" scrolling="No" cd_frame_id_="295be8d5723232bd8677e4a4e252aa46">
        <frame name="_swe" title="" src="/esales_enu/start.swe?SWECmd=GetCachedFrame&amp;SWEACn=20956&amp;SWEC=1&amp;SWEFrame=top._swe&amp;SRN=3pfb5VLw8QBMYH8eEuW2DFosHws0sm6e8da7mBeEXqsb" marginheight="0" marginwidth="0" noresize="" scrolling="No" tabindex="-1">
    </frameset>
</html>

this is the actually i am getting in the HTML source this is not expected because .i want Click below Attribute but same i am not getting in the Above HTML source.这实际上是我进入 HTML 源代码的结果,这不是预期的,因为我想要点击属性下方,但同样我没有进入上述 HTML 源代码。 when i Do Manually Inspect Element I will get below attribute but same when i run my script .I am Getting No Element Found Exception and No frame Exception found当我手动检查元素时,我将获得以下属性,但在我运行脚本时相同。我没有找到元素异常和没有找到框架异常

<input type="text" name="s_1_1_102_0" value="" style="width:132" id="s_1_1_102_0" tabindex="2997" maxlength="255">

Please Help me to Resolve this if my above Comment is not Enough .please ask me for more details如果我的上述评论不够,请帮助我解决此问题。请向我询问更多详细信息

Possibly the element has not loaded by that time.可能该元素到那时尚未加载。 try implementing waits on your code.尝试在您的代码上实现等待。 Good detailed information can be found here - http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp在这里可以找到很好的详细信息 - http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp

If it is a synchronization issue you can try the code below:如果是同步问题,您可以尝试以下代码:

WebDriverWait wait = new WebDriverWait(driver, 50);
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.id("iFrame")));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM