Nice video. I was asked this question in a page I have three images which has no attribute how you will click on third image. Can you please help me with this question.
Hi Naresh, There are a few solutions to ur problem 1. Easiest is to use an Xpath with an index. ( //img )[3] - something like like 2. Try to get all elements with image via the method getElements. Loop through them and get the 3rd element. 3. if u cannot get elements of image then why not try to find the properties of their parent or their siblings. //img/unique or ( //img/unique to all images )[3] //unique/image or ( // unique to all images /img )[3] I hope this helps
Hello Sir I am stuck here .please help I got 4 webelements and I need to select 3rd...using for loop I iterated it and when I use index it is not selecting proper option.how to increase index in xpath ??
dont use loops, use the xpath itself to get the 3rd one. (XPATH_TO_GET_3_ELEMENETS)[INDEX] In your case, the index should be 3. Also note index in xpath starts from 0
Liked before watching based on experience of previous video.
Clear and and easy for initial learner as well
loved this series on automation..thanks man...keep uploading
Ur explanation is very clear sir
Thank you so much !! I will try creating more, stay tuned.
Sir please make a video of XSLT please🙏🙏🙏
Nice video. I was asked this question in a page I have three images which has no attribute how you will click on third image. Can you please help me with this question.
Hi Naresh,
There are a few solutions to ur problem
1. Easiest is to use an Xpath with an index. ( //img )[3] - something like like
2. Try to get all elements with image via the method getElements. Loop through them and get the 3rd element.
3. if u cannot get elements of image then why not try to find the properties of their parent or their siblings.
//img/unique or ( //img/unique to all images )[3]
//unique/image or ( // unique to all images /img )[3]
I hope this helps
Hello Sir
I am stuck here .please help
I got 4 webelements and I need to select 3rd...using for loop I iterated it and when I use index it is not selecting proper option.how to increase index in xpath ??
dont use loops, use the xpath itself to get the 3rd one.
(XPATH_TO_GET_3_ELEMENETS)[INDEX]
In your case, the index should be 3. Also note index in xpath starts from 0
@@Automationzone thx much Sir will try