Good day.
I have a grid on the page, which data can be changed. When you click on a cell, TextArea , ComboBox or a calendar may appear, depending on the cell.
The problem is that the drop-down control does not appear in the grid, but several pairs higher.
This implementation will be used in selenium , and therefore, when you click a particular cell, you need to go up from it to find the desired element.
I do this:
var parent = element.FindElements(By.XPath("..//..//..//..//..//..//..//..//..//..//*")); and further I already look for the necessary control in parent.
Question:
1) How can you better write XPath to climb several levels higher without ..//..//..// , because in some places you need to climb 16 budgets?
2) Is it possible somehow through XPath, in my case to look for a specific control?
for example
if(element.FindElements(By.XPath("..//..//..//..//..//..//..//..//..//..//textArea[class = 'blabla']")).Count > 0) How best to implement such a task?