SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Jun 2005
    Location
    India
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Object location Problem

    I am writing scripts for some web application, in which on each update of some data, one edit box will be added to the same screen. It may be in different locations from location:0 to location:6 within a table in following rows.Object in first row (say "ObjA") has discription,
    { class:edit, MSW Class:html_edit, html_name: commentsDis, location:0}
    and object in second row (say "ObjB") has description,
    {class:edit, MSW Class:html_edit, html_name: commentsDis, location:1}.
    Sometimes it may happen that ObjA is absent and ObjB is present based on data update. In this situation description of added edit box is like
    {class:edit, MSW Class:html_edit, html_name: commentsDis, location:0} i.e nothing but description ObjA. So obj_exists("ObjB") fails and obj_exists("ObjA") passes but that is not desired. So that i am not able track which row is updated exactly. Anyone please help me to solve this problem....
    Thanks in Advance
    Prashant

  2. #2
    Junior Member
    Join Date
    Jun 2005
    Location
    Netherlands
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Object location Problem

    I don't have Winrunner installed right now, so I think I use the wrong function description name, but you'll get the idea. I assume that the description is in column 1 and the editbox in column 2.

    Build a function that finds the text data in column one with a simple for loop:
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">tbl_get_row_count(table, row_count);
    for (rownumber=1; rownumber&lt;=row_count, rownumber++) {
    tbl_get_text(table, rownumber, 1, text);
    if (text == expected_text) break;
    }</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Rownumber is now the row where you want to get your object. Now we are going to get the objects physical description:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">rc = tbl_get_child_data(table, rownumber, 2, &quot;html_edit&quot;, physical_description);
    # if rc != E_OK then the edit box did not exist in this row.
    # with physical_description, you can do whatever you want: Fill, check the attributes etc.
    edit_set(physical_description, &quot;Now filling the editbox in the row with text: &quot; text);</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">

 

 

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 11.54%
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 09:57 AM.

Copyright BetaSoft Inc.