我需要写一个伪代码,但我以前从来没有写过伪代码。通过搜索,我找到了基本算法和简单算法的伪代码示例,但我没有任何想法来编写具有Selenium方法的伪代码。
你有自动化测试的伪代码示例吗?
我的脑海中有Java和selenium,来自cucumber场景的自动化测试。我只需要一个例子来指导我写我的伪代码。
发布于 2021-11-26 19:34:14
伪码
是以注释和信息性文本的形式编写的,这些文本仅用简单的英语编写。就像编程语言一样,它没有任何语法,所以它不能被编译器编译或解释。
用Java编写伪代码的方法
为了在java中编写伪代码,您可以按照以下步骤操作:
在设计Java程序的伪代码时,我们需要记住的几点:
if-then,for,while,cases标准编程结构。伪代码的部分应该完成,有限且清晰的understand.示例伪代码
Initialize c to zero.
Initialize n to a random number to check Armstrong.
Initialize temp to n.
Repeat steps until the value of n are greater than zero.
Find a reminder of n by using n%10.
Remove the last digit from the number by using n/10.
Find the thrice of the reminder and add it to c.
If temp == c
Print "Armstrong number"
else
Not an Armstrong number"发布于 2021-11-26 13:04:27
伪代码是“伪”的,因为它不一定与现有的方法一起操作。只需对您的代码使用常识,如
elements = Selenium.find(locator)
for each element in elements
do:
assert that element.text is not empty
odhttps://stackoverflow.com/questions/70123754
复制相似问题