Forum Discussion

muhammadA's avatar
Occasional Contributor
7 years ago

Finding object by using dynamic xpath, using Partial Content text

Hi all,


I have following dynamic xpath's


I am trying to find the object by


var obj = Sys.Browser("*").Page("*").FindChildByXPath(".//*[@id=150952'" + * + "'-grid-container']/div[2]/div]");


showing as syntax error. Can you please help me to find the error

17 Replies

    • Marsha_R's avatar
      Champion Level 3

      FindChildByXPath(".//*[@id=150952'" + * + "'-grid-container']/div[2]/div]")


      You have three single quotes in there, one on each side of  + * + and one after -grid-container.  Do you need to match the one after -grid-container or take it out?


      • muhammadA's avatar
        Occasional Contributor

        Hi Marsha,


        .//*[@id='15095 "27131388" -grid-container']/div[2]/div
        .//*[@id='15095 "28020936" -grid-container']/div[2]/div
        .//*[@id='15095 "28970483" -grid-container']/div[2]/div
        .//*[@id='15095 "28970483"-grid-container']/div[2]/div


        The one in quatations is keeping changing , I want everything else into I want find the object containing


        .//*[@id='15095 "*******"-grid-container']/div[2]/div.


        Please verify

        I am trying to get the Values from the upper grid present in the page.