I am learning to use Protractor as the tool to automate web site testing. I am testing the page: https://www.upwork.com/. I am using Google Chrome browser.
The problem is:
1.When protractor goes to: https://www.upwork.com, it works.
2.When I manually(pasting this url to the browser) go to https://www.upwork.com/hire/angularjs-developers/, it works.
3.When protractor goes firstly to: https://www.upwork.com/ and then clicks the text "AngularJS Developers" in BROWSE TOP SKILLS section, it works.
4.But when protractor tries to go directly to https://www.upwork.com/hire/angularjs-developers/, by the method browser.get(url), it doesn't work and this message appears:
"Access to this web page is denied.
Please make sure your browser supports JavaScript and cookies and that you are not blocking them from loading. To learn more about how Upwork uses cookies please review our Cookie Policy."
I try to make the test independent, so I created 2 classes for tests. One testing HomePage and the second testing the HirePage. That is why I tried to open browser directly on https://www.upwork.com/hire/angularjs-developers/ to be able to test this site without having to open Home Page and clicking in "AngularJS Developers" text to go to the HirePage.
Cause when the first test won't pass, the second also won't pass and that means that they are dependent. What should I do then and how to resolve this?
Here is the code for HirePage Test:
const HirePage = require("../Pages/HirePage");
let hirePage;
const url = browser.params.HirePageURL;
const expectedHeadLine = browser.params.expectedHeadlineOnHirePage;
beforeAll(function () {
browser.get(url);
hirePage = new HirePage();
});
describe("Checks Hire page and filering the freelancers after filling
the data", function () {
it("Should have correct HeadLine", function () {
expect(hirePage.headlineUpperText()).toContain(expectedHeadLine);
});
});
Aucun commentaire:
Enregistrer un commentaire