The Selenium Select Window command fails and displays "Could not find window with title ...". but if I execute the Select Window command myself, it passes case and checks the elements.
The code I used:
public void testDefaultlogo() throws Exception { selenium.open("http://Sitename/samp.aspx"); selenium.type("ctl00_mainContentPlaceHolder_txt_LoginName", "uname"); selenium.type("ctl00_mainContentPlaceHolder_txt_Password", " pwd@12 "); selenium.click("ctl00_mainContentPlaceHolder_btn_login"); selenium.waitForPageToLoad("60000"); selenium.click("ctl00_defaultLogo"); selenium.selectWindow("Sample~Window-ID"); verifyEquals("http://Sitename/index.html", selenium.getLocation()); selenium.close(); selenium.selectWindow ("null"); verifyTrue(selenium.isElementPresent("ctl00_defaultLogo"));
I mean, by clicking on one of the follwing commands in the Selenium IDE, it shows a green color, but if I run this case, it didn’t work and shows, as I mentioned above
source share