SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Oct 2002
    Posts
    49
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Using descriptive programming on DOS window

    Hello all,

    I'm trying to ID a DOS command window without having the object in the Object Repository.

    Here is the code I'm trying to use:
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Set CmdWinDesc = Description.Create()
    CmdWinDesc(&quot;regexpwndtitle&quot.Value = &quot;C:\WINDOWS\System32\cmd.exe&quot;
    CmdWinDesc(&quot;regexpwndclass&quot.Value = &quot;ConsoleWindowClass&quot;
    CmdWinDesc(&quot;is child window&quot.Value = False
    CmdWinDesc(&quot;is owned window&quot.Value = False</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">- I've also tried this, after commenting out the above code -
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Set CmdWinDesc = Window(&quot;regexpwndclass:=ConsoleWindowClass&qu ot;, &quot;regexpwndtitle:=C:\WINDOWS\System32\cmd.exe& quot;, &quot;is child window:=False&quot;, &quot;is owned window:=False&quot</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Neither of these work. After using these to describe the object, I then try and execute the .Type() method provided by QTP. The script fails saying "Cannot identify the object "Window" (of class Window)". However, when I actually add the DOS window to the objRep it adds the four properties and their values just as I've set them up above. SmartID is disabled. Once the object is added it can be ID'd just fine and act upon the runtime object with no problems at all.

    Why can QTP use these properties in the ObjRep to describe something and I cannot using descriptive programming?

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

    Re: Using descriptive programming on DOS window

    Hi cartmen34!

    I managed to identify the console window using the windowstyle like bellow:

    Window("windowstyle:=351207424").Activate

    Does that solve your problem?

    /g

  3. #3
    Senior Member
    Join Date
    Jan 2000
    Location
    USA, CA
    Posts
    1,998
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using descriptive programming on DOS window

    I use:
    Window("text:=C:\\WINNT\\system32\\cmd.exe").Activ ate

    So, try \\ in the cmd.exe path

    Janna

  4. #4
    Member
    Join Date
    Oct 2002
    Posts
    49
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using descriptive programming on DOS window

    Goosed, that seems to be working perfectly.

    THANK YOU SO MUCH!!! =)

 

 

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 10.71%
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:07 PM.

Copyright BetaSoft Inc.