简体   繁体   English

在编写端到端 selenium 测试时,我应该导航到一个页面还是只打开 URL?

[英]When writing end to end selenium tests, should I navigate to a page or just open the URL?

Say I need to submit a form on the 'Classes' page.假设我需要在“课程”页面上提交表格。 I am testing the 'enroll into class' feature.我正在测试“注册课程”功能。 Do I navigate to the page by clicking on the menu bar, or do I just directly open the URL of the page?是点击菜单栏导航到页面,还是直接打开页面的URL?

It depends on the scenario you need to test.这取决于您需要测试的场景。
As an autoimation engineer you need to work according to the documentation.作为自动化工程师,您需要根据文档进行工作。
If no scenario defined you can choose easiest way to do that.如果没有定义场景,您可以选择最简单的方法来做到这一点。

Incase clicking on the menu bar is the part of your @Test , you have to access the base page and navigate to the desired page by invoking click() on the menu bar.如果单击菜单栏@Test的一部分,则必须访问基本页面并通过调用菜单栏上的click()导航到所需页面。

Else you can directly open the URL of the page.否则你可以直接打开页面的URL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM