User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Points for Confirmed Friends

    Embedded Internet Explorer, Problem Getting Text

    Hi everyone,

    I have some problems and would appreciate any help [img]/images/graemlins/smile.gif[/img]

    ================================================== ============================================

    OS: Win XP
    GUI Type: Web embedded in Win32/VB?
    Browser: IE 6.02
    WR Version: 8.20 (addons loaded: ActiveX, PB, VB, WebTest)

    ================================================== ============================================

    Problem Scenario:
    ================================================== ============================================

    I am using WinRunner to input data to an application (let's call it 'B') which uses an embedded Internet Explorer Window (COM-Object?), i.e. there is a web page with some forms which I want to fill with data, and that web page is displayed inside of another application (without any Internet Explorer toolbars etc., but for example the IE context menu is available via right-click).

    The first problem is that WinRunner does not recognize the elements in the web page correctly. There are input fields, dropdown boxes etc., but WinRunner's GUI Spy does only recognize the whole web page window as one object:

    {displayed: 1, width: 1021, x: 0, y: 0, abs_x: 2, class: object, MSW_class: "Internet Explorer_Server", abs_y: 86, maximizable: 0, focused: 0, height: 651, active: 0, MSW_id: 0, handle: 17957468, minimizable: 0, nchildren: 6, enabled: 1, TOOLKIT_class: "Internet Explorer_Server"}

    The input fields on the web page are not recognized at all, same problem with links or buttons, only the dropdown boxes are recognized as objects, for example:

    {displayed: 1, width: 51, x: 420, y: 353, abs_x: 422, class: object, MSW_class: "Internet Explorer_TridentCmboBx",abs_y: 439, maximizable: 0, focused: 0, height: 22, active: 0, MSW_id: 80, handle: 16188256, minimizable: 0, nchildren: 0, enabled: 1, TOOLKIT_class: "Internet Explorer_TridentCmboBx"} (this is all the output of the "all standard" tab of the GUI spy)

    The problem is that, because of some JavaScript in that web page, the position as well as the MSW_ids (!) of these dropdown boxes keep changing depending on some input, so there is no reliable method to address these boxes

    Can you give me any hint on how to bring WinRunner to recognizing theses fields etc.? If I open the same web page in an external internet explorer window, it all works fine, WinRunner recognizes the form fields etc., but not inside of application 'B'. Sadly, Application 'B' takes some information from the web page after I clicked on 'submit' on the page, so using an external browser window is not an option.

    Second problem/question: Sometimes, after some time, WinRunner stops recognizing text on that browser window. When using win_get_text or obj_get_text, it simply puts out an empty string. I cannot reconstruct that behaviour, at first (after starting the application 'B') it works fine, but then, after some time, suddenly WinRunner does not recognize the same text it recognized some seconds ago. There is no change - the content of the window (i.e. the webpage) is not altered at all, nothing has happend, but suddenly ... :-/

    Related to that: Sometimes when I use obj_find_text, I get the return code -10134, E_AREA_COVERED, "Desired area is hidden" - could you please explain that message? I didn't find anything on google etc. :-/

    Finally a question: Is there a simple way to set the focus to a specific object? If there is some problem, I want to show a message to the user and then continue at the same object as before. At the moment, my code consists of

    1. saving the description of the currently focused object to a variable 'gui' via obj_get_desc("{ class: object, focused: 1 }", "", "", "", gui);
    2. asking the user for some input (MessageBoxA(...))
    3. getting x and y coordinates for the object I saved via obj_get_info(gui, "x", x); obj_get_info(gui, "y", y);
    4. using win_activate and set_window, then clicking on the upper left corner of the window to reset the focus to that window
    5. doing a right-click on the coordinates x and y

    This actually works - after that, the focus is back on the object that was focused before the user input, but it does not seem very nice. Is there some way to say obj_focus(gui) etc., replacing steps 3 to 5?

    Attempts to solve the problem:
    ================================================== ============================================

    First problem: output of GUI spy is displayed above, that does not help much, virtual objects don't work (as the position kepps changing), I tried to recognize some fixed text string on that webpage and calculated the positions from there, but that leads to the second problem.

    The second

    # set correct window via a user defined function, this works fine
    rc = set_window(...);
    if (rc != E_OK) {
    report_msg("Inital Window not as expected.");
    return rc;

    rc = obj_find_text(objSR, "ddmmyyyy", coordinates);
    MessageBoxA(0, rc & "\n" & x & "\n" & y, "", 0);

    This MessageBox pops up and sometimes it displays the correct coordinates, but after some time, this does not work anymore. Then I try "win_get_text", and that shows the same behaviour: At first it gets some text, but after some time, it just returns an empty string.

    Information source:
    ================================================== ============================================
    Searched in WR help, WR tutorial, WR userguide, etc., WinRunner FAQ, Wilson Mar, odo.lv, itechnologist.com, general google etc.

    ************************************************** ********************************************

    Thank you very much for your time and effort, thanks for any help with these questions! Klaas

  2. #2
    Points for Confirmed Friends

    Re: Embedded Internet Explorer, Problem Getting Te


    I got some replies on a mailing list, so just to let you know what worked:

    > 1. Open wrun.ini under os folder(c:\windows or c:\winnt), under [ie_hooks]
    > section, add your appl in, such as b.exe=yes.

    Thank you, very good, that simple switch solved all my problems [img]/images/graemlins/smile.gif[/img]

    > 3. You can use Win32 api to set focus.

    You are right, thanks!

    > Use can use Regular Expression (see User Guide), you can change
    > pysical description if the objects in run-time.

    There was no system in the IDs, i.e. as all the controls had random (?)
    numbers, I could not distinguish them by there numbers.

    > 2. try to use web_obj_get_text
    > 5. web_event ( object, "focus" [, x , y ] )

    Both works, but only after enabling Nr. 1 above.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 8.70%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:11 AM.

Copyright BetaSoft Inc.