webbrowsercontrol working with Frams in

Posted on 2011-10-19
Last Modified: 2012-05-12
How can I retrieve frame controls by using webbrowsercontrol?

I am using webbrowserControl in to automation submition of a form in java based website.
The page which I am trying to submit is having  frames .
The controls -Username and password controls are in that frames.

Its urgent any help will be useful for me.
<webbrowserControl>.Document.Window.Frames to get frames.
But no use i need to get the controls and enter username and password.

Attached is screen and source code for the webpage.

Please help me.
<!-- Entrust TruePass 8.0 -->

        <title>Authenticate Entrust Roaming Security Store User</title>

        <!-- The following 5 <script></script> - tags are needed to load the JavaScript
        functions and configuration into the page. They have to be in the final page
        exactly as they are here. Of course the commentaries can be removed. -->

        <!-- The empty <script></script> - tag is needed because of a bug in Netscape
        browsers. Sometimes Netscape browsers don't execute the code in the first
        <script></script> tag but they will always execute the code contained in all
        the following <script></script> tags on the same webpage. -->
        <script language="JavaScript">
        <!-- This <script>/<script> - tag loads the configuration file into this page. -->
        <script language="JavaScript" src="javascript/EntrustTruePassClientConfig.js">
        <!-- This <script></script> - tag loads the JavaScript functions into this page.
        You must not call any function contained in this file directly. They are all called
        through the API -->
        <script language="JavaScript" src="javascript/EntrustTruePassClientPrivate.js">
        <!-- This <script></script> - tag loads the API into this page.
        This API contains every function that can be called from the webpages. -->
        <script language="JavaScript" src="javascript/EntrustTruePassClientAPI.js">
        <!-- This <script></script> - tag calls the function that initializes the API. -->
        <script language="JavaScript">

    <!-- The frameset defines two frames, where one is an invisible frame (size 0) that
    contains the applet and the other frame contains the GUI. -->
    <frameset rows="0,*" border="0" frameborder="0" framespacing="0">
        <!-- It's mandatory that the Applet page in this frame contains the applet,
        without any additional frame in it, because the Applet Page creates a link
        to this page.
        The name of this frame must be the same as defined in the Configuration as
        appletFrameName. -->
        <frame name="entrustTruePassAppletFrame" src="EntrustTruePassApplet.html" marginwidth="0" marginheight="0" scrolling="no" noresize>
        <!-- It is mandatory for the frame where the user interaction happens to have
        the name defined in the Configuration as appletHtmlGuiTarget-->
        <frame name="entrustTruePassGuiFrame" src="AuthenticateUserInputRoamingEPF.html">

Open in new window

Question by:Nettodotnet
    LVL 28

    Expert Comment

    Frames are a tricky thing to use in programming for many reason. They have security built in them and you CANNOT access ANY object in a frame from the page including the frame.

    Imagine this, you add "https;//" to your page via a frame. Let's assume you are a malicious person and that Frames allowed what you want them to do. Someone clicks a link to your site and thinks they are logging into GMail. Your code retrieves the person's username/password from the frame, stores them to your databse, and sends them to Google as if nothing happened. TERRIBLE security hole this way.

    If you need access to those controls, you can't do it in a frame.

    Accepted Solution

    After researching one day i find this solution.Just in case some one need :).

    --this will give you html
    string str =<WebControl>.Document.Window.Frames["<FrameName>"].Document.Body.InnerHtml;

    --Pick the controls name and use in below code
    HtmlDocument doc = wb.Document.Window.Frames["<FrameName>"].Document;
                    doc.GetElementById("<username>").InnerText = "abc";
                    doc.GetElementById("<password>").InnerText = "cba";

    Author Closing Comment

    find out soluiton by myself

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    It’s quite interesting for me as I worked with Excel using for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now