I'm using the Selenium 2.0 web drivers to try and login to a page. The following code works with the Firefox webdriver just fine, it finds the fields, fills them in and clicks the button.
driver.FindElement(By.Id("UserName")).SendKeys("name");
driver.FindElement(By.Id("Password")).SendKeys("test");
driver.FindElement(By.Id("btnLogin")).Click();
However, whenever I try to use the internet explorer webdriver it says it is unable to find the element with id == UserName. I tried using By.Name, and By.Xpath as well with valid inputs but I still get the same error saying it can't find the element. I am using IE 9 so I'm aware it may be a compatibility issue, however I can't seem to find any posts or information saying there is a known issue.
I just wanted to see if anyone else was experiencing the same issue, or if there is something I'm not doing correctly that is causing my issue. Also, this is a C# .NET project.
-- Edit --
Apparently it is an issue with IE9, I removed 9 and went back to 8 and the test works. I'm still interested to know if anyone finds out why this happens or if there is a work around.
The current release of Selenium (2.0b2) does not support IE9, however 2.0b3 should be released soon and supports both IE9 and Firefox 4.
This answer may also be relevant for anyone experiencing issues getting 'clicks' to fire with IE9.
A workaround to this is to send a .Click() to another element on the page, so that the browser gets the focus, before attempting to click the link, e.g. it's parent:
driver.FindElement(By.Id("Logout")).FindElement(By.XPath("..")).Click();
driver.FindElement(By.Id("Logout")).Click();
Related
I have radlistbox in pop-up which is causing a run-time Error "System.FormatException: Input string was not in a correct format error is thrown." .when the same pop-up is been opened in IE or FireFox it works properly without any error or interruptions.Please Provide solution to this problem.
HTML and JavaScript and the way they work differ from browser to browser, so you need to post the code that causes the problem so someone can help you. For example, Chrome provides float numbers for dimensions and positions when zoomed, so this may be the cause. This broke some controls that store such numbers in the client state. This page offers workarounds and the easier way to get a fix is to upgrade your Telerik controls version http://feedback.telerik.com/Project/108/Feedback/Details/144661-fix-system-formatexception-input-string-was-not-in-a-correct-format-thrown-o
Due to Anti-virus the pop-up was acting weird.After Disabling the anti-virus it worked fine.
Whenever I right click to inspect element in Firebug on Firefox, it gives me this "*::-moz-progress-bar" CSS listed before the element I inspected. Anyone know what this is and how to get rid of?
There's an option on the Firebug Style ▼ drop-down menu to Show User Agent CSS, you must of accidentally enabled it recently.
The current version of Firebug (reportedly started in version 1.11.3) has a bug where it incorrectly displays numerous User Agent CSS at the top of the list. If you've been using the "Show User Agent CSS" option for a while now and this problem just started, you're most likely experiencing this bug.
Give it some time, as the bug was only posted today (5/16/2013). Hopefully the Firebug developers will release a fixed version within a few days.
And as the other poster said, you can always disable the showing of all User Agent CSS. Though as stated in the bug report (link below), it may still appear in certain cases.
Bug Report: http://code.google.com/p/fbug/issues/detail?id=6451
Bug Discussion: https://groups.google.com/forum/?fromgroups#!topic/firebug/5vwmU-IEkbc
I have an ASP.net website that was working fine with IE9, Mozilla, chrome but with IE 10 users have lot issues. The UI and even the functionality (like clicking on button, login/logout do not work) doesn't work well with IE10.
The IE version I have is 10.0.9200.16519.
I see few differences between the view source from IE10 and google-chrome (or even IE9) but can't understand much of it.
Where actually in the site can I check why pages sent to IE 10 browser is different from others browser or IE9?
Please suggest how can I debug further?
PS: The site works fine with IE9 and below versions of IE.
ASP.NET fails to identify IE10's user-agent string, and as a result can send back broken code. This has been discussed in various places, but probably most notably on Scott Hanselman's blog. See the post titled Bug and Fix: ASP.NET fails to detect IE10 causing _doPostBack is undefined JavaScript error or maintain FF5 scrollbar position.
check if there is any js error, use IE developer toolbar (F12) to debug script
I am trying to debug a large and complex webapp that makes heavy use of DIVs, AJAX, dynamic HTML and server-side code to do its job.
Under normal operation we do not have problems. However, when we put the webapp into an IFRAME, certain functions trigger a crash in IE7 that renders the browser inoperable (all CPU used).
What tools exist to help track down what could be happening? Loading the IE process into the debugger gives me all sorts of fascinating info about the registers, but I think the issue is in javascript.
We have tracked down one problem with the app already that involved incorrect reparenting of an element (something attached itself to window. instead of document.)
I wrote a test IFRAME page that dumps the innerHTML of the iframe into a textarea, so it can be compared during various states, but that only shows me static attributes, I can't tell what sort of javascript events are associated with elements or determine if a handler is firing out of turn.
IE8, Firefox, Chrome etc do not have the same behaviour.
Ideally I'd like something that would let me snapshot the DOM (or the javascript VM?) during a known good state, then "just before it happens" so we can figure out what's added / removed / missing / different. What is out there?
Update: I'm now trying to use the IE Developer Toolbar to track it down.
Update 2: The IE7 crash occurs following this AJAX code:
function Sys$UI$Control$get_element() {
/// <value domElement="true" locid="P:J#Sys.UI.Control.element"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._element;
}
The return this._element; line is the last thing that happens before I lose IE.
IE Developer's Toolbar. Download it here (IEDevToolBarSetup.msi).
For JavaScript debugging refer this blog.
Some guy made a bundle that's called Internet Explorer Collection. It includes some 6 different IE browsers ranging from IE6 to IE8 in different builds. All those include Firebug (really, it sort of works) and Internet Explorer Developer Toolbar.
It was really helpful for me to debug IE7 issues.
see this link.
By placing 'debugger' in the javascript files in places where you'd like to start debugging you can debug the javascript in visual studio as well complete with trace, call stacks, etcetera.
The IE developer toolbar definitely helps alot. Visual Studios's debugger is also very good if you can get a machine with VS and IE7 on it.
DynaTrace is a profiling tool for IE7. However, it provides a great deal of information (including JS stacks), so it can also be very helpful for debugging.
IE 7 and IE 8 has built in debugging tools. Press F12 and you are ready to debug. Also firebug-firefox and chrome's inspect element options are useful/
I've noticed a strange behavior in two different sites when using IE8.
The first site is in the site that I maintain xebra.com.
The second site is google analytics.
The behavior is that when an address is typed directly into the address bar of IE8, both sites display correctly,
But when one of the sites has already been loaded, and you press the refresh button or F5 key, the layout gets all screwed up:
See screenshots here: here
Something is causing IE8 to render in 'quirks mode' which causes the breakage.
You can duplicate this by browsing to your site in IE8 and selecting Tools > Developer Tools > Document Mode > Quirks Mode.
Make sure your document is always being served in standards mode.
EDIT My original answer had 'compatability mode' where it should have read 'quirks mode' - the two are different.
JS.Companion was what was causing this odd bug, and not IE8. Phew!
http://www.my-debugbar.com/wiki/CompanionJS/HomePage
I spent the whole morning trying to figure out what was going on, I removed companion.js and bingo my site is perfect! thanks for this.
That's really strange. I don't have the problem on my computer with Companion.JS installed and http://www.xebra.com/ web page (under Vista SP1).
I would be happyto correct the Companion.JS bug that generates this problem if you can provide more information about the problem.