0
votes

![Frame Details][firebug shows the frame properly but cant switch to the frame]1

I am trying to switch to the frame with id=All Equipment but cant get there. I can switch to any other frame but not this one. Below are the options that I tried

browser.driver.switchTo().frame('All Equipment'); browser.driver.switchTo().frame(browser.driver.findElement(by.xpath('//iframe[@id="All Equipment"]')));

Below is the error message i get

Failed: no such element: Unable to locate element: {"method":"xpath","selector":"//iframe[@id="All Equipment"]"} (Session info: chrome=57.0.2987.133) (Driver info: chromedriver=2.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT 10.0.10586 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 3.78 seconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03' System info: host: 'SURBHAT-C66G4', ip: '169.254.144.72', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121' Driver info: org.openqa.selenium.chrome.ChromeDriver Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.28.455520 (cc17746adff54984afff480136733114c6b3704b), userDataDir=C:\Users\surbhat\AppData\Local\Temp\scoped_dir25304_20777}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=57.0.2987.133, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}] Session ID: d528ea51a4ca534233ace2ef6c250404 *** Element info: {Using=xpath, value=//iframe[@id="All Equipment"]}

1

1 Answers

1
votes

The problem is in the id itself. An ID may never hold spaces.

The id attribute specifies its element's unique identifier (ID). The value must be unique amongst all the IDs in the element's home subtree and must contain at least one character. The value must not contain any space characters.

See also w3