Hi,
consider below code....
<div id = "Parent" style = "display : block">
<div id = "child_1">
<div id = "child_2">
<div id = "child_3">
<input id ="input_1" type = "text">
</div>
</div>
</div>
</div>
now if i need to get the input path, i am doing by //input[@id="input_1"].. this will identify input path. suppose , if "style = "display : block"" is set to parent as mentioned in the above code, this is getting displayed in the html page , works fine with automation also.
if i change the style to set as "style = "display : none", then the page will not display in the browser since the style is setted as none for the parent level. now if i execute the script which contains the code for //input[@id="input_1"] alone, the findelementbyXpath able to find the element though it is not visible to the user level.
now the question is :
how to get whether the parent style is set to none or not. Please note; i dont want to travel from parent path to child path.. i mean , i dont want to start from "//div[@id = "Parent" and contains[@style = "display : block"]]/div/div/div/input...
rather i need to find the parent of particular element dynamically.......... in this case... div id=parent ......
Thanks for the info in advance...
regards
Vinothkumar Velusamy