SPONSORS:






User Tag List

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

    How to get the output text value in webelement

    Hi
    I am inputing the value into forms and after submiting I will get the confirmation message saying Your Request DT Reference is 2345. The text is constant and the number is different for each input ,I want to capture the text message containing number
    I have parameterised the input value.

    I have used the below code

    dt=browser("Dubai Trade_2").Page("Dubai Trade").Frame("contentFrame").WebElement("Your Request DT Reference").GetROProperty ("innertext")
    msgbox dt

    but if i run the script it captured the text message for first iteration of input value, and for the second iteration of input value Iam getting error , object cannot be found,
    I tried with regular expression for the webelement but still same error message

    can anyone guide on this

  2. #2
    Junior Member
    Join Date
    Nov 2004
    Location
    Raleigh
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to get the output text value in webelement

    Make sure one of the parent objects isn't getting assigned a dynamic value.

    I had the problem on an order page where the title was "Order number:xx". Setting a regular expression on it nomrally takes care of the problem.

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

    Re: How to get the output text value in webelement

    you need to create a dynamic parent object.

  4. #4
    Junior Member
    Join Date
    Mar 2008
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to get the output text value in webelement

    I have set the regular expression but still problems exist.

    can you give me e.g please

  5. #5
    Advanced Member
    Join Date
    Sep 2007
    Location
    Chennai, Tamil nadu, India
    Posts
    999
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to get the output text value in webelement

    Can you post the Regular expression codes?
    i have never seen bugs sleeping

  6. #6
    Advanced Member
    Join Date
    Mar 2007
    Location
    Salt Lake City, UT, USA
    Posts
    606
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to get the output text value in webelement

    Solution without DP:

    In your OR, select the webelement in question. You are probably the innertext as a description property. Select that description property and there will be a little box at the right end of the "value" column under description properties. Click that box.

    This opens the Value Configuration Options popup. Check the Regular Epression box then change the constant to the regular expression you want.

    From your original post, I would suggest:
    Your Request DT Reference is \d{4}

    My suggestion assumes it's always a 4-digit number at the end. Tweak the expression if this is not the case.

    Click OK on the popup then click the "Highlight in Application" button on the OR toolbar to make sure the object flashes at you when you click this button. If it flashes, then your regular expression was a good one. If it doesn't, then go fix your regular expression until it does flash.
    "The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"

  7. #7
    Senior Member
    Join Date
    Jun 2007
    Location
    Mumbai, India
    Posts
    265
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to get the output text value in webelement

    Use Regular expression in Object Repository.

    Add object for text message "Your Request DT Reference is 2345."

    Then Use Regular expression and modify text as "Your Request DT Reference is .*". QTP will ignore any number after text "Your Request DT Reference is ".
    Snehal Pailkar

  8. #8
    Junior Member
    Join Date
    Mar 2008
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to get the output text value in webelement

    Thank you so much guys for your suggestion

    it worked for me, i gave the regular expression like this
    Your Request DT Reference is \w*

 

 

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 8.82%
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 08:29 AM.

Copyright BetaSoft Inc.