小编Jai*_*dia的帖子

TestNG中assertEquals()与assertTrue()之间的实际区别是什么?

我对这两种方法都很困惑,因为两者都可以做同样的事情,比如下面我的代码片段.

使用assertEquals()

String a = "Hello";
String b = "Hello";

assertEquals(a, b);
Run Code Online (Sandbox Code Playgroud)

使用assertTrue()

assertTrue(a.equals(b));
Run Code Online (Sandbox Code Playgroud)

谁能告诉我这两种方法之间的实际区别?

testng

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

智能合约在区块链中的位置(以太坊或Hyperledger)

那么,让我们考虑典型的贸易融资流程.导出器部署具有装运条件的合同,并在部署完成后生成散列.

问题:

1)合同在哪里存储?
2)海关和进口商等其他参与者如何获得此合同?
3)我们可以激活参与者级别对区块链合同的访问吗?

storage contract blockchain ethereum hyperledger

14
推荐指数
2
解决办法
6543
查看次数

Selenium等待Element中的任何人可见

单击特定按钮 - 我的测试站点将打开模态窗口.

但是打开的模态窗口是不同的,要么打开了 modal window 1 or modal window 2

两者都有不同的标题,不同的选项和不同的定位器.现在我应该等到模态window open Either 1 or 2.

可以等到一个模态窗口(WebElement)可见吗?

我在WebDriverWait方法中搜索过,但所有方法都要等到特定的WebElement可见或可点击.

我找不到一个更好的方法来等到任何一个可见.

你能建议任何一种方法来解决这种情况吗?

java selenium webdriver selenium-webdriver

6
推荐指数
1
解决办法
3万
查看次数

线程“main”中的异常org.openqa.selenium.NoSuchElementException:无法找到元素://*[@id='login-email']

我不得不重新测试xpath,以前它工作正常,但现在它给了我一个错误。

我也尝试过使用不同的定位器,例如idname。但仍然得到同样的错误。

package staging;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class login {

    public static void main (String[]args){
        System.setProperty("webdriver.gecko.driver","C:\\Program Files\\geckodriver.exe");
        WebDriver driver = new FirefoxDriver();

        //opening the browser
        driver.get("https://staging.keela.co/login");

        //logging
        driver.findElement(By.xpath("//*[@id='login-email']")).sendKeys("bandanakeela@yopmail.com");
        driver.findElement(By.xpath("//*[@id='login-password']")).sendKeys("keela");
        driver.findElement(By.xpath("//*[@id='login-form']/div[3]/div/button")).click();       
 }
}
Run Code Online (Sandbox Code Playgroud)

java selenium xpath automation selenium-webdriver

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

如何理解jmeter中的Graph结果?

我的performance testing使用jmeter工具中有以下场景。

Number of Thread users = 100 
Ramp-up period (seconds) = 100
Loop count = 10
Run Code Online (Sandbox Code Playgroud)

Ramp-Up period 指示JMeter在开始下一个用户之前延迟多长时间。例如,在我的场景中,我有100 users一个100 secondRamp-Up period,那么启动用户之间的延迟将为1 秒(100 个用户/100 秒)

在 HTTP 请求默认值控制面板中,输入要测试的网站名称 ( http://www.google.com )

参考图片:

在此输入图像描述

有关更多详细信息,请参阅下面的结果图:

在此输入图像描述

jmeter performance-testing

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

java.lang.IllegalStateException:驱动程序可执行文件的路径必须由webdriver.gecko.driver系统属性设置

package com.merchantPlatform;

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;

public class MerchantPlatformTest {

    public static void main(String[] args) {

        System.getProperty("webdriver.gecko.driver", "C:\\Selenium WebDriver\\geckodriver\\geckodriver-v0.17.0-win64\\geckodriver.exe");

        DesiredCapabilities capabilities = DesiredCapabilities.firefox();
        capabilities.setCapability("marionette", true);

        // Initialize WebDriver
        WebDriver driver = new FirefoxDriver(capabilities);

         /* This works fine for versions lesser than Selenium 3. For Selenium 3 and higher, it will throw java.lang.IllegalStateException */

        // Maximize Window
        driver.manage().window().maximize();

        // Wait For Page To Load
        driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);

        // Navigate to MerchantPlatform URL
        driver.get("http://localhost:52939/");

    }

}
Run Code Online (Sandbox Code Playgroud)

错误

我得到以下例外 System.getProperty …

java selenium getproperty geckodriver

3
推荐指数
1
解决办法
2万
查看次数

JAVA Selenium WebElement覆盖click()方法

override WebElement click()添加一些wait功能的好习惯,因为在某些页面中我需要单击按钮,并且在某些情况下还没有加载按钮,因此我添加了等待以检查元素是否可见。

所以我的问题是:创建abstract class一个实现WebElement并重写click()方法以添加一些等待功能的更好的方法,还是仅在特定页面中进行纯等待的方法更好?

java selenium automation automated-tests

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

从用户撤消在公共架构上创建 - 在Postgresql中不起作用

我正在使用postgresql -8.4.20哪个是JON服务器的后端,并使用用户名登录rhqadmin并连接到数据库rhq.

连接后它默认将我重定向到公共模式.现在我不想让这个用户rhqadmin在公共Schema中创建表.

所以我使用以下命令撤销公共模式的创建权限: -

Revoke Create ON SCHEMA public FROM rhqadmin;
Run Code Online (Sandbox Code Playgroud)

然后它给了我警告 -

"没有特权可以被撤销为"公共".

当我与超级用户登录postgres并从那里我撤消公共架构的'CREATE'权限为用户rhqadmin然后它没有给出任何警告并成功撤销然后我用用户登录rhqadmin并尝试在公共架构中创建表再次它允许我甚至在从超级用户撤消创建权限后创建表.

请告诉我为什么撤销权限不适用于公共架构或我犯了任何错误.

此致,
阿维纳什

postgresql

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