Xpath Query

31 views
Skip to first unread message

Hoks

unread,
Mar 28, 2013, 10:14:14 AM3/28/13
to seleni...@googlegroups.com

I have html like below :


<root>

  <Customer cid= "C1" name="Janine" city="Issaquah">

      <input name="Client.ClaimsAdjudicationPendReason" />

      <a onclick="javascript:pendReasonLookup('MFM_Pend Reason', 'PendReason','txtClaimsAdjudicationPendReason','','')>

                <img title="Lookup" class="imgSearchIcon" alt="Lookup" src="/F005web/images/search.gif"/>

 


     <input name="Client.ClaimsRejected" />

      <a onclick="javascript:pendReasonLookup('MFM_Pend Reason', 'PendReason','txtClaimsAdjudicationPendReason','','')>

                <img title="Lookup" class="imgSearchIcon" alt="Lookup" src="/F005web/images/search.gif"/>

   </Customer>  

</root>



Using the following xpath i am able to select <input> node where name="Client.ClaimsAdjudicationPendReason"


xpath:=//input[@name='Client.ClaimsAdjudicationPendReason']



But i need to get  the path for <img> node if name="Client.ClaimsAdjudicationPendReason"


Please let me know the solution.


Thanks in advanced.


-Hokrani


Vishal Mishra

unread,
Apr 1, 2013, 1:38:38 AM4/1/13
to seleni...@googlegroups.com
CSS is good and fast
I think try this 
css = input[name='Client.ClaimsRejected'] img



--
--
You received this message because you are subscribed to the Google Groups "selenium-ruby" group.
To post to this group, send email to seleni...@googlegroups.com
To unsubscribe from this group, send email to selenium-rub...@googlegroups.com
For Selenium-Ruby project, visit http://seleniumhq.org/projects/ruby/
For Selenium related questions like Core, Server, and RC client in other language, please go to http://clearspace.openqa.org/community/selenium
---
You received this message because you are subscribed to the Google Groups "selenium-ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-rub...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

bgoad

unread,
Apr 19, 2013, 1:54:15 PM4/19/13
to seleni...@googlegroups.com
+1 for CSS selectors. Only use xpath when you absolutely need to (i.e. accessing a parent element, accessing an element via its text, etc).

Brian

Elangovan Mani

unread,
Jul 22, 2014, 2:40:15 AM7/22/14
to seleni...@googlegroups.com
Try this..
xpath:=//input[@name='Client.ClaimsAdjudicationPendReason']/following-sibling::a/img
Reply all
Reply to author
Forward
0 new messages