Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO

Solved:Unable to Locate Any Elements on Site Empty Solved:Unable to Locate Any Elements on Site

Tue Jan 29, 2013 5:04 am
I am using Visual Studio with Selenium Webdriver and NUnit and I am unable to interact with any element on a page for this site. Selenium IDE can interact with most of it, but Webdriver can't interact with any. I used the same code against Google it works as expected so I know its not a set up error.

This is the html:


This is the command I use:
driver.FindElement(By.Id("txtDisplayName")).SendKeys("Display Name");

This is the error:
TestSelenium.Class1.AddClass:
OpenQA.Selenium.NoSuchElementException : Unable to find element with id == txtDisplayName

This is the log
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line 983
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line 844
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\Remote\RemoteWebDriver.cs:line 873
at OpenQA.Selenium.By.FindElement(ISearchContext context) in c:\Projects\WebDriver\trunk\dotnet\src\WebDriver\By.cs:line 306
at TestSelenium.Class1.AddClass() in C:\Users\MyDocuments\Documents\Visual Studio 2010\Projects\TestSelenium\TestSelenium\Class1.cs:line 31


Last edited by ccox on Mon Feb 04, 2013 8:18 am; edited 1 time in total
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO

Solved:Unable to Locate Any Elements on Site Empty Re: Solved:Unable to Locate Any Elements on Site

Wed Jan 30, 2013 11:18 pm
Solved. If there is an iframe on the page, Webdriver has issues with location an element within that I frame. You have to switch to the iframe to find those elements and then switch back to the default content.
vinayakjadhav1857
vinayakjadhav1857
Active particpant
Active particpant
Posts : 19
Join date : 2013-04-22

Solved:Unable to Locate Any Elements on Site Empty Re: Solved:Unable to Locate Any Elements on Site

Mon Apr 22, 2013 1:52 pm
hey ccox,

what abt selecting multiple windows ?
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO

Solved:Unable to Locate Any Elements on Site Empty Re: Solved:Unable to Locate Any Elements on Site

Mon Apr 22, 2013 9:28 pm
driver.SwitchTo().Window("windowname");

If you do not know the window name/id you will need to use its handle.
Sponsored content

Solved:Unable to Locate Any Elements on Site Empty Re: Solved:Unable to Locate Any Elements on Site

Back to top
Permissions in this forum:
You cannot reply to topics in this forum