0

Currently I am testing an online shop. I want to automate the checkout process but each time an item has been added to the cart and the checkout process is completed that particular item is removed from the list, and the second time the test runs, it returns an error because it can not find the item.

Is there any way I can build a test that completes the test without failing because it can not find that particular item ?

I am using Selenium with PHP and Selenium IDE. Please note that I am just a beginner in automation. Any help would be appreciated.

Best regards, Radu

4

1 回答 1

0

无论您进行何种测试,您都应该对测试开始时被测系统的预期初始情况充满信心。在您的情况下,如果您的测试需要特定项目可用,那么这应该是您的“测试设置”部分的一部分。

假设您有 100 个测试需要一个项目可用。我可以看到 2 种不同的策略来解决您的问题:

  1. 在您的测试套件开始时,部署一个自定义的全新网站,其中包含您的 100 种可用产品。您的测试将更新/销毁这些数据,但您不会这样做,因为下次运行测试时,您将部署一组全新的项目。

  2. 在每个测试用例结束时,您执行一个自定义操作,通过将项目添加回商店来清理您的系统。

于 2013-06-17T07:47:53.393 回答