SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Sep 2008
    Location
    India
    Posts
    422
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Dont want to report an error in log files

    Hi,

    If we are checking some object existance on the screen , and TC doesn't find an object then its report an error "unable to find an object".We don't want to report this thing to an error log, what we can do for this?
    I am posting a bit code here to understand my problem.

    set window1=sys.process("Someprocess").somewindow
    varExist=window1.exists
    if varExist=true then
    log.message("true")
    else
    log.message("False")
    end if

    here somewindow is not found then it shows an error that i don't want to report an error log.
    please help me how can i resolve this problem

    thanks,
    vivek
    ~Vivek
    -------------------------------------------
    Software Testing Interview Question and Answer
    --------------------------------------------

  2. #2
    Moderator tristaanogre's Avatar
    Join Date
    Mar 2006
    Location
    Pennsylvania, USA
    Posts
    1,792
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dont want to report an error in log files

    You need to use a "Wait" method of some sort before you use exists. Something like

    <font class="small">Code:</font><hr /><pre>
    set window1=sys.process("Someprocess").WaitChild("some window",10000)
    varExist=window1.exists
    if varExist=true then
    log.message("true")
    else
    log.message("False")
    end if
    </pre><hr />

    Please see the help topic "Waiting for a Process or Window Activation" for more information.
    -Robert Martin
    Automated Testing Evangelists
    TestComplete "expert"
    Definition expert - noun - Unknown drip under pressure

  3. #3
    Member
    Join Date
    Sep 2008
    Location
    India
    Posts
    422
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dont want to report an error in log files

    Hi Robert,

    actually i am facing an problem that sometimes confirmation window comes and sometimes not i,e depend upon condition, if confirmation window doesn't comes that time TC reports an error in "set" command that "unable to find an object".

    everything works fine but that makes my script failed.

    suggest me what can i do for this?

    thanks
    Vivek
    ~Vivek
    -------------------------------------------
    Software Testing Interview Question and Answer
    --------------------------------------------

  4. #4
    Moderator tristaanogre's Avatar
    Join Date
    Mar 2006
    Location
    Pennsylvania, USA
    Posts
    1,792
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dont want to report an error in log files

    Even in that situation, Vivek, you'll want to use a "Wait" method of some sort. You should do something like

    If WaitChild("TheFormIWant").Exists then begin
    w := p.TheFormIWant;
    w.OKButton.Click
    end
    else
    DoSomethingElse;

    The key is that you should use a Wait function to detect the existance in conjunction with the Exists method. If you use "Exists" without a Wait function, you will get the error as reported.
    -Robert Martin
    Automated Testing Evangelists
    TestComplete "expert"
    Definition expert - noun - Unknown drip under pressure

  5. #5
    Member
    Join Date
    Sep 2008
    Location
    India
    Posts
    422
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dont want to report an error in log files

    Hi Robert,

    The code is

    if Sys.Process("eDevix").Window("#32770", "Devix Commerce Suite").Exists then
    Call Sys.Process("eDevix").Window("#32770", "Devix Commerce Suite").Window("Button", "&amp;Yes").ClickButton
    end if

    Here if confirmation window will come thats fine otherwise TC reports an error in error log.

    please help me...

    thanks,
    vivek
    ~Vivek
    -------------------------------------------
    Software Testing Interview Question and Answer
    --------------------------------------------

  6. #6
    Member
    Join Date
    Sep 2008
    Location
    India
    Posts
    422
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dont want to report an error in log files

    Hi,

    I am resolve this issue using waitwindow method.

    if Sys.Process("eDevix").WaitWindow("#32770", "Devix Commerce Suite",-1,2000).Exists then
    Call Sys.Process("eDevix").Window("#32770", "Devix Commerce Suite").Window("Button", "&amp;Yes").ClickButton
    end if

    thanks,
    Vivek
    ~Vivek
    -------------------------------------------
    Software Testing Interview Question and Answer
    --------------------------------------------

  7. #7
    Moderator tristaanogre's Avatar
    Join Date
    Mar 2006
    Location
    Pennsylvania, USA
    Posts
    1,792
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dont want to report an error in log files

    Change your first line to

    if Sys.Process("eDevix").WaitWindow("#32770", "Devix Commerce Suite",-1,10000).Exists then

    If the window does not exist, you cannot call the Exists property. Doesn't make sense to call the property of an object that doesn't exist. So, you use WaitWindow to see if the object is there. If it is, Exists returns true. If it doesn't, a stub object is passed back and Exists returns false. No error in your log.
    -Robert Martin
    Automated Testing Evangelists
    TestComplete "expert"
    Definition expert - noun - Unknown drip under pressure

  8. #8
    Member
    Join Date
    Sep 2008
    Location
    India
    Posts
    422
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Dont want to report an error in log files

    Thanks a lot Robert.

    Thanks,
    vivek
    ~Vivek
    -------------------------------------------
    Software Testing Interview Question and Answer
    --------------------------------------------

 

 

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 7.69%
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 12:22 PM.

Copyright BetaSoft Inc.