TheBrainFamily/chimpy

Error: An element could not be located on the page using the given search parameters ("input[Search_Query_Term1="Re"]").

samhatoum opened this issue · 0 comments

Issue by neville4529
Wednesday Jan 10, 2018 at 00:54 GMT
Originally opened as xolvio/chimp#673


Here is my code:
module.exports = function() {

this.Given(/^I have visited bct$/, function () {
browser.url('https://bct-test.ucdavis.edu/bct_nation/home.seam');
});

this.When(/^I click Browse Trials$/, function () {
browser.click('#HomeBrowseButton');
});

this.Then(/^I see All Trials$/, function () {
browser.screenshot('BrowseTrialsMetastaticLink.png');
});

this.When(/^I Search All Trials "([^"]*)"$/, function (SearchTerm1) {
// Write code here that turns the phrase above into concrete actions
browser.setValue('input[Search_Query_Term1="Re"]', SearchTerm1);
browser.click(['#searchGo']);
});

this.Then(/^I see "([^"]*)" Trials$/, function (arg1) {
// Write code here that turns the phrase above into concrete actions
var my_expected_text='Trials contain';
var my_displayed_text = document.getElementsByClassName('ContentHeaderText');
expect(my_displayed_text).toBe(my_expected_text);
});

}
Error Messages below:
[chimp] Running...
Feature: Browse Trials on Web

As a breast cancer patient
I want to browse trials on web
So I can find information

Scenario: Browse Trials
✔ Given I have visited bct
✔ When I click Browse Trials
✔ Then I see All Trials

Scenario: Search All Trials
✔ Given I have visited bct
✖ When I Search All Trials "Reproductive"

  • Then I see "Reproductive" Trials

Failures:

  1. Scenario: Search All Trials - features/browsetrial.feature:12
    Step: When I Search All Trials "Reproductive" - features/browsetrial.feature:14
    Step Definition: features/support/step_defs.js:15
    Message:
    Error: An element could not be located on the page using the given search parameters ("input[Search_Query_Term1="Re"]").
    at World. (features/support/step_defs.js:17:12)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickDomainCallback (internal/process/next_tick.js:128:9)

2 scenarios (1 failed, 1 passed)
6 steps (1 failed, 1 skipped, 4 passed)
0m08.204s