Share
Go down
avatar
Archana
Regular Participant
Regular Participant
Posts : 33
Join date : 2009-08-21

assert image present by src with just image name

on Mon Aug 31, 2009 8:34 pm
In one of my pages, I have many sort links. Beside each sort link, I have one image(up/down arrow)

clickandWait | link=ID
assertElementPresent | //table[3]/tbody/tr/td[2]/table[2]/tbody/tr/td[1]/a/img[contains(@src,'http://192.168.0.3/mypicks/themes/default/images/down_arrow.gif')]

clickandWait | link=Date
assertElementPresent | //table[3]/tbody/tr/td[2]/table[2]/tbody/tr/td[2]/a/img[contains(@src,'http://192.168.0.3/mypicks/themes/default/images/down_arrow.gif')]

Somewhere I saw, endswith.

//table[3]/tbody/tr/td[2]/table[2]/tbody/tr/td/a/img[@endswith(@src,'down_arrow.gif')] is not working.

how to get rid of absolute url of image?
avatar
Advisor
------------------------
------------------------
Posts : 383
Join date : 2009-07-30
Location : India
http://seleniumforum.forumotion.net

Re: assert image present by src with just image name

on Tue Sep 01, 2009 11:18 am
hi,

try this xpath and let me know

xpath=//table[3]/tbody/tr/td[2]/table[2]/tbody/tr/td/a/img[1]

best of luck.

bye
avatar
Archana
Regular Participant
Regular Participant
Posts : 33
Join date : 2009-08-21

Re: assert image present by src with just image name

on Tue Sep 01, 2009 1:49 pm
Hi, its working fine. But this is not enough to my requirement.

In the same location //table[3]/tbody/tr/td[2]/table[2]/tbody/tr/td/a/img[1], I want to
VerifyEelementPresent some times img1.gif, img2.gif or img3.png.

I need to Verify elements
//table[3]/tbody/tr/td[2]/table[2]/tbody/tr/td/a/img[@endswith(@src,'down_arrow.gif')] , //table[3]/tbody/tr/td[2]/table[2]/tbody/tr/td/a/img[@endswith(@src,'up_arrow.gif')]
avatar
Advisor
------------------------
------------------------
Posts : 383
Join date : 2009-07-30
Location : India
http://seleniumforum.forumotion.net

Re: assert image present by src with just image name

on Tue Sep 01, 2009 3:52 pm
hi,

then for this , use store attribute command for verify the name of that link.
you can't do all with same locator because your change dynamically depend upon size or number.

bye
Sponsored content

Re: assert image present by src with just image name

Back to top
Permissions in this forum:
You cannot reply to topics in this forum