How to use :vCapybara get attribute
My recent project is builded with capybara and site_prism with selenium webdriver, i like it because it’s easy to use , nit have to bother too much about driver session , I can stay focus on what matters , writing new tests and improve the existing test suite performance and reusability.Sometimes in order to achieve the coverage that we want we need to create calculated results, one of them is to use element’s attribute , but first of all lets see how we can get element attribute with capybara.
Few examples How to get elements’s attribute with capybara:
So now that you know how to get the element attribute with capybara you can basically extend your tests , for example if you have an image on the page and you want to assert that image is present within a certain context you can write something like this :
You might run in a situation when you have a collection of elements and you need to check all of them.
More complex examples for getting element attribute with capybara
So once you know how to get it the world is your you can basically do whatever you want with that date and you can perform any kind of operations against it.
I strongly recommend you to read more details into capybara get attribute documentation .
Attributes are quite important in m day to day job , and they are quite useful to me , like an asset for an intel , for example I can’t live without manipulating attributes data when I do testing for google maps.
If you enjoyed this article and if you have any topics in your mind that you’ll like to read don’t hesitate to use the comments form bellow.
Happy testing!
The post How to use : Capybara get attribute appeared first on TestingRepository.
This post first appeared on Testing Repository - Creating Testing, please read the originial post: here