title: How to click on a webtable cell using UFT/VBSCRIPT
body: <p>I just need to click on a specific cell (2,1). I am not sure how I can click on that cell. In my case, it is always going to be the same cell. </p>
  
  <p>I have this code which just reads the value from cell (2,1). After that, how can I click that cell? Entire cell is a link. I do not need to use for loop to go thru and find value. I just need to click directly on that cell. </p>
  
  <pre><code>myvalue= Browser("aa").Page("aa").WebTable("tb").GetCellData(2,1)
  </code></pre>
  
  <p>Please advise. </p>
  
  <hr>
  
  <p><a href="https://i.stack.imgur.com/9tABG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9tABG.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p><strong>Update # 1</strong>
  1  </p>
  
  <pre><code>myvalue= Browser("aa").Page("aa").WebTable("tb").GetCellData(2,1)
  </code></pre>
  
  <p>'value returns "dsfsdf sdfsdfdsf DOB: 1/01/2015 Member ID: 8587"</p>
  
  <p>2 I inspected the cell in chrome. I see this:</p>
  
  <pre><code>&lt;td class="name" rowspan="1"&gt;
                                              &lt;a href="/id/5858"&gt;&lt;span&gt;&lt;/span&gt;&lt;/a&gt;
                                              &lt;h3&gt;
                                              dsfsdf sdfsdfdsf
                                              &lt;/h3&gt;
                                              &lt;table&gt;
                                                  &lt;tbody&gt;&lt;tr&gt;
                                                      &lt;td&gt;DOB:&lt;/td&gt;
                                                      &lt;td&gt;1/01/2015&lt;/td&gt;
                                                  &lt;/tr&gt;
                                                  &lt;tr&gt;
                                                      &lt;td&gt;Member ID:&lt;/td&gt;
                                                      &lt;td&gt;8587&lt;/td&gt;
                                                  &lt;/tr&gt;
                                              &lt;/tbody&gt;&lt;/table&gt;
                                          &lt;/td&gt;
  </code></pre>
  
  <ol start="3">
  <li>In front end, i see the entire cell is a link but in source code you can see only one element is a link. I think they have applied css to make the cell as a link. </li>
  </ol>
  
  <p>SHould I first go to the cell then find the link and then click on it? I researched all day but no luck. Please advise.</p>
  
  <hr>
  
  <p><strong>Update # 2</strong></p>
  
  <p>This is a dot net page.</p>
  
  <pre><code>set rowObject = Browser("aa").Page("aa").WebTable("tb").Object.getElementsByTagName("tr").item(1) 
  </code></pre>
  
  <p>If I keep item(1) it clicks on the 2nd row as expected. index 0 is the header. index 1 is the 2nd row.</p>
  
  <p>If I change to item(2), it does nothing. </p>
  
  <p>If I change to item(4), it clicks 3rd row(index 2). Instead it should click 5th row (index 4). </p>
  
  <p>If I change to item(5), it does nothing. Weird. So this answer is not working consistently. I think UFT is being confused way that the page was developed. </p>
  
  <p>I took the html source code and then created a html file locally. Changed all anchor texts from empty to some texts:</p>
  
  <pre><code>            &lt;a href="/id/5554"&gt;&lt;span&gt;id2&lt;/span&gt;&lt;/a&gt;
  </code></pre>
  
  <p>Then I used your original code that you posted. It works just fine as expected for all rows. </p>
  
  <p>I will reach out to dev team to see if they can add anchor text and then apply css to hide it. Most likely they wont do anything. </p>
  
  <p>Also can we describe the "Link" here to "a" tag so UFT will look for "a" tag instead of link texts/anchor texts. </p>
  
  <pre><code>set objLink = Browser("aa").Page("aa").WebTable("tb").ChildItem(intRow, intCol, "Link",0)
  </code></pre>