Using webdriver (in C# not java) I want to selectframe, but this line is not working to me:
driver.switchTo().frame("ifr");
which Hierarchy I must write about selectframe? I never use selectFrame in a proyect
I have this only:
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.UI;
If you want to perform some action (click a button) which is inside an iFrame, you need to switch to it (move focus / "zoom-in") because by default you are on the top parent.
Example: In order to get the text from the colored iFrame from here http://www.w3schools.com/html/tryit.asp?filename=tryhtml_iframe_height_width first you need to do
<'WebDriver'>.switchTo().frame(<'frameId'>)
and after that you will be able to get the text.
Related
I want to pass a textbox value to RDLC report. For said purpose my code is:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Reporting.WebForms;
using System.IO;
using System.Data.SqlClient;
using System.Configuration;
using System.Globalization;
ReportParameterCollection reportParameters = new ReportParameterCollection();
reportParameters.Add(new ReportParameter("ReportParameter1", t1.Text));
this.reportViewer2.LocalReport.SetParameters(reportParameters);
this.reportViewer2.RefreshReport();
But i get the error during compile time which is:
Error 15 The best overloaded method match for 'Microsoft.Reporting.WinForms.Report.SetParameters(System.Collections.Generic.IEnumerable<Microsoft.Reporting.WinForms.ReportParameter>)' has some invalid arguments
Error 16 Argument 1: cannot convert from 'Microsoft.Reporting.WebForms.ReportParameterCollection' to 'System.Collections.Generic.IEnumerable<Microsoft.Reporting.WinForms.ReportParameter>'
This error occurs on following line:
this.reportViewer2.LocalReport.SetParameters(reportParameters);
Help is required to resolve it. Thanks in advance
I resolved the error by replacing Microsoft.Reporting.WebForms with Microsoft.Reporting.WinForms
I have created a class library to be used in a other project (which is not a .Net project), i have built the solution the dll file was generated, but when i try to explor my dll using dllexp i foud that it's empty.
My class is declared public as you can see bellow:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PCLImportCLin.ServiceReference1;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Xml.Serialization;
namespace PCLImportCLin
{
public class ImportCL
{
public int geTroupeau()
{
// Rest of the code
}
}
}
What you are looking for, I guess, is this:
(Assuming you are using Visual Studio) In your project, right-click 'References', go to 'Browse' and then click the 'Browse...' button. Go to your dll path, select it. There you go. Now you can use it like this using Your.Dll.Namespace;
I have a strange error and don't know how to solve that. I have a Form which gets opened by another (Main)Form. When I write
List<String> valStoreAsString = new List<String>();
I get "The value or namespace List could not get found". My using directives are the following:
using System;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Collections;
using System.Runtime.InteropServices;
In the other Forms it works fine. What happened here?
Add following using directive to the list of usings.
using System.Collections.Generic;
Tip
If you are using Visual Studio and if you don't know the namespace then type name of type (Case sensetive) in editor and then press ctrl+ . and select add using option and VS will add related using for you.
or you can right click on name of Type and select Resolve option and select using .... sub option.
I have a folder
Helper
1. Class (SessionManagement.cs)
I have Model.edmx at root.
How can I use Model in my SessionManagement Class
I want it like this
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NGO_MS.Model; // Error is The type or name space Model does not exist
using NGO_MS.Controls;
using System.Net.Mail;
using System.Net;
using System.Web.UI;
using NSLogger;
using NGO_MS.DAL;
using System.Configuration;
My question is how can i use it with using ? I am beginer Kindly guide me.
Inside a method in your SessionManangement class paste the following code.
using (Model ctx = new Model()){
}
What is the assembly reference for a Filedownloader in c#?
I am looking for to download the files from ftp to my local drive 'c' ,
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
FileDownloader f = new FileDownloader();
which reference should I need to add for the filedownloader?
I guess that you are trying to download files from FTP,and you don't have to use the FileDownloader class.
You can use this link for example: "http://msdn.microsoft.com/en-us/library/ms229711(v=vs.110).aspx".
You can also use an open source to do that, try looking at this link: "http://www.codeproject.com/Tips/443588/Simple-Csharp-FTP-Class"
There is an example of how simple it is to use (From the link above):
ftp ftpClient = new ftp(#"ftp://10.10.10.10/", "user", "password");
ftpClient.download("etc/test.txt", #"C:\Users\metastruct\Desktop\test.txt");