SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Jun 2008
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Problem of using DO_GetReplyBuffer()

    Dear All,
    I met a problem when i use GetReplyBuffer() to receive string which send from server.
    My script looks like this:

    BEGIN_TRANSACTION();
    ......
    Navigate_To("login page")
    DO_SLEEP(2);
    ........
    DO_ExtractString(DO_GetReplyBuffer(),1,"leftstring ","rightstring"
    ,&szString);
    ......
    Navigate_To("logout page")
    ........
    END_TRANSACTION();

    My question is why didn't DO_GetReplyBuffer() work in the following transaction after the first transaction?

    for instance, i set two transaction and one VU for this script, when it runs, at the first transaction,
    GetReplyBuffer return "Mon,16 Jun 2008 05:21:53(this is the sever time)StringUniqueID1"
    but the at the second transaction, it still return the \
    same string:"Mon,16 Jun 2008 05:21:53 StringUniqueID1",actually the StringUniqueID has changed for i can see that in web page,obviously it seems to reuse the the string which got at the first transaction, and i want to know how to solve this problem.
    I have tried the Clear(All),DO_Clear(All) but they all didn't work.
    Thanks in advance.

  2. #2
    Junior Member
    Join Date
    Jun 2008
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Problem of using DO_GetReplyBuffer()

    I also tried DO_Clear(TRANSACTION);

  3. #3
    Junior Member
    Join Date
    Jun 2008
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Problem of using DO_GetReplyBuffer()

    And pacing time

  4. #4
    Senior Member
    Join Date
    Nov 2000
    Location
    Michigan, USA
    Posts
    840
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Problem of using DO_GetReplyBuffer()

    illu, Are you using the "old c-style" scripts created in a version of QALoad prior to 5.6?

    DO_Clear only removes cache and cookies, this does not clear out the contents of the variables.

    In the "old c-style" scripts, you would need to clear the variables explicitly.
    So for char * szR the commands that must come at the end of your transaction loop (inside of END_TRANSACTION) would be:
    free(szR);
    szR=NULL;

    This frees the memory to avoid a memory leak and sets the value to NULL so that you wouldn't get the same value over again.

    If you are using the the variable more than once in the same script, you can set it to NULL before each use.

    In the c++ style scripts created from the Visual Navigator, I haven't had to clear any variable strings as long as I use CLoadString as the type. It seems that the RESTART_TRANSACTION_BOTTOM clears these var types.

    Hope this helps.
    A problem is a difference between what is perceived and what is desired, that
    we want to reduce
    (Dewey 1933)

  5. #5
    Junior Member
    Join Date
    Jun 2008
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Problem of using DO_GetReplyBuffer()

    drazle,I'm using c++ style script and visual scripting.I tried Clear(ALL) in my c++ script,but it didn't work either.The point is GetReplyBuffer() return the same string at each transaction.

    I replaced DO_ExtractString clause with this:
    printf("This is the reply string:%s",DO_GetReplyBuffer());

    it returned the same string with the same time stamp.
    Thank you for your help.

  6. #6
    Senior Member
    Join Date
    Nov 2000
    Location
    Michigan, USA
    Posts
    840
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Problem of using DO_GetReplyBuffer()

    Why don't you use the Get command for c++?

    Did you try to insert the extract string in Visual Navigator? If so, you should see the extract look like this
    <font class="small">Code:</font><hr /><pre>
    __variable_name = Get(REPLY,STRING,"leftstring","rightstring");</pre><hr />

    In fact, DO_ExtractString may be from the C-style scripts...
    A problem is a difference between what is perceived and what is desired, that
    we want to reduce
    (Dewey 1933)

  7. #7
    Junior Member
    Join Date
    Jun 2008
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Problem of using DO_GetReplyBuffer()

    I tried,but Get(REPLY,ENTIRE_BUFFER) return nothing, only
    GetReplyBuffer can return string.

    Anyway,thank you.

 

 

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 02:41 AM.

Copyright BetaSoft Inc.