public static void Login(Manager mngr, Browser br, string strUname, string strPassword) { ObjLoginLanguage objlog = new ObjLoginLanguage(mngr); br.Actions.Click(objlog.loginLink); Thread.Sleep(5000); br.WaitUntilReady(); br.RefreshDomTree(); //Login br.Actions.SetText(objlog.username, strUname); br.Actions.SetText(objlog.password, strPassword); Thread.Sleep(5000); br.Actions.Click(objlog.loginbutton); //SuperIDlogin //br.Actions.SetText(objlog.loginUnameSuperID , strUname); //br.Actions.SetText(objlog.loginPasswordSuperID, strPassword); //br.Actions.Click(objlog.loginButtonSuperID); Thread.Sleep(5000); br.WaitUntilReady(); br.RefreshDomTree(); //Login Validation Thread.Sleep(10000); br.WaitUntilReady(); br.RefreshDomTree(); HtmlAnchor loginNotification = objlog.logoutlink.As <HtmlAnchor>(); Assert.AreEqual(loginNotification.IsEnabled, true, "LOGIN FAILED"); }
public void TestMethod_BlogDeveloper() { string _Url; string _Uname; string _Password; string _remember; string _Club; string _BlogTitle; string _BlogDescription; string _BlogTag; _Url = TestContext.DataRow["url"].ToString(); _Uname = TestContext.DataRow["Username"].ToString(); _Password = TestContext.DataRow["Password"].ToString(); _remember = TestContext.DataRow["Rememberme"].ToString(); _Club = "Developer"; _BlogTitle = TestContext.DataRow["Title"].ToString(); _BlogDescription = TestContext.DataRow["Description"].ToString(); _BlogTag = TestContext.DataRow["Tags"].ToString(); _BlogTitle = "Developer " + _BlogTitle; _BlogTitle = CommonFunctions.GenarateRandom(_BlogTitle); //Login to the system myManager.ActiveBrowser.NavigateTo(_Url); CommonFunctions.HandleSpashScreen(myManager, myManager.ActiveBrowser); myManager.ActiveBrowser.WaitUntilReady(); myManager.ActiveBrowser.RefreshDomTree(); CommonFunctions.Login(myManager, myManager.ActiveBrowser, _Uname, _Password); Thread.Sleep(7000); //Navigate to blogs string navigateURL; navigateURL = _Url + "/home-blogs/"; Thread.Sleep(5000); myManager.ActiveBrowser.WaitUntilReady(); myManager.ActiveBrowser.RefreshDomTree(); //AddNewBlog NewBlogCommon objNewBlog = new NewBlogCommon(); objNewBlog.CreateNewBlog(navigateURL, myManager.ActiveBrowser, myManager, _BlogTitle, _BlogDescription, _Club, _BlogTag); //Validate the blog in Activity stream CommonFunctions.ValideActivityStream(myManager, myManager.ActiveBrowser, _Url, _BlogTitle, _Club); //Validate the blog in blog page CommonFunctions.ValidateBlog(myManager, _BlogTitle); //Logout CommonFunctions.Logout(myManager, myManager.ActiveBrowser); ObjLoginLanguage login = new ObjLoginLanguage(myManager); login.loginLink.Wait.ForExists(5000); //myManager.Dispose(); }
public void TestMethod_BlogCustomer() { //Read the datasheet ReadData(); //Login to the system myManager.ActiveBrowser.NavigateTo(_Url); CommonFunctions.HandleSpashScreen(myManager, myManager.ActiveBrowser); myManager.ActiveBrowser.WaitUntilReady(); myManager.ActiveBrowser.RefreshDomTree(); CommonFunctions.Login(myManager, myManager.ActiveBrowser, _Uname, _Password); Thread.Sleep(7000); //Navigate to blogs string navigateURL; navigateURL = _Url + "/home-blogs/"; Thread.Sleep(5000); myManager.ActiveBrowser.WaitUntilReady(); myManager.ActiveBrowser.RefreshDomTree(); //AddNewBlog NewBlogCommon objNewBlog = new NewBlogCommon(); objNewBlog.CreateNewBlog(navigateURL, myManager.ActiveBrowser, myManager, _BlogTitle, _BlogDescription, _Club, _BlogTag); //Validate the blog in Activity stream CommonFunctions.ValideActivityStream(myManager, myManager.ActiveBrowser, _Url, _BlogTitle, _Club); //Validate the blog in blog page CommonFunctions.ValidateBlog(myManager, _BlogTitle); //addcomment objNewBlog.addcomment(myManager.ActiveBrowser, myManager, _BlogComment); //validate comment CommonFunctions.ActivityStreamCommentsValidator(myManager, myManager.ActiveBrowser, _Url, _BlogComment, _Club); //Logout CommonFunctions.Logout(myManager, myManager.ActiveBrowser); ObjLoginLanguage login = new ObjLoginLanguage(myManager); login.loginLink.Wait.ForExists(5000); //myManager.Dispose(); }
public static void Logout(Manager mngr, Browser br) { ObjLoginLanguage objlog = new ObjLoginLanguage(mngr); br.Actions.Click(objlog.logoutlink); }