|
I would like to automate testing of a Website writing code in C#,
The idea is to open the browser,navigate to the site,once the page is loaded search for a text box write some stuff in it click a button wait for the page refresh and search a string or an element on the page if so Succeeded else report failure,
Guide me with some method or article describing the procedure how to do it,
|
|
|
|
|
|
Hi all. Please see the following scenario. I have a textbox on my page with ADD button. when i enter some text in textbox and Click ADD, the text will be added in my gridview. so far, so good. Now, If i refresh the page, that record has been inserted again and Gridview will now show two similar records. Please tell me how to deal with it ? whether i have to keep check on textbox or what else ?
|
|
|
|
|
What are you doing in your page load or page init events?
|
|
|
|
|
in page load, i have write:
if (isPostBack == true)
{
if (txtValue.Text == "")
{
// Do Nothing
}
}
The paging size of my grid is set to 3. When i INSERT Record for first time, it shows only one record and on the page refresh, it doesnt insert record again. However, when i insert record for the second time, it insert record on page refresh again. Please tell me how to solve it.
|
|
|
|
|
First, there is no reason to qualify a boolean value. if (Page.IsPostBack) will work fine. But that's not your problem.
What's in the click event code?
|
|
|
|
|
Good People,
I am new to C#.
I have to build a desktop/stand-alone windows application. I have to assume the end user only has windows and .NET 2.0 on their computer. The application will need to have a database to store various information (i.e. statistics, unit performance, etc...). What database approach should I use that doesn't require them to have MS Office or MS Access? In other words, I need the database to ship with the software or be contained in it so that the user only has to install my software in order to fully use the application. I don't want them to have to install anything else besides - possibly, the .NET framework.
Also, is there a C# equivalent for the SQLite database or a C# API for it?
Thanks,
BP
|
|
|
|
|
SQLExpress can be used though it will need to be installed along with your applicaiton if not already on the users system.
only two letters away from being an asset
|
|
|
|
|
There are a few options. The two that I can think of off the top of my head are:
VistaDB: A commercial database system that can be distributed as a single DLL in your application's setup program.
SQLite: A public domain database system that is a couple of DLLs to add to your set up.
VistaDB is easier to use, although it costs money. SQLite is a bit more difficult to get going with and has no tools (although you can probably find something to help you design a database without doing everything programmatically), but it costs nothing.
|
|
|
|
|
SQL Server express is a good option, for something free. However, I don't think your client needs Access installed in order for you to ship an MDB file, which is easiest of all, deployment wise.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Thanks for your response,
Will that same strategy work with the full version of SQL Server?
Thanks again,
BP
|
|
|
|
|
Install latest version of MDAC and you can use a .mdb access file with no problem. .NET uses OleDb and the JET engine to access a MSAcces database and these are installed in any modern windows version...but just to make sure the client is running the latest versions, install the lates MDAC, downloadable for free from MS.
To make it short...MSAcces is the easiest deployment in your case and the client does not need to have it installed for the app to run perfectly using the db.
|
|
|
|
|
Thanks for your response.
What is "MDAC" and does it come with Visual Studio 2005 Professional? So I can use an MS Access db file during development and ship it with the software and they don't need MS Access? Can I ship MDAC with my software? Will it work with Visual Studio 2005 Professional "Click Once" feature?
Thanks,
BP
|
|
|
|
|
Hi everybody.
I'm new here and I have a big problem.
I have a DataGridView, filled manual. With a click you can edit the cells. After the editing, i clear the dgv and fill it with the new data. and the method datagridview1.rows.clear() this error appears:
System.InvalidOperationException wurde nicht behandelt.
Message="Der Vorgang ist ungültig, da er einen Wiedereintrittsaufruf an die SetCurrentCellAddressCore-Funktion zur Folge hat."
Source="System.Windows.Forms"
StackTrace:
bei System.Windows.Forms.DataGridView.SetCurrentCellAddressCore(Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAddress, Boolean validateCurrentCell, Boolean throughMouseClick)
bei System.Windows.Forms.DataGridView.set_CurrentCell(DataGridViewCell value)
bei Administration.Form1.NewsEinlesen() in D:\schule\_Maturaprojekt\Administrationstool\Administration\Administration\Form1.cs:Zeile 91.
bei Administration.Form1.dataGridView1_CellEndEdit_1(Object sender, DataGridViewCellEventArgs e) in D:\schule\_Maturaprojekt\Administrationstool\Administration\Administration\Form1.cs:Zeile 552.
bei System.Windows.Forms.DataGridView.OnCellEndEdit(DataGridViewCellEventArgs e)
bei System.Windows.Forms.DataGridView.EndEdit(DataGridViewDataErrorContexts context, DataGridViewValidateCellInternal validateCell, Boolean fireCellLeave, Boolean fireCellEnter, Boolean fireRowLeave, Boolean fireRowEnter, Boolean fireLeave, Boolean keepFocus, Boolean resetCurrentCell, Boolean resetAnchorCell)
bei System.Windows.Forms.DataGridView.SetCurrentCellAddressCore(Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAddress, Boolean validateCurrentCell, Boolean throughMouseClick)
bei System.Windows.Forms.DataGridView.OnCellMouseDown(HitTestInfo hti, Boolean isShiftDown, Boolean isControlDown)
bei System.Windows.Forms.DataGridView.OnCellMouseDown(DataGridViewCellMouseEventArgs e)
bei System.Windows.Forms.DataGridView.OnMouseDown(MouseEventArgs e)
bei System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.DataGridView.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(Form mainForm)
bei Administration.Program.Main() in D:\schule\_Maturaprojekt\Administrationstool\Administration\Administration\Program.cs:Zeile 17.
bei System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
When you finish the editing with enter, the changes are automatically saved. This works fine, only when you click into another cell without finishing i get this error.
thx if anybody can help me.
|
|
|
|
|
Good People,
What is the C# equivalent of C++ STL Vectors?
Thanks,
BP
|
|
|
|
|
My C++ is a little rusty but I believe Dictionary<> would be close. Although you might find something better here Power Collections for .NET[^]
only two letters away from being an asset
|
|
|
|
|
System.Collections.Generic.List<T> makes the same job as the std::vector<T>
System.Collections.Generic.Dictionary<TKey, TValue> makes the same job as std::map<TKey, TValue>
Kind regards
Simon
|
|
|
|
|
Hi,
I am facing a problem. I have one tabcontrol,but i dint't add any tabpage on it.Now,i would like to add a tooltips in the tabcontrol(In my situation,i need to create it and add it at runtime). I have try to create a new tab page (in run time),then create a tooltip control(in runtime),and try to add the tooltip into that tabpage,but i cant make it.Below is my some coding:
TabPage newTab = new TabPage();<br />
ToolTip tooltip = new ToolTip();<br />
newTab.Controls.Add(tooltip);<br />
tabControlChart.Controls.Add(newTab);
I was get this error:
1)The best overloaded method match for 'System.Windows.Forms.Control.ControlCollection.Add(System.Windows.Forms.Control)' has some invalid arguments
2)Argument '1': cannot convert from 'System.Windows.Forms.ToolTip' to 'System.Windows.Forms.Control
My question is,how can i add the tooltip control(at runtime) into a tabpage?
can anyone guide me on this problme?
Thanks in advance,
cocoonwls
|
|
|
|
|
Hello,
tooltip.SetToolTip(newTab, "youre text");
All the best,
Martin
|
|
|
|
|
hi,
Thank you for your help hand,i got it
cocoonwls
|
|
|
|
|
|
Hello,
Use the SelectedItem property, for example in the SelectedIndexChanged event:
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
string test = comboBox1.SelectedItem.ToString();
}
All the best,
Martin
|
|
|
|
|
comboBox1.SelectedIndex ?
|
|
|
|
|
If I read your question correctly, SelectedValue is what you want.
A simple test is place 2 labels on the form, and on the Change event populate them with the selectedValue and selectedIndex values. If the index label gets populated, and not the value, you know there is something wrong with your query.
|
|
|
|
|
hi,
is there any event that let me know when the textbox has focus and when it looses focus? i remember in java there was something like that maybe called onFocus or something like that.
thanks
|
|
|
|
|