views:

189

answers:

2

Hey,

I have an app in which the user can change the background image of their profile page. Therefore, I wasnt to assert that, when the user changes the image, the image actually changes. I can't for the life of me figure out a css selector or xpath to do the job. This is the HTML I have:

<body style="background:#FFFFFF url(/uploads/images/000/000/002/original.png?1257966819) no-repeat 0 0;" class="users users-show-edit layout-main-with-sidebar" id="users-edit">

Any sugestions?

A: 

I've used the following, but I believe it may need tweaking to work across multiple browsers - I primarily test in Firefox:

selenium.getEval("this.findEffectiveStyleProperty(this.browserbot.findElement(\"" + locator + "\"), \"backgroundImage\")");
Dave Hunt
A: 

I went with this in the end, bit of a hack, but does the job:

  html = browser.get_html_source
  assert html.include?("#{@background.background_image.url}")
Rodreegez