-3

enter image description here

I want to get the text of attribute value "downloadBatch(studentPreregisterBatch.batchId,0)". Is there any way to do it in selenium?

<span class="wrapped-text">
99 
<a class="blue" title="" data-original-title="Download" data-placement="bottom" rel="tooltip" ng-click="downloadBatch(studentPreregisterBatch.batchId,0)">
</span>

See the image for tag reference Thanks

VinothRaja
  • 1,405
  • 10
  • 21
  • you want to fetch 99 ? – cruisepandey Oct 16 '18 at 10:05
  • @cruisepandey No. i want the value of "downloadBatch(studentPreregisterBatch.batchId,0)" – ketul modi Oct 16 '18 at 10:09
  • downloadBatch() seems like a function. Do you want to take scope of angular element. – Ashish Kamble Oct 16 '18 at 10:15
  • @ketulmodi What do you mean by _...text of attribute value "downloadBatch(studentPreregisterBatch.batchId,0)"..._? Which text exactly? Once you clarify the question reply to the contributor who have _Closed_ the discussion appending the `@` character so that he/she is being notified about the question update and the question can be reopened for canonical answers. – undetected Selenium Oct 16 '18 at 10:55
  • @DebanjanB i want the value of function downloadBatch(studentPreregisterBatch.batchId,0) – ketul modi Oct 17 '18 at 05:17

1 Answers1

0

That is called attribute value, Selenium Provide facility to get the value using getAttribute.

Code :

driver.findElement(By.xpath("//a[@data-original-title='Download']")).getAttribute("ng-click")  

It would return a String, Same you can store it and print it.

cruisepandey
  • 28,520
  • 6
  • 20
  • 38