1

A problem derived from my previous question:" VBA to find if an element contains certain texts" I find the desired text using :

 driver.FindElementByXPath("//*[@class='x-grid3-cell-inner' and text()='TEXT']")

but it is unclickable. The box in the next column is where i want to click. How to click a nearby grid column ?

Ca72-4

Ca72-4 is what i try to find.
The grid row of Ca72-4 may differ.
Path of the text (in selenium) :

xpath=//div[42]/table/tbody/tr/td[3]/div 

The yellow box on the right is input.
Path of the desired target (in selenium) :

 xpath=//div[42]/table/tbody/tr/td[4]/div

Thank you for your help.

DebanjanB
  • 118,661
  • 30
  • 168
  • 217
baxius
  • 35
  • 5

2 Answers2

1

To click() in the adjascent cell next to the text Ca72-4 you can use the following based Locator Strategy:

driver.FindElementByXPath("//div[@class='x-grid3-cell-inner' and text()='Ca72-4']//following::td[1]/div").Click
DebanjanB
  • 118,661
  • 30
  • 168
  • 217
0

A solution may be to dim an integer and to loop and check all div[#] and then use the integer with targets xpath. But i'd really like to avoid loops if possible.

baxius
  • 35
  • 5