Tuesday, March 18, 2008

advice on a selenium problem?

I thought I'd mention this here. If anyone has a theory, please leave a comment or find me somewhere...

I'm using Selenium to drive a Javascript WYSIWYG editor. I type some text into a largish textarea; save the page; open the page again in the editor.

Upon doing this, IE7 can properly read and parse the contents of the textarea, but Firefox thinks the textarea is empty.

I can set up an environment to reproduce this for an interested party.

6 comments:

Grig Gheorghiu said...

Hi, Chris

I just went through a lot of Selenium Ajax-y testing for my PyCon tutorial, so please provide more detail on your problem and I'll try helping.

Grig

adam said...

Is it doing some sort of XML/XSL translation?

I found http://groups.google.com/group/mozilla.dev.tech.xml/browse_thread/thread/dfe1426322ae5f9a/1c0bd8a6beeef004 which outlines the differences between two browsers in this area.

-adam

kevin said...
This comment has been removed by the author.
Chun said...

If it was using XML parser, it will need different javascript functions to deal with different browers.

try //Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
catch(e)
{
try //Firefox, Mozilla, Opera, etc.
{
xmlDoc=document.implementation.createDocument("","",null);
}
catch(e)
{
alert(e.message);
return;
}
}
xmlDoc.async=false;
xmlDoc.load("note.xml");

Without more detail, I could only guess so...

Chris McMahon said...

Grig helped me out a lot (thanks!) and was able to craft a solution using selectFrame and XPath.

I couldn't get his approach to work.

However, just now, after a deep session with Selenium IDE, I find that this works flawlessly:

| verifyValue | my_crazy_textarea | check this text |

Smart Monkey Tester said...

if this is Selenium RC or Core, there is an issue where some Firefox fireEvents will not work, so the script will see the element, but cannot properly act upon it for some or all events. you can use some in-place editing of the jar to correct this.