SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    May 2007
    Posts
    57
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Confusing: objTest.Exist(timeout) weird behaviour

    Hi All,

    I am using QTP 9.2

    I have been obseverving weird behavour of .Exist() method of QTP.

    I have used .Exist() as follows:

    'Variables declaration:
    Dim timeout
    timeout = 50000 'in milliseconds
    .
    .
    .
    .
    .
    If objTest.Exist(timeout) Then
    Perform some action
    Else
    Perform other action
    End If

    Here, .Exist() statement is expected to check whether target object exists within 50 seconds or not. If object does not exist then it should proceed with else part of 'If' block.

    However, at run time, if object does not exist, then the above .Exist() statement simply goes into infinite loop irrespective of provided timeout argument untill I stop or pause the execution.

    This behaviour is not observed everytime. Sometimes .Exist() works as expected but majority of times it fails.

    Has anybody faced similar kind of issue?

    Is it really an issue or there is something to take care of which I have not?

    Regards,
    Milind

  2. #2
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,730
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Confusing: objTest.Exist(timeout) weird behaviour

    What is the actual/full objTest defintion/syntax.

    It is probably something like Browser.Page.obj or Browser.Page.Frame.obj, etc. And in that case the 50 second timeout will be used waiting for the existance of EACH parent in the the object chain, not just the final obj.

  3. #3
    Moderator
    Join Date
    Jan 2007
    Location
    Pittsburgh, PA
    Posts
    2,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Confusing: objTest.Exist(timeout) weird behavi

    Exist method takes seconds as an argument and not Milli seconds, it's a bug in the qtp online documentation. Try using seconds instead of Milli seconds.

    Try this:
    timeout = 50 'Seconds
    If objTest.Exist(timeout) Then
    Perform some action
    Else
    Perform other action
    End If

  4. #4
    Junior Member
    Join Date
    Jan 2009
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Confusing: objTest.Exist(timeout) weird behavi


    i used "If object.exist(4)" only.. but QTP waits for more than 10 seconds.. some times 30 seconds..... what to do in this condition.

  5. #5
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,839
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Confusing: objTest.Exist(timeout) weird behavi

    Reduce the Object Sync Timeout parameter and disable smart identification in Test Settings > Run

    Mark Smith.

 

 

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.40 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.7.1 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:29 PM.

Copyright BetaSoft Inc.