I am new to selenium, i got struck for a long time with finding a item in a drop down list that was bind dynamically by selecting item from another dropdown. my sample code is followed by:
selenium.Open(".../Default.aspx");
selenium.WindowMaximize();
selenium.Click("name=ddCountry");
selenium.Click("//div[@id='ddCountry_DropDown']/div/ul/li[1]");
str = selenium.GetText("//div[@id='ddCountry_DropDown']/div/ul/li[1]");
selenium.Type("name=ddCountry", strValue);
selenium.Click("name=ddCity");
selenium.Click("//div[@id='ddCity_DropDown']/div/ul/li[1]");
str = selenium.GetText("//div[@id='ddCity_DropDown']/div/ul/li[1]");
selenium.Click("id=btnRedirect");
selenium.WaitForPageToLoad("30000");
In the above code i was trying to do like after selecting an item in a country dropdown. few items were bind to city dropdown on selectionchange event fires. my problem is " selenium.Click("//div[@id='ddCity_DropDown']/div/ul/li[1]"); " when this code executes i got error like "Element //div[@id='ddCity_DropDown']/div/ul/li[1] not found". please provide a solution for this problem thanks in advance.
regards, Venkat