SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Apr 2012
    Location
    Chennai
    Posts
    137
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Descriptive programming Regular Expression Case Sensitive

    hi Team ,

    Here is the Issue . I use DP for object identification .I don't want to exist method to return true if the column names of a webtable doesn't have desired text considering case sensitive

    Example

    Print B.P.Webtable("column name:=.*SurName.*").Exist(3)

    Column names we have here is Surname,Forename,age ,sex for a webtable

    QTP returns true for the above statement . I dont want it to return true .What options we have here

    thanks in advance
    Last edited by saikri; 04-07-2015 at 07:35 AM. Reason: typo error

  2. #2
    SQA Knight
    Join Date
    Jun 2008
    Posts
    2,555
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0
    That is odd. Regex is case sensitive unless you explicitly tell it not to be.
    Is the *. before SurName a typo or is that actually in your code rather than .*?

  3. #3
    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
    Most probably It should be .*

    I think,By default IC is true in DP
    objRegEx.IgnoreCase = false

    Or alternatively get the object property and manipulate in logic.

  4. #4
    Member
    Join Date
    Apr 2012
    Location
    Chennai
    Posts
    137
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    yes it is a typo error .Current i developed a logic to overcome . But this is strange .I heard in one post of tarun/Arora that for a DP it is case sensitive .

    Guys could you please try an example for me in your application

  5. #5
    SQA Knight
    Join Date
    Jun 2008
    Posts
    2,555
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0
    Not in QTP, but I'm working in some Cucumber tests right now and the regex is definitely case sensitive by default.

    Sure a table with a "SurName" column doesn't exist anywhere on the page, even if hidden?

  6. #6
    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
    Yes regexp is definitely case sensitive although i have checked with below example
    Code:
    sColname = "this,SurName,test,where"
    Set oreg = new Regexp
    oreg.pattern = ".*Surname.*"
    Set Matches = oreg.execute(sColname)
    msgbox Matches.count
    Result '0' when Surname and '1' when SurName

    Check for the existence of "Surname" column anywhere in the page as suggested by previous post
    Venu
    Today is always better than Tomorrow
    My Blog
    My LinkedIn

  7. #7
    Member
    Join Date
    Apr 2012
    Location
    Chennai
    Posts
    137
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    Guys Regex is case sensitive . If we use regex in the descriptive programming,its not case sensitive .Could you guys try something like this

    Print B.P.Webtable("column name:=.*SurName.*").Exist(3)

  8. #8
    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
    Hi don't have UFT, can you try like below

    B.P.Webtable("column name:=.*SurName.*").Exist(3)
    B.P.Webtable("column name:=.*Surname.*").Exist(3)
    B.P.Webtable("column name:=.*Surname.*").GetROProperty("height")
    B.P.Webtable("column name:=.*SurName.*").GetROProperty("height")

    and check if returns the same. you can try for some other properties as well
    Venu
    Today is always better than Tomorrow
    My Blog
    My LinkedIn

 

 

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:33 AM.

Copyright BetaSoft Inc.