Rick Masters a écrit :

Hello -

Question about selenium and its interaction with the DOM:

We are testing an app that uses JavaScript to modify the DOM. We want to use selenium to interact with the modified version of the DOM, i.e. run assertions on the modified DOM, interact with JavaScript-generated DOM elements, etc. In our early investigations with selenium, it seems that the assert() functions always operate on the original version of the DOM. It seems that selenium does not see the JS-modified DOM. Is this the case?

We are running selenium 0.5 in Java-driven mode. What we want is to be able to do something like this:

  selenium.verifyElementNotPresent("foo");
// this modifies the DOM, creating element "foo"
  selenium.click("createFoo");
selenium.verifyElementPresent("foo"); I have verified that the same operations fail in a normal HTML-based test:

  <tr><td>verifyElementNotPresent</td><td>foo</td><td></td></tr>
<tr><td>click</td><td>createFoo</td><td></td></tr>

  <tr><td>verifyElementPresent</td><td>foo</td><td></td></tr>

Whenever I run the above tests, although element "foo" is not found when expected, it *is* present when I "View DOM", leading me to believe there maybe be a simple fix here.

Excuse me for I may suggest something stupid (but better check the bases) :
Are you sure that you call the right locator ?
In order to test it you should save your page when foo as been created (firefox saves the page with the actual DOM) then try the verifyElementPresent on this page to be sure you call it with the right locator. <td>verifyElementPresent</td><td>foo</td> succeed if there is an element with property id="foo" or name="foo" not if there is a <foo> element..
Alex


Sorry for this automatic junk footer:

Ce message est protégé par les règles relatives au secret des correspondances. 
Il est donc établi à destination exclusive de son destinataire. Celui-ci peut 
donc contenir des informations confidentielles. La divulgation de ces 
informations est à ce titre rigoureusement interdite. Si vous avez reçu ce 
message par erreur, merci de le renvoyer à l'expéditeur dont l'adresse e-mail 
figure ci-dessus et de détruire le message ainsi que toute pièce jointe.

This message is protected by the secrecy of correspondence rules. Therefore, 
this message is intended solely for the attention of the addressee. This 
message may contain privileged or confidential information, as such the 
disclosure of these informations is strictly forbidden. If, by mistake, you 
have received this message, please return this message to the addressser whose 
e-mail address is written above and destroy this message and all files attached.
_______________________________________________
Selenium-users mailing list
Selenium-users@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users

Reply via email to