У меня есть файл функций с двумя сценариями: один для входа на веб-сайт, другой выполняет некоторые действия на странице входа в систему. Если я упорядочу файл функций только с одним сценарием, он будет работать нормально, особенно строка, выделенная в первом файле функций, приведенном ниже. Но если один и тот же файл функций имеет два сценария, это создает проблему с веб-локатором, даже если в коде объекта страницы я даю ту же строку кода, чтобы найти веб-элемент.
Первый сценарий (с Outline) просто выполняет вход на сайт. Никаких хранимых предметов или чего-либо еще.
Второй сценарий пытается проверить некоторые данные на странице, например, заполнена ли строка с идентификатором пользователя и датой.
Проблема заключается во втором файле функций, в котором я ввел второе ключевое слово сценария, потому что это по праву другой отдельный сценарий.
ПРИМЕЧАНИЕ. - Код, используемый для определения местоположения веб-элемента в двух местах (поддерживается как ОТДЕЛЬНЫЕ ПРОЕКТЫ) , ОДИН ОДИН.
Пожалуйста, помогите мне определить проблему. Сводит меня с ума.
#########------This feature file runs FINE.-----Feature: Data Extract List Page
In order to test DataHub UI,
I want to specify the features of Extract History Page
**Scenario Outline:** Navigate to Extract History page from the List page
Given the User opens the PRAMA Datahub website
When the User types in userId "<uId>" and pacman passcode "
<pacman_passcode>"
And the User clicks on submit button
Then the User lands on page "<title>"
When status column-cell has status "Ready" value
And last run column-cell has userid and date populated (NOTE:working
fine)
And the User clicks on last run column cell of first extract record
Then the User is navigated to the Execution History
"execution_history" page
When the execution history page shows "completed" status
And the User clicks on extract record header
Then verify number of records greater than zero
And file name is a valid string
Examples:
| uId | pacman_passcode . | title |
| xxx | kT7&)cP^jhK&xze | Datahub |
### --- Этот файл функций НЕ МОЖЕТ найти веб-элемент (первый после входа в систему) - #
**Feature:** Data Extract List Page
In order to test DataHub UI,
I want to specify the features of Extract History Page
**Scenario:** User logs in to prama datahub website
Given the User opens the PRAMA Datahub website
When the User types in userId "xxxxx" and pacman passcode
"kT7&)cP^jhK&"
And the User clicks submit button
Then the User lands on page "Datahub"
**Scenario:**Navigate to Extract History page from the Extract List page
Given User logs in to prama datahub website
When status column-cell has status "Ready" value
And last run column-cell has userid and date populated(NOTE: throwing
web element locator exception)
And the User clicks on last run column cell of first extract record
Then the User is navigated to the Execution History
"execution_history" page
ОБНОВЛЕНИЕ: Просто для удовольствия, когда я закомментировал подозрительное ключевое слово «Сценарий» и сопровождающий его шаг @Given, которые практически не делают ничего нового, веб-локаторы обнаружены, НЕТ ПРОБЛЕМЫ! Что за интересное здесь происходит? Никаких данных из сценария первого входа в систему нет, ничего. Просто зашел в систему, попросил веб-локатор.
**Feature:** Data Extract List Page
In order to test DataHub UI,
I want to specify the features of Extract History Page
**Scenario:** User logs in to prama datahub website
Given the User opens the PRAMA Datahub website
When the User types in userId "pnutala" and pacman passcode "98hgdPwYxze"
And the User clicks submit button
Then the User lands on page "Datahub"
**#Scenario:Navigate to Extract History page from the Extract List page**
**#Given User logs in to prama datahub website**
When status column-cell has status "Ready" value
And last run column-cell has userid and date populated
And the User clicks on last run column cell of first extract record
Then the User is navigated to the Execution History
"execution_history" page
When the execution history page shows "completed" status
And the User clicks on extract record header
Then verify number of records greater than zero
And file name is a valid string