相关疑难解决方法(0)

FirefoxWebdriver 没有数据可用于编码 437

我想创建一个 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)

c# .net-core

13
推荐指数
1
解决办法
1511
查看次数

System.NotSupportedException:没有数据可用于编码1252

我正在与“ 信任商务指南”一起工作,以了解如何生成付款令牌,该令牌将允许客户使用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)

c#

5
推荐指数
5
解决办法
3804
查看次数

在C#最新3.9.0上使Selenium与Firefox驱动程序一起使用

我无法让Selenium与c#上的Firefox驱动程序一起使用。Chrome可以完美运行,但Firefox无法运行。

使用方法:

  • 网络框架4.6.1
  • 硒的最新版本3.9.0
  • 壁虎驱动程序(从管理Nuget软件包)下载0.19.1
  • 使用MSTest.TestAdapater,它应该与Chrome一样完美运行。

我已经在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)

}

c# firefox selenium geckodriver

1
推荐指数
1
解决办法
6766
查看次数

标签 统计

c# ×3

.net-core ×1

firefox ×1

geckodriver ×1

selenium ×1