WebDriverArgumentException on attempt to click a Submit button - c#

I'm writing a unit test to upload CSV file in Jira.
I initialize the submit button By.Id() as shown on the screenshot below
I use the wait.Until() method to make sure that the element is present.
When I run the test, I receive openQA.Selenium.WebDriverArgumentException 'invalid argument' Not much description is provided by Selenium of what is causing the exception.
So dear QAs, have you ever bumped into this issue?

Related

AjaxControlToolkit - asp:HtmlEditorExtender problem with Chrome

I have a problem with Chrome only(with IE and Firefox the page works fine), in aspx page that uses "asp:HtmlEditorExtender" tag and the ajaxcontroltoolkit assembly is included.
The error message on the Chrome console is :
Uncaught DOMException: Failed to execute 'collapse' on 'Selection': There is no child at offset 3.
and the line of js code indicated is the following:
sel.collapse(this._editableDiv.firstChild, char);
I follow the workaround suggested in this link:
http://guerriandrea.blogspot.com/2015/01/problem-between-chrome-and.html
but the problem remains when saving the formatted content within the text area; the error remains client.
I tried to update the ajaxcontroltoolkit library and the bug doesn't show up ... the problem is that I would like to avoid updating this library as it is used by almost every page of my application and I would have to test all the functions again.
Thank you very much

Web Performance Testing - Code behind value as dynamic parameter

I've been put in charge of developing a performance test for one aspect of the system my company develops. The idea is that you upload a document, click a button, which then does a whole bunch of steps behind the scenes. The document is given a unique ID once it's uploaded, which I need to capture as a dynamic parameter so that the test can be repeated. The application is written in ASP.NET/C#, and I have no ability to view the source code or modify it in any way.
Visual Studio does not automatically pick this up as a dynamic parameter, despite the fact that it needs to be one.
Process Information
The id is generated when the document is uploaded. It's stored in the link that you click to process the document.
The id is grabbed from the code-behind at run time, through Razor code.
It is not passed through the referer to the next page, but somehow appears there anyway.
Things I've Tried
Extracting the value from the first page. This just results in having C# put in the id location instead of the actual value. Eg. 'DataItem.GetMember("ObjectId").Value' instead of '600-562949958140473'
Creating an intermediate step to get the id before moving onto the real page. I'm not sure how to do this successfully - my attempt just resulted in an additional failed step.
This is my first time working with Web Performance Testing, though I have used CodedUI. So for any explanation, please assume I'm an idiot.

Using JMeter to simulate enties in to Database

I'm trying to use Jmeter to simulate adding values, into a database from an ASP.NET website.
I have used the guide found here: https://www.youtube.com/watch?v=zYAiBwJK1v8
To setup the test, and to record the scenario. All of that seems to be working fine. The recorder, records the login to the site, and everything that comes after, including when I push the submit button to add the value to my database. When i afterwards run the recorded scenario it runs with no errors. But nothing is submittet to the database.
The scenario is this: I login to my site, (i'm using browser session id to differ between users)
Now I search for an item, the search text is parsed along with the url (this i can also confirm in the recording, in Jmeter)
Then i add this item to a tabel row in my databse using a submit button. (this also seems to be working in the recording details in Jmeter)
But nothing is added to the database when i use Jmeter to re-run the scenario. Can any one help me to find out, why or what I am missing?
I'm not sure what more information to give, but if you need more information let me know and thank you in advance
First of all I'd recommend checking that your Log In is successful using View Results Tree listener. At top left corner of the listener there will be a drop-down which defaults to Text. Select HTML (download resources) to see full response from server and verify if you're really logged in.
If not, refer to ASP.NET Login Testing with JMeter guide which highlights the peculiarities of simulating ASP.NET application log in including VIEWSTATE and EVENTVALIDATION dynamic form parameters extraction.

Show Message After a File has Downloaded in a New Window

The user fills in a form to download a file. The form results load in a new window (target="blank"). The MVC Controller Action returns a FileResult on success or my "SelfClosingPage" view on failure.
The goal behind this is to have the user download the file in a new page, and if any errors occur, the original calling page's url doesn't change (to the /DownloadFile url) and the user remains on the form page, instead of being directed to an error page.
This all works great, except I need to know when the file download is complete because I'd like to 1) hide the "File is downloading, please be patient" message if the download is successful 2) show an error message if the file download failed.
I was using a Cookie to do this and a JS interval to regularly check the cookies value. It either never worked or doesn't work any more (I can never get the cookie to show up on the original page).
Please advice. I can't use C# code in my JS because well, it wouldn't work since it executes once when the page is loaded and I'm trying to decouple the JS from the C# code.
I think my only solution is to do ajax javascript callbacks, but I'd like to avoid that.
UPDATE:
Found these related SO links that use the same approach I was trying to use.
MVC3 - File Download - Wait Status indicator
Detect when browser receives file download
Update 2
It's working again. I think the cookies expiry date was not long enough (though it should have been). I just changed it from 10 min (a file download should not take longer than that) to half a day.

Internet Explorer Script Error, Message from Webpage, Permission denied

I'm working with an embedded (Active X?) instance of IE within a VB6 application.
The browser displays demographic information based off the selected person (displayed as a list).
Everything works great until I try to quickly select different people from the list (clicking randomly over different people as fast as I can). After a few clicks, get two errors.
The first is an "Internet Explorer Script Error"
It says:
An Error has occurred in the script on this page
Line:
Char:
Error:
Code:
URL:
Do you want to continue running scripts on this page? yes|No
(Line, Char, Error, Code, URL are all blank).
The second error pops up directly over the first.
It says:
"Message from webpage
An error has occurred in this dialog
Error:53 Permission denied"
The page makes multiple ajax calls and also contains several iFrames (I'm thinking these are the cause).
Any advice on how to debug / resolve / avoid the problem would be most appreciated.
Thanks!
EDIT
Here is an image of the error
EDIT
I get a JScript anonymous function, No source available when I do happen to catch the error.
EDIT
I've successfully caught some of the errors. It seems that they are stemming primarily from MicrosoftAjax.js
Occurs Consistently: MicrosoftAjax.js - Sys._Application.callBaseMethod(this,"initialize"); Object Expected
Occurred Once: jquery-1.4.2.min.js - b.InsertBefore(d,b.firstChild) Object Expected
Occurred Once: Out of Memory Exception.
My host application is not using MicrosoftAjax.js at all, but the child iFrame applications are all asp.Net applications.
After a lot of testing and trying to figure out if I really needed to edit MicrosoftAjax.js to fix the problem, I finally found a solution that seems to have resolved the issue.
I added,
<script type="text/javascript">
window.onerror = function (e) { return true; }
</script>
to the header of ever application that I was pulling in via the iFrames, as well as to the parent page. It's been about two days since I made these changes and so far so good (though I'll need a few more days of testing to confirm that it's working 100%).
I had tried this before without success, but that was due to the position of the Script. I had other scripts (like jQuery and MicrosoftAjax) that were positioned before it. Those scripts threw errors before my window.onerror script was even evaluated.
Another interesting thing is that the iFrame errors seem to bubble up regardless of the error handling on the parent page. So I went into our Code repository and made the necessary changes to each of the applications I was pulling in.
Lastly, I want to say thank you to #Jacob for his initial help in troubleshooting this issue.
EDIT
Just wanted to add that I would have preferred to fix the error over burying it, but in the interest of time, this is the solution I've gone with for now.
If you want to just suppress Javascript errors, try setting the Silent property of the WebBrowser to True.
I've found that most of the IE "Permission denied" errors have to do with sharing Javascript objects between windows/frames. Since you produce it with rapid random clicking, I'm guessing this has to do with iframes/windows going away while their content is still being accessed.
One strategy you could use to avoid these problems is to never share any objects between frames. Wherever an object is created, that frame should be responsible for all operations and access to its members. Outside access should be controlled completely through calls to "interface" Javascript functions.
Try
WebBrowser1.ScriptErrorsSuppressed = true;

Categories