我想创建一个 FirefoxWebdriver 但收到以下错误
Message:
Initialization method Sma.Ldx.Systemtest.Ui.Tests.IbaTest.TestInitialize
threw exception. System.TypeInitializationException: The type initializer for
'System.IO.Compression.ZipStorer' threw an exception. --->
System.NotSupportedException: No data is available for encoding 437. For
information on defining a custom encoding, see the documentation for the
Encoding.RegisterProvider method..
Run Code Online (Sandbox Code Playgroud)
它是一个 netstandard2.0 lib 并在 dotnet core 2.2 上运行 有人可以帮忙吗?
我尝试导入 System.Text.Encoding.CodePages 并尝试使用 System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance) 但这在 dotnetcore2.2 中不受支持
Message:
Initialization method Sma.Ldx.Systemtest.Ui.Tests.IbaTest.TestInitialize
threw exception. System.TypeInitializationException: The type initializer for
'System.IO.Compression.ZipStorer' threw an exception. --->
System.NotSupportedException: No data is available for encoding …Run Code Online (Sandbox Code Playgroud) 我正在与“ 信任商务指南”一起工作,以了解如何生成付款令牌,该令牌将允许客户使用TC Trustee Host付款表格。他们的开发团队为我提供了有关如何检索此令牌的示例。
using System;
using System.Net;
using System.IO;
using System.Text;
using System.Collections;
using System.Web;
/** @class TCToken
* An example class for generating a TrustCommerce Trustee Token
*/
public class TCToken
{
public static void Main(string [] args)
{
string custid = "123456";
string password = "XXXXXX";
try {
// Adapted from http://www.west-wind.com/presentations/dotnetWebRequest/dotnetWebRequest.htm
string gateway_post_address = "https://vault.trustcommerce.com/trustee/token.php";
HttpWebRequest req = (HttpWebRequest) WebRequest.Create(gateway_post_address);
// A sixty second timeout.
req.Timeout = 60000;
string post_data = "custid=" + HttpUtility.UrlEncode(custid) + …Run Code Online (Sandbox Code Playgroud) 我无法让Selenium与c#上的Firefox驱动程序一起使用。Chrome可以完美运行,但Firefox无法运行。
使用方法:
我已经在Windows中设置了path变量。
GeckoDriver已安装在源代码的Bin文件夹中。
Firefoxdriverservice不存在,因此无法使用该命令。
我收到的错误是“ 引发异常:System.ComponentModel.Win32Exception:系统找不到指定的文件 ”
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System.Windows.Forms;
namespace BeatRecaptcha
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
IWebDriver driver = new FirefoxDriver();
driver.Manage().Window.Maximize();
//Go to Google
driver.Navigate().GoToUrl("www.google.co.uk");
}
}
Run Code Online (Sandbox Code Playgroud)
}