SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: DP in qtp

  1. #1
    Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    359
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    DP in qtp

    Hi, is thr any way to achieve below please...


    x="name:=field-keywords"",""class:=ui-autocomplete-input"",""type:=text"
    Browser("name:=.*").Page("title:=.*").WebEdit(x).S et "TESTING"

    Instead of..........

    Browser("name:=.*").Page("title:=.*").WebEdit("nam e:=field-keywords","class:=ui-autocomplete-input","type:=text").Set "TESTING"
    Last edited by john12345; 05-16-2013 at 09:33 AM.

  2. #2
    Advanced Member
    Join Date
    May 2006
    Location
    United Kingdom
    Posts
    742
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

  3. #3
    SQA Knight bklabel1's Avatar
    Join Date
    Sep 2012
    Location
    Kew Gardens, United States
    Posts
    2,596
    Post Thanks / Like
    Blog Entries
    1
    Mentioned
    2 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0
    Description.Create may be another way to do this.

    Set oDesc = Description.Create
    oDesc.Value("name") = "field.keywords"

    I can finish the example if you wish to go this direction.

  4. #4
    Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    359
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    thx all for reply, I am trying to pick below value from excel--

    "name:=field-keywords"",""class:=ui-autocomplete-input"",""type:=text"

    and pass it as parameter, as -- Browser("name:=.*").Page("title:=.*").WebEdit(x).S et "TESTING"

    any ideas will do

  5. #5
    Advanced Member venu.adhikesevan's Avatar
    Join Date
    Jun 2010
    Posts
    517
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0
    x= """name:=field-keywords"",""class:=ui-autocomplete-input"",""type:=text"""
    Browser("name:=.*").Page("title:=.*").WebEdit(x).S et "TESTING"
    Venu
    Today is always better than Tomorrow
    My Blog
    My LinkedIn

  6. #6
    Member
    Join Date
    May 2011
    Location
    California, US
    Posts
    306
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    One simple way that can be implemented is - pick the value from excel, write a logic to split that value & build a description object and then use this description object for identification

    Will post back if I get more on this
    --
    Vijay

  7. #7
    Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    359
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    thanks all. Description method I am aware of.. looking for something more simplified!!

  8. #8
    Member
    Join Date
    May 2011
    Location
    California, US
    Posts
    306
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    ok...one more way which you were looking at (I guess)

    x="type:=submit,name:=Post Quick Reply,html tag:=INPUT"
    a=Split(x,",")
    Browser("DP in qtp").Page("DP in qtp").WebButton(a(0),a(1),a(2)).highlight

    This method works fine with one limitation..everytime you do an action we have to explicitly write all the array indexes if the size is dynamic and doesnt look like a standard practice & may create problems in maintainance

    So to be on safe side, its worth to follow the above method i posted earlier by creating a desc obj.
    --
    Vijay

  9. #9
    Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    359
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    Thanks Vijay, as I said, I am aware of that approach, my code is--

    Set obj=Description.Create
    data="micclass=WebEdit|html id=em1|name=email|tabIndex=1"

    data=split(data,"|")
    For i=0 to ubound(data)
    If i=0 Then
    prop0=split(data(i),"=")
    obj(prop0(0)).value=prop0(1)
    ElseIf i=1 then
    prop1=split(data(i),"=")
    obj(prop1(0)).value=prop1(1)
    ElseIf i=2 then
    prop2=split(data(i),"=")
    obj(prop2(0)).value=prop2(1)
    End If
    Next

    set all=Browser("name:=.*").Page("title:=.*").ChildObj ects(obj)
    all(0).Set "jujujuju"

    and its working fine!!

    I am just trying to make it simpler!!

  10. #10
    Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    359
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    any idea guys!!

 

 
Page 1 of 2 12 LastLast

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.00%
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:32 AM.

Copyright BetaSoft Inc.