本文整理匯總了C#中WatiN.Core.IE.Back方法的典型用法代碼示例。如果您正苦於以下問題:C# IE.Back方法的具體用法?C# IE.Back怎麽用?C# IE.Back使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WatiN.Core.IE
的用法示例。
在下文中一共展示了IE.Back方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: FirstimeLoginChangePassword
//.........這裏部分代碼省略.........
else
newpassword = "Account locked";
tdc.ExecuteCommand("update dbo.T_CybersourceGatewayMerchantConfig set Password='" + newpassword + "' where MerchantId = '" + merchantid + "'");
}
else
{
//newpassword = "NCOgateway09" ;
//browser.TextField(Find.ByName("password")).TypeText(password);
//browser.TextField(Find.ByName("newPassword")).TypeText(newpassword);
//browser.TextField(Find.ByName("newPasswordConfirm")).TypeText(newpassword);
//browser.Button(Find.ByValue("Submit")).Click();
//if (browser.ContainsText("Secret Profile Setup"))
//{
// if (!(browser.TextField(Find.ByName("answer")).Text.Length > 1))
// {
// browser.TextField(Find.ByName("answer")).TypeText("NCO");
// }
// browser.Button(Find.ByValue("Submit Request")).Click();
// string sql = "Update dbo.T_CybersourceGatewayTranDownloadTracking set NewPasswordSet= '" + newpassword + "' where CybersourceGatewayTranDownloadTracking_id=" + t.CybersourceGatewayTranDownloadTracking_id;
// tdc.ExecuteCommand(sql);
// tdc.ExecuteCommand("update dbo.T_CybersourceGatewayMerchantConfig set Password='" + newpassword + "' where MerchantId = '" + merchantid + "'");
//}
//else
//{
// browser.Back();
// newpassword = "NCOgateway10";
// browser.TextField(Find.ByName("password")).TypeText(password);
// browser.TextField(Find.ByName("newPassword")).TypeText(newpassword);
// browser.TextField(Find.ByName("newPasswordConfirm")).TypeText(newpassword);
// browser.Button(Find.ByValue("Submit")).Click();
// if (browser.ContainsText("Secret Profile Setup"))
// {
// if (!(browser.TextField(Find.ByName("answer")).Text.Length > 1))
// {
// browser.TextField(Find.ByName("answer")).TypeText("NCO");
// }
// browser.Button(Find.ByValue("Submit Request")).Click();
// string sql = "Update dbo.T_CybersourceGatewayTranDownloadTracking set NewPasswordSet= '" + newpassword + "' where CybersourceGatewayTranDownloadTracking_id=" + t.CybersourceGatewayTranDownloadTracking_id;
// tdc.ExecuteCommand(sql);
// tdc.ExecuteCommand("update dbo.T_CybersourceGatewayMerchantConfig set Password='" + newpassword + "' where MerchantId = '" + merchantid + "'");
// }
// else
// {
//browser.Back();
for (int i = 12; i <= 30; i++)
{
newpassword = "NCOgateway" + i.ToString();
browser.TextField(Find.ByName("password")).TypeText(password);
browser.TextField(Find.ByName("newPassword")).TypeText(newpassword);
browser.TextField(Find.ByName("newPasswordConfirm")).TypeText(newpassword);
browser.Button(Find.ByValue("Submit")).Click();
if (browser.ContainsText("Secret Profile Setup"))
{
if (!(browser.TextField(Find.ByName("answer")).Text.Length > 1))
{
browser.TextField(Find.ByName("answer")).TypeText("NCO");
}
browser.Button(Find.ByValue("Submit Request")).Click();
string sql = "Update dbo.T_CybersourceGatewayTranDownloadTracking set NewPasswordSet= '" + newpassword + "' where CybersourceGatewayTranDownloadTracking_id=" + t.CybersourceGatewayTranDownloadTracking_id;
tdc.ExecuteCommand(sql);
tdc.ExecuteCommand("update dbo.T_CybersourceGatewayMerchantConfig set Password='" + newpassword + "' where MerchantId = '" + merchantid + "'");
break;
}
else if (browser.ContainsText("Your new password cannot be a previously used password."))
{
browser.Back();
}
else if (browser.ContainsText("You cannot change your password more than three times in 24 hours"))
{
browser.Back();
browser.Back();
break;
}
//}
//}
}
}
}
}
}
示例2: PasswordChange
private static void PasswordChange()
{
bool nextstage = false;
var passwordchangeusersnames = (from u in tdc.CybersourceGatewayTranDownloadTrackings
where u.ReportDate.Equals(DateTime.Parse(reportDate)) && u.isDownLoadSuccess.Value.Equals(false) && u.NewPasswordSet.Equals(null)
select u);
foreach (CybersourceGatewayTranDownloadTracking t in passwordchangeusersnames)
{
string merchantid = t.MerchantId ;
string username = t.UserName;
string password="NCOgateway09";
string organizationId = t.UserName;
string newpassword="";
List<string> validmessage = new List<string>();
validmessage.Add("Welcome to the CyberSource Business Center");
validmessage.Add("The specified user name has been locked.");
using (var browser = new IE("https://ebc.cybersource.com/ebc/login/Login.do#"))
{
browser.Link(Find.ByText("change")).Click();
browser.TextField(Find.ByName("organizationId")).TypeText(organizationId);
browser.TextField(Find.ByName("username")).TypeText(username);
browser.TextField(Find.ByName("password")).TypeText(password);
browser.Button(Find.ByValue("Login")).Click();
if (browser.ContainsText(validmessage[0]) || browser.ContainsText(validmessage[1]) )
{
if (browser.ContainsText(validmessage[0]))
{ newpassword = password; }
else if (browser.ContainsText(validmessage[1]))
{ newpassword = "Account locked"; }
tdc.ExecuteCommand("update dbo.T_CybersourceGatewayTranDownloadTracking set NewPasswordSet='" + newpassword + "' where MerchantId = '" + merchantid + "'");
tdc.ExecuteCommand("update dbo.T_CybersourceGatewayMerchantConfig set Password='" + password + "' where MerchantId = '" + merchantid + "'");
}
else if (browser.ContainsText("Secret Profile Setup"))
{
if (!(browser.TextField(Find.ByName("answer")).Text.Length > 1))
{
browser.TextField(Find.ByName("answer")).TypeText("NCO");
}
browser.Button(Find.ByValue("Submit Request")).Click();
string sql = "Update dbo.T_CybersourceGatewayTranDownloadTracking set NewPasswordSet= '" + newpassword + "' where CybersourceGatewayTranDownloadTracking_id=" + t.CybersourceGatewayTranDownloadTracking_id;
tdc.ExecuteCommand(sql);
tdc.ExecuteCommand("update dbo.T_CybersourceGatewayMerchantConfig set Password='" + newpassword + "' where MerchantId = '" + merchantid + "'");
}
else
{
browser.Back();
password = "NCOgateway10";
browser.Link(Find.ByText("change")).Click();
browser.TextField(Find.ByName("organizationId")).TypeText(organizationId);
browser.TextField(Find.ByName("username")).TypeText(username);
browser.TextField(Find.ByName("password")).TypeText(password);
browser.Button(Find.ByValue("Login")).Click();
if (browser.ContainsText(validmessage[0]) || browser.ContainsText(validmessage[1]))
{
if (browser.ContainsText(validmessage[0]))
{ newpassword = password; }
else if (browser.ContainsText(validmessage[1]))
{ newpassword = "Account locked"; }
tdc.ExecuteCommand("update dbo.T_CybersourceGatewayTranDownloadTracking set NewPasswordSet='" + newpassword + "' where MerchantId = '" + merchantid + "'");
tdc.ExecuteCommand("update dbo.T_CybersourceGatewayMerchantConfig set Password='" + password + "' where MerchantId = '" + merchantid + "'");
}
else if (browser.ContainsText("Secret Profile Setup"))
{
if (!(browser.TextField(Find.ByName("answer")).Text.Length > 1))
{
browser.TextField(Find.ByName("answer")).TypeText("NCO");
}
browser.Button(Find.ByValue("Submit Request")).Click();
string sql = "Update dbo.T_CybersourceGatewayTranDownloadTracking set NewPasswordSet= '" + newpassword + "' where CybersourceGatewayTranDownloadTracking_id=" + t.CybersourceGatewayTranDownloadTracking_id;
tdc.ExecuteCommand(sql);
tdc.ExecuteCommand("update dbo.T_CybersourceGatewayMerchantConfig set Password='" + newpassword + "' where MerchantId = '" + merchantid + "'");
}
else
{
nextstage = step1_RequestForgottenPassword(organizationId, username);
if (nextstage)
nextstage = step2_RecoverPassword(organizationId, username, ref password);
string sql = "Update dbo.T_CybersourceGatewayTranDownloadTracking set NewPasswordSet= '" + password + "' where CybersourceGatewayTranDownloadTracking_id=" + t.CybersourceGatewayTranDownloadTracking_id;
tdc.ExecuteCommand(sql);
tdc.ExecuteCommand("update dbo.T_CybersourceGatewayMerchantConfig set Password='" + newpassword + "' where MerchantId = '" + merchantid + "'");
//.........這裏部分代碼省略.........
示例3: Navigating
public void Navigating()
{
using (var browser =
new IE())
{
browser.AutoClose = false;
browser.ShowWindow(NativeMethods.WindowShowStyle.Minimize);
browser.ShowWindow(NativeMethods.WindowShowStyle.Maximize);
browser.GoTo("http://www.bing.com");
browser.GoTo("http://www.pluralsight.com");
browser.Back();
browser.Forward();
}
}