Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

assert image present by src with just image name

View previous topic View next topic Go down

assert image present by src with just image name

Post by Archana 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
Archana
Regular Participant
Regular Participant

Posts : 33
Join date : 2009-08-21

Back to top Go down

Re: assert image present by src with just image name

Post by Adviser 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
Adviser
------------------------
------------------------

Posts : 379
Join date : 2009-07-30
Location : India

http://seleniumforum.forumotion.net

Back to top Go down

Re: assert image present by src with just image name

Post by Archana 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
Archana
Regular Participant
Regular Participant

Posts : 33
Join date : 2009-08-21

Back to top Go down

Re: assert image present by src with just image name

Post by Adviser 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
avatar
Adviser
------------------------
------------------------

Posts : 379
Join date : 2009-07-30
Location : India

http://seleniumforum.forumotion.net

Back to top Go down

Re: assert image present by src with just image name

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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