Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I am trying to click the CSS below

html body.FormBackground form#LookupForm div#Panel1 table tbody tr td div#GridContainerDiv div table#DataGrid tbody tr.GridSelectedRow td.GridRow

So far I have tried

@FindBy(css = "#DataGrid\\tbody\\tr.GridSelectedRow > td.GridRow")

and

@FindBy(css = "#DataGrid tbody tr.GridSelectedRow > td.GridRow")

But neither of the above attempts seem to work. HTML is below.

<tbody>
 <tr ondblclick="$HRnet('DataGrid').dblClick(); " gender_id="f6611f8a-8e80-41e6-a14c-fa8e25be3065" class="GridUnSelectedRow">
    <td class="GridRow">Female</td>
 </tr>
 <tr ondblclick="$HRnet('DataGrid').dblClick(); " gender_id="3ef09fb8-4d5d-43d2-abc0-2506616ef83e" class="GridSelectedRow">
    <td class="GridRow">Male</td>
 </tr>
 <tr nofocus="true">
    <td>&nbsp;</td>
 </tr>
</tbody>
share|improve this question
    
can you please post the complete HTML code for the table.That will help us to get more details on the problem. – Sudharsan Selvarj 2 days ago
    
I've updated the HTML – OhAye 2 days ago
    
if you want to click the td of selected row then use the below css, @FindBy(css = "#DataGrid tr.GridSelectedRow > td.GridRow") – Sudharsan Selvarj 2 days ago
    
Do I have to specify if I want it to select male or female? And if so how do I do that through CSS? – OhAye 2 days ago
    
Which element are you trying to click? – JeffC yesterday

Based on what you've shared it looks like this should work but it will return multiple rows so you'll need to decide which one you want to click

@FindBy(css = "#DataGrid td.GridRow")
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.