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

226 Views Asked by At
    <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. 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

2

There are 2 best solutions below

0
On

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")));
0
On

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