selenium webdriver - How to find Xpath for this? -


<table cellspacing="0" cellpadding="0" width="50" border="0" style="border-collapse:collapse;"> <tr class="tabunselected" valign="top" id="maintabcontrol2"> <td width="5"><img width="5" height="5" border="0" src="images\eyebrow-upper-left-corner.gif" style="border-width:0px;" /></td><td><table cellspacing="3" cellpadding="0" width="99%" border="0"> <tr> <td class="tabcaption" align="left" valign="bottom" onclick="selecttab(2, 11, 'maintabcontrol', 'panel', 'lbltitle', 'paneltitle', 'hfldselectedtab');" onmouseover="highlighttab('maintabcontrol2', 'tabunselected', 'tabhighlighted');" onmouseout="resettab('maintabcontrol2', 'tabunselected', 'tabhighlighted');" style="white-space:nowrap;">**more details**</td></tr> </table> 

i want click more details (it seems link).

i have tried using linktext returns exception..

exception in thread "main" org.openqa.selenium.nosuchelementexception: unable find element link text == more details (warning: server did not provide stacktrace information) command duration or timeout: 421 milliseconds 

is there anyway.. how identify xpath?

//*[@onclick='selecttab(2, 11, 'maintabcontrol', 'panel', 'lbltitle', 'paneltitle', 'hfldselectedtab')'] 

tried way giving xpath.. no luck.. org.openqa.selenium.invalidselectorexception: xpath expression '//*[@onclick='selecttab(2, 11, 'maintabcontrol', 'panel', 'lbltitle', 'paneltitle', 'hfldselectedtab')'] ' cannot evaluated or notresult in webelement (warning: server did not provide stacktrace information) command duration or timeout: 157 milliseconds

try following xpath:

//tr[@id='maintabcontrol2']//td[@class='tabcaption']

or //td[@class='tabcaption']

edited:

if same id , class exists can select text() of element below:

//td[contains(text(),'**more details**')]


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -