Forum Discussion

muhammadA's avatar
muhammadA
Occasional Contributor
8 years ago

Finding object by using dynamic xpath, using Partial Content text

Hi all,

 

I have following dynamic xpath's

.//*[@id='1509527131388-grid-container']/div[2]/div
.//*[@id='1509528020936-grid-container']/div[2]/div
.//*[@id='1509528970483-grid-container']/div[2]/div
.//*[@id='1509528970483-grid-container']/div[2]/div

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

    • Marsha_R's avatar
      Marsha_R
      Moderator

      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
        muhammadA
        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 http://ui-grid.info/

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