How To Run Coded Web Test From Console App
Oct 5, 2010I have a simple web test. All Web tests concluded in the following method:
[code]....
How can I do this?
MembershipCreateStatus
I have a simple web test. All Web tests concluded in the following method:
[code]....
How can I do this?
MembershipCreateStatus
I am doing Automated coded ui testing in asp.net 2010 for web application. I am testing site and i need to know how can i create the test which will work with all browsers. Right now i created test in IE 8 but its not working in Firefox. So is there any way i can create one test and will work in all browser.
View 2 RepliesI had a general question about extracting code from a visual studio web test. I used the "generate code" option of a web test and got the following:
[code]....
What I wanted to do is basically put this test into a separate service to run throughout the day for purposes of health checking. I basically want to make sure that users are able to log in throughout the day. What process should I use to get the test into something like a console app? I was running into issues with debugging the webtest code.
i have to do some message exchange with a 3rd party (in a website).When the client posts a page, i start the message exchange. When that doesn't succeed for some reason, i report this to the client by rendering the page with a message.On the background, in a separate thread, i start a process to send abort messages to the 3rd party. I can't do this while the user is waiting for the page to come back, because it might take a few minutes.But in a test project, the test ends when the message to the 3rd party is sent, and after the new thread is started. But it seems that the new thread also ends, when the test is done.
Is that normal behaviour?I do start the thread in a new class with a reference to 2 objects from the class which tries to send the message in the first place, may that be a problem?EDIT: it keeps running when the whole process is started in IIS
The simple website I am trying to build is a list of banks with their corresponding website. I also wanted the ability to add banks/website with the use of some text boxes and a button click event. I've got this fully working until I publish it. When I try to run it on the webserver it say it can not find the specified file c:windowssystem32inetservURLs.xml Now I understand the problem I just can not seem to fix it with out hard coding the path of the file into code.
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.Click
' Load the Document
Dim Doc As New XmlDocument
Doc.Load("URLs.xml")
'Create a New Element
Dim bankNode As XmlNode
bankNode = Doc.CreateElement("bank")
'create and add sub elements for this node
Dim nameNode, addressNode, dateNode As XmlNode '
nameNode = Doc.CreateElement("name")
addressNode = Doc.CreateElement("address")
dateNode = Doc.CreateElement("date")
bankNode.AppendChild(nameNode)
bankNode.AppendChild(addressNode)
bankNode.AppendChild(dateNode)
'add the text data
nameNode.AppendChild(Doc.CreateTextNode(tbWebsite.Text))
addressNode.AppendChild(Doc.CreateTextNode(tbAddress.Text))
dateNode.AppendChild(Doc.CreateTextNode(DateTime.Today))
'add the new element to the end of the list
Doc.DocumentElement.AppendChild(bankNode)
'save it
Doc.Save("URLS.xml")
End Sub
End Class
I built a crystal report using crystal report 2008, and have it working fine aganist my test db. in my c# code that loads the report I put this in:
[Code]....
but problem is when i pushed this change to production, the report was stilling pulling test data, even though the web.config entry (LocalSqlServer) was updated in production to use production db. Could I have setup the crystal file incorrectly? When I'm creating the crystal file and connecting it to the db, is there something that I need to check or uncheck to tell it I'm going to dynamically supply the db connection rather than having it use the one I used to setup the report?
I am working on a ASP.NET MVC 2.0 Multi-Presentation web application which would use a common codebase to support different websites. These websites would differ in following aspects:
Each website will have their own headers, footers, images, CSS etc (I guess website specific Master Pages)
Some of the UI elements could be different based on soft-coded settings at website level
What is the best approach to handle these requirements? Should I be storing these website level soft-coded settings in Database or multiple config files? I might have to provide a admin UI to manage these soft-coded settings. How do I access these settings in different layers (MVC, Services, Repositories etc) of my application?
I am running a LINQ query which populates a list used by a DropDownList, I need to insert an "Unassigned" value to the list. The function below queries the values correctly from the db but does not insert the "Unaasinged" value to the list.
[Code]....
As the title says then the question is relative simple however I cant decide whether a resource file with strings in is better than hard-coded strings...
View 3 RepliesI have a vb.net local application that reports to a web server with POST method.
Unfortunately, like it says in the title, the swedish characters (among others I guess) comes back in ASCII (I think).
local app:
Code:
Function doHtmlPost(ByVal url As String) As String
Dim strResult As String = ""
Dim myWriter As StreamWriter
Dim mystring As String
Dim strR As New StreamReader("c: estmytext.txt", Encoding.UTF8)
[code]....
I have a dropdown list with hard coded values:
<asp:ListItem Text="One Day Shoots" Value="1" />
<asp:ListItem Text="Multi-day Shoots" Value="2" />
I want to use this to insert and edit values from a db. For example when adding a record the user selects 'One Day Shoots' and 1 gets inserted into the database. Then if the user goes to edit the page since the value in the db is 1 then the 'One Day Shoots' is selected.
One way I considered accomplishing this was by using a hidden feild - when the user selects something in the dropdown list the field is updated with the value, then when the user actually adds the record the value in the feild is submitted. I'm pretty sure this would work but is there a better way?
I'm relativley new to ASP and am using VB for the coding. I have a page that has a few fields on it, one being a drop down list that get's populated from a SQL Server.
I used the GUI to generate this form (see below), the connectionstring:Prod1ConnectionString that is stored in the web config file is hard coded. I want to change that I use the connection string that is passed as a Session parameter. I've been looking for hours for an example of how to remove the connectionstring from the web code and place the proper code in code behind script on the load_page event.
[code]....
I have a little doubt about creating a login control in the master page within a contentplaceholder.
What i want is to create my own login control in the masterpage, using a loginview inside a contentplaceholder. The code is the following:
[Code]....
So far so good, but now i want to create the logic to do the actual login. In a regular aspx page i'll do it in the cmdlogin click event, but as i'm in the masterpage, i'm not sure if i can do that. I actually tried to do it in the code behind of the masterpage, but it didn't work. What can do?? do i ahve to use the asp.net login control?
I need to generate a GridView and inside of one of the cells insert a DropDownList.
The GridView is a list of the users of the web application.The DropDownList is a list of roles of the web aplication.
The GridView is to be a table with the diferent users, diferent columns with various information, the last cell should have a DropDownList with the roles, the role which the user of the line belongs to, should be visible!
i have datagrid , data coming from database but data in database as formated , i want to show data wihotu format
below example:
<B> test </B> data base has this type data
but in grid i want to show test not with format,
i am getting same data from database.
I'm trying to implement this tag cloud:
[URL]
...and I need the replace the hard-coded values below with those coming from my database?
[code]....
I've created the following sql string which returns the data in the format expected string/int or value/key
SELECT Tag, COUNT(Tag) AS Counter
FROM dbo.CtagCloud
GROUP BY Tag
HAVING (COUNT(Tag) > 3)
ORDER BY Counter DESC
I have just taken over a project from another programmer and want to add some functionality. The ASP.NET application allows users to sign up, fill out details about a company, and those details are submitted to companies house (very brief explanation!). These details are only submitted when an administrator logs in to the control panel and clicks a "Run Submissions" button. This then attempts to submit all pending formations to the gateway.
What I want to do is design an external desktop or console application, that "clicks" this button for me every set amount of minutes. The application will some how need to "log in".
Is there any way to use class I have in an asp.net website app_code folder in a console app that is in the same solution?
If not what is the best option? I only want to change this in one location.
I'm just learning C# and using MS Visual Studio and a tutorial website.
I've written a little console app and now I want it on my website but I can't find out how to do it. Not in VS, nor their help screens, nor on that tutorial site, nor anywhere else I look.
Csharp Code: ..........
I wrote a console app that displays information from a local file on my desktop and displays the content within the file. I was wondering how can I create a function that can search for keywords and only display the words, I want it to search for?I'm trying to display this content in a database and search for the content I want it to display.
* ZIP Codes
* Area Codes
* City Name
* State Name
* Two digit State Code
* City Type
* City Alias Abbrev.
* County Name
* State FIPS
* County FIPS
* Time Zone
* Daylight Savings Indicator
* Number of Businesses
* Q1 Payroll
* Annual Payroll
* Number of Employees
* Employment Flag
* County Growth Rate
I tried something like this - And it didn't work.
Csharp Code:
var keywords = new string[] {"some", "keywords"}; var foundKeywords = File.ReadAllLines("filename"). SelectMany(line => keywords.Where(keyword => line.Contains(keyword))). Distinct();
I can't seem to find the console where it's suppose to display the console.writeline(). Can someone post a picture of where it's supposed to be in Visual web developer 2010?
View 4 RepliesI am learning C# in Visual Studio (VS), and in VS i have successfully made different 'projects' under the 'solution' for each fo the samples in my C# book as can be seen here:
[URL]
the thing is when i press the green play button to run the debugger/program, it always executes "ConsoleApplication1" (look at the above image) when i want to try out the new application i wrote (named ConsoleApplication3)
How do i do that?
I need to quickly write a test console app for testing purposes.This app is basically the console version of an ASP.NET app.The original ASP.NET app makes use of the global Application object for storing global data.How can I get the same functionality of the Application object in my console app? Can I declare an HttpApplication object directly and use it?NOTE - this app is just for debugging some issues, not production code, so I'm ok if it's not "best practice".
View 3 RepliesI have the follwoing code that works in a console application but I would like to convert it to a web application. I was thinking of using a dataset. How do I go about doing so?
public static void Main()
var id = AddContact();
}
const string contactCompanyId = "lings";
const string firstName = "Bobby";
const string lastName = "Singh";........
Here's the situation, I've got a console application that needs to run once a day and make a few requests to pages that require authentication to view. The pages are hosted in a really basic ASP.Net Web Application.
So, I know that in order for the requests to go through successfully I have to authenticate with the server. So I've hooked up the console application to the ASP.Net Membership Provider I'm using for the web app and it successfully determines if a set of a credentials are valid. However, after calling Membership.ValidateUser() any requests I make just get the login screen. After doing some reading it seems that this is because I'm missing the important cookie information that persists my login or what-have-you.
I'm using a basic WebClient to make the requests and then reading/discarding the result.
So the meat of the question is this: Is there a simple way to validate the login information and hold on to it so that I can make the requests successfully, or is this the exact same case as the other two questions I found that require the WebClient to make a "manual" login request to the login.aspx page and try to hold on to the cookie from there?
The questions I'm referencing are:
Authenticating ASP.NET MVC user from a WPF application and Login to website and use cookie to get source for another page