Forum Discussion

sudam_SL's avatar
sudam_SL
Contributor
5 years ago

can we use xpath as object identifiers with Key word testing

Hi ,

Can anyone manage to use xpath for keyword testing?

  • Hi sudam_SL,

    I suppose you are using Name Mapping, right? So, you can use wildcards or regular expressions in the identification properties - this will allow you to remove dynamic values from the IDs. Please refer to the 

    Basic Mapping Criteria help article for details.

4 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    More details please?

    In general:

    -- Yes, this is possible;

    -- Except for the cross-platform mode, XPath is not the recommended approach in TestComplete's world;

    -- You will have to craft XPath expressions yourself (or via Developer Tools).

     

    • sudam_SL's avatar
      sudam_SL
      Contributor

      Hi AlexKaras,

      Thanks for the quick response. let me explain you what we have to do using xpath.

      In my system (under testing) doesn't have unique attributes as it develop with pega framwork.

      in that case i wanted to capture some web elements relatively but i'm unable to do it. so it would be great if you can guide me to use xpath for above matter.

      Practical Issue : in attached screen i need to store RDTH-XXXX value, but it doesn't have unique attribute unless text contains, that text getting change in each execution cycle. that is why i need to use xpath to capture that RDTH-XXXX value relatively based on "Retired Death" text.

       

      Regards,

      Sudam.

      • TanyaYatskovska's avatar
        TanyaYatskovska
        SmartBear Alumni (Retired)

        Hi sudam_SL,

        I suppose you are using Name Mapping, right? So, you can use wildcards or regular expressions in the identification properties - this will allow you to remove dynamic values from the IDs. Please refer to the 

        Basic Mapping Criteria help article for details.