gpt4 book ai didi

java - 方法中每次运行新值

转载 作者:行者123 更新时间:2023-12-02 00:55:41 25 4
gpt4 key购买 nike

我有 50 个号码要检查它们是否有效。

目前,我的测试打开我们的内部公司网站,浏览一些选项卡,然后粘贴电话号码并等待确认号码是否处于 Activity 状态的元素。

当我有 1 或两个数字要检查时,它可以工作,C 可以在我的方法中更改它,一切都很好,但是当我有 50 个数字要检查时,是否有可能自动执行此操作?将所有数字放在一个列表中,每次运行我的代码时都使用下一个数字?然后打印所有 Activity 号码?

我知道对于多次 run 方法,我必须使用“@Test(invocationCount = x)”,但是然后呢?我不知道,合理地列出声音

@FindBy(xpath = "//*[@id=\"mainCtrl\"]/header/div[1]/div[2]/form/div/div[2]/button[2]")
private WebElement clickedToSearchNumber;

public void typeNumber(String number) {
typeNumber.sendKeys(number);

}

activationProces activation = new activationProces(driver);
activation.typeNumber("123123123");



最佳答案

public class file {
public static void main(String[] args) throws Exception
{

File file =
new File("C:\\Users\\XYZ\\Documents\\number.txt");
Scanner sc = new Scanner(file);

while (sc.hasNextLine())
System.out.println(sc.nextLine());} }

所以这段代码从我的文件中读取数字

关于java - 方法中每次运行新值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57820870/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com