7 May 2008 5:38 AM #1
Problem with Selenium
I'm unable test the extjs using Selenium, Each time the extjs application is creating new ids. Any Idea please let me know waiting for great responseCheers
7 May 2008 7:37 AM #2
I found the same issue, decided I need to look around for another product to do regression testing with. simple test failed with any grid component because id's for elements change from run to run.
7 May 2008 2:00 PM #3
I had the same issue with <2.0.2 and QuickTips. It was fixed in 2.1.
7 May 2008 10:32 PM #4
Hello Kris, Still i'm facing the same probelm with for 2.1 alsoCheers
9 May 2008 12:51 AM #5
I thought that you referred to generating new ids as a result of 'mouseover' event (caused by quicktips in 2.0.2).
If want to use IDs as a selector for your ui widgets in selenium, you have to specify ID for each component explicitly when you create this component. I think that this is a good practice anyway.
from Component api doc:
"id:String - The unique id of this component (defaults to an auto-assigned id)."
9 May 2008 6:45 AM #6
Thank you Kris, can we give our own id to each div tags generated by extjs. if yes , how? than extjs is compaitable with Selenium.Cheers
9 May 2008 10:44 AM #7
You can assign your predefined ID to any extjs component (Panel,Button,TextField etc) - and it will appear in DOM - but not to each generated div.
I guess you're using Selenium IDE to record your tests. It is a useful tool, but you shoudn't rely on auto-generated selectors, because Selenium IDE always takes ID selector first, of course when ID exists. That will work for, let say, TextField (you can specify ID), but doesn't make sense for tags with auto-assigned IDs. I would use xpath selector that contains parent component ID instead. For example to click window maximize button (extjs desktop demo):
To be clear, I do not feel very comfortable with this solution either, but I hope that new selenium feature, UI-Element locators, will solve this problem in more elegant way.
13 May 2008 3:22 AM #8
I haven't got round to testing the grid yet, but I guess it has some similiar problems to the combobox.
So far I have used two approaches to getting round the auto-id problem.
The first thing I did was to extend the combobox, overriding the initList method so I could specify an explicit Id to set the 'inner-list' to.
And to overcome the issue with the trigger I simply used an Xpath expression...in my case this was:
Hope this helps...I will be approaching the grid in the next couple of weeks and will post any solutions I find.
13 May 2008 7:42 AM #9
I would advise you to stay away from XPATH selectors and stick with CSS selectors.
Selenium's XPATH implementation for IE6 is horrendously slow and will kill the browser.
I use Selenium everyday with a rather large Ext based application and have no problems using it. If something doesn't have an ID, CSS selectors will work just fine.
Selenium uses CSSQuery under the hood, so Google that or "CSS selectors" for the proper syntax.
selenium.click("css=#make-combo + img");
13 May 2008 9:13 AM #10
Thanks for the advice I will take heed.