You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
var page1,page2,utilityInit;
module.exports=function(){
this.Given(/^Open the browser and Load the URL$/,async function(){
await browser.get("https://facebook.com");
browser.logger.info("Title of the window is :"+await browser.getTitle());
//screenshots.takesScreenshot("filename");
});
//this function is for first browser instance and facebook pageobject accepts the browser instance as a parameter and based on parameter it will shift the browser instance
this.When(/^User entered the text in the search box$/,async function(){
browser.sleep(3000);
page1=new facebook(browser);
await page1.email().sendKeys(testData.Login.CM[0].Username);
browser.sleep(3000);
await page1.password().sendKeys(testData.Login.CM[0].Password);
});
this.Then(/^User tried to open in new browser instance$/,async function(){
browser2=await newBrowser.openNewBrowser(browser);
utilityInit=new utility(browser2);
utilityInit.ignoreSync(browser2);
browser2.get("https://google.com");
page2=new facebook(browser2);
console.log(await browser2.getTitle()+" title");
browser2.sleep(5000);
});
this.When(/^User entered the text in the email field$/,async function(){
await browser2.page2.search().sendKeys("test");
browser2.sleep(3000);
})
}
##error log##
TypeError: Cannot read property 'search' of undefined
at World.(anonymous) (H:\workspace\Framework\src\test\java\com\learnFramework\TestCases\spec.js:34:24)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
##2.With out adding browser instance to the page objects##
this.When(/^User entered the text in the email field$/,async function(){
await page2.search().sendKeys("test");
browser2.sleep(3000);
})
##error log##
Error while waiting for Protractor to sync with the page: "both angularJS testability and angular testability are undefined. This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping. See http://git.io/v4gXM for details"
one time it is saying Undefine and one time it is saying angular not found related error.. if anyone faced this type of situation please help me in this.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
when i tried to use the page objects created with two browser instances, i'm getting two different errors for two different syntaxes.
1. With adding browser instance to the page object##
##PageObject file##
##error log##
##2.With out adding browser instance to the page objects##
##error log##
one time it is saying
Undefine
and one time it is sayingangular not found related error
.. if anyone faced this type of situation please help me in this.The text was updated successfully, but these errors were encountered: