本文整理汇总了C#中Browser.SelectList方法的典型用法代码示例。如果您正苦于以下问题:C# Browser.SelectList方法的具体用法?C# Browser.SelectList怎么用?C# Browser.SelectList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Browser
的用法示例。
在下文中一共展示了Browser.SelectList方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterUserOrderPaymentInfo
public void RegisterUserOrderPaymentInfo(Browser browser)
{
browser.WaitUntilContainsText("Step 4: Enter Payment Information");
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_user_firstname")).TypeText("christie");
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_user_lastname")).TypeText("Test");
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_user_addr")).TypeText("zhongshanbeiroad");
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_user_city")).TypeText("shanghai");
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_dl_user_state")).Option(Find.ByValue("AL")).Select();
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_user_zip")).TypeText("11111");
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ux_phone")).TypeText("1111111111");
//browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ux_phone")).DoubleClick();
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ux_phone")).Focus();
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_user_email")).TypeText("[email protected]");
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_order_description")).TypeText("ordertest"+Date);
browser.CheckBox(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_chbAgreement")).Checked = true;
browser.CheckBox(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_chb_contactinfo")).Checked = true;
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_dl_pay_year")).Option("2011").Select();
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_pay_account")).TypeText("4111111111111111");
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_pay_cid")).TypeText("111");
browser.Link(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_BottomBtNext")).Click();
browser.WaitUntilContainsText("Your Order Is Complete");
Assert.IsTrue(browser.ContainsText("Your Order Is Complete"));
}
示例2: TestUserspecialtylists
public void TestUserspecialtylists(Browser browser)
{
browser.WaitUntilContainsText("Please complete the short form below and a Data Specialist will follow up with you");
Assert.IsTrue(browser.ContainsText("Please complete the short form below and a Data Specialist will follow up with you"));
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ux_fir_name")).TypeText("bobby");
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ux_last_name")).TypeText("wang");
//browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_user_addr")).TypeText("zhongshanbeiroad");
//browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_user_city")).TypeText("shanghai");
//browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_dl_user_state")).Option(Find.ByValue("AL")).Select();
//browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_txt_user_zip")).TypeText("11111");
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ux_phone")).TypeText("1111111111");
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ux_phone")).Focus();
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ux_email")).TypeText("[email protected]");
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_uxHowMany")).Option(Find.ByValue("1,001 - 5,000")).Select();
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_uxHowSoon")).Option(Find.ByValue("Immediately")).Select();
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_uxInterest")).Option(Find.ByValue("Ailments")).Select();
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_uxTarget")).TypeText("test");
browser.Image(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ImageButton1")).Click();
browser.WaitUntilContainsText("Thank you! We have received your request and we will follow up with you within the next business day");
Assert.IsTrue(browser.ContainsText("Thank you! We have received your request and we will follow up with you within the next business day"));
}
示例3: TestUserOrderSelectDemo4
public void TestUserOrderSelectDemo4(Browser browser)
{
browser.WaitUntilContainsText("Define Target Audience");
Assert.IsTrue(browser.ContainsText("Define Target Audience"));
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ltbDemVar")).Option(Find.ByValue("A")).Select();
browser.Link(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_btAddDem")).Click();
browser.Div(Find.ById("divWaiting")).WaitUntilRemoved();
browser.Div("ListbarProfiles").Table("ListbarProfiles_Group_0_group").TableRow("ListbarProfiles_Group_0_items").Div("ListbarProfiles_0_Item_0").WaitUntilExists(20);
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ltbDemVar")).Option(Find.ByValue("B")).Select();
browser.Link(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_btAddDem")).Click();
browser.Div(Find.ById("divWaiting")).WaitUntilRemoved();
browser.Div("ListbarProfiles").Table("ListbarProfiles_Group_0_group").TableRow("ListbarProfiles_Group_0_items").Div("ListbarProfiles_0_Item_1").WaitUntilExists(20);
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ltbDemVar")).Option(Find.ByValue("C")).Select();
browser.Link(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_btAddDem")).Click();
browser.Div(Find.ById("divWaiting")).WaitUntilRemoved();
browser.Div("ListbarProfiles").Table("ListbarProfiles_Group_0_group").TableRow("ListbarProfiles_Group_0_items").Div("ListbarProfiles_0_Item_2").WaitUntilExists(20);
browser.RadioButton(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_rb_phoneNothing")).Checked = true;
browser.Span(Find.ByText("Next")).Click();
}
示例4: TestUserOrderSelectGeoType
public void TestUserOrderSelectGeoType(Browser browser)
{
browser.WaitUntilContainsText("Step 1: Select Target Area(s) - Counties");
Assert.IsTrue(browser.ContainsText("Step 1: Select Target Area(s) - Counties"));
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_lbCounties")).Option(Find.ByValue("Autauga:AL:AL001:01001")).Select();
browser.Link(Find.ByClass("bt_add")).Click();
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_lbCounties")).Option(Find.ByValue("Baldwin:AL:AL003:01003")).Select();
browser.Link(Find.ByClass("bt_add")).Click();
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_lbCounties")).Option(Find.ByValue("Barbour:AL:AL005:01005")).Select();
browser.Link(Find.ByClass("bt_add")).Click();
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_lbCounties")).Option(Find.ByValue("Bibb:AL:AL007:01007")).Select();
browser.Link(Find.ByClass("bt_add")).Click();
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_lbCounties")).Option(Find.ByValue("Blount:AL:AL009:01009")).Select();
browser.Link(Find.ByClass("bt_add")).Click();
browser.Link(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_BottomBtNext")).Click();
}
示例5: TestUserOrderSelectCity
public void TestUserOrderSelectCity(Browser browser)
{
browser.WaitUntilContainsText("Step 1: Select Target Area(s) - Cities");
Assert.IsTrue(browser.ContainsText("Step 1: Select Target Area(s) - Cities"));
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_lstCities")).Option(Find.ByValue("Abbeville:AL")).Select();
browser.Link(Find.ByClass("bt_add")).Click();
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_lstCities")).Option(Find.ByValue("Abernant:AL")).Select();
browser.Link(Find.ByClass("bt_add")).Click();
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_lstCities")).Option(Find.ByValue("Adamsville:AL")).Select();
browser.Link(Find.ByClass("bt_add")).Click();
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_lstCities")).Option(Find.ByValue("Addison:AL")).Select();
browser.Link(Find.ByClass("bt_add")).Click();
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_lstCities")).Option(Find.ByValue("Adger:AL")).Select();
browser.Link(Find.ByClass("bt_add")).Click();
browser.Link(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_BottomBtNext")).Click();
}
示例6: TestUserOrderSelectDemo
public void TestUserOrderSelectDemo(Browser browser)
{
browser.WaitUntilContainsText("Define Target Audience");
Assert.IsTrue(browser.ContainsText("Define Target Audience"));
//browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ltbDemCat")).Option(Find.ByText("Estimated Income")).Select();
/* browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ltbDemCat")).Option(Find.ByValue("3$$alvionacxiom30_DateOfBirthU")).Select();
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_uxInputLower")).TypeText("012008");
browser.TextField(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_uxInputUpper")).TypeText("012009");
browser.Link(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_btAddDem")).Click();*/
//browser.Div(Find.ById("divWaiting")).WaitUntilRemoved();
// browser.Div("ListbarProfiles").Table("ListbarProfiles_Group_0_group").TableRow("ListbarProfiles_Group_0_items").Div("ListbarProfiles_0_Item_0").WaitUntilExists(20);
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ltbDemCat")).Option(Find.ByValue("0$$alvionacxiom30_AgeOfIndividual")).Select();
browser.Link(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_btAddDem")).Click();
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ltbDemVar")).Option(Find.ByValue("20")).Select();
browser.Link(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_btAddDem")).Click();
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ltbDemVar")).Option(Find.ByValue("22")).Select();
browser.Link(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_btAddDem")).Click();
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ltbDemVar")).Option(Find.ByValue("24")).Select();
browser.Link(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_btAddDem")).Click();
browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ltbDemVar")).Option(Find.ByValue("26")).Select();
browser.Link(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_btAddDem")).Click();
//browser.Div(Find.ById("divWaiting")).WaitUntilRemoved();
browser.Div("ListbarProfiles").Table("ListbarProfiles_Group_0_group").TableRow("ListbarProfiles_Group_0_items").Div("ListbarProfiles_0_Item_0").WaitUntilExists(20);
/* browser.SelectList(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_ltbDemCat")).Option(Find.ByValue("0$$alvionacxiom30_CreditCardUser")).Select();
browser.Link(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_btAddDem")).Click();
browser.Div(Find.ById("divWaiting")).WaitUntilRemoved();
browser.Div("ListbarProfiles").Table("ListbarProfiles_Group_1_group").TableRow("ListbarProfiles_Group_1_items").Div("ListbarProfiles_1_Item_0").WaitUntilExists(20);*/
// browser.Div("ListbarProfiles").Table("ListbarProfiles_Group_2_group").TableRow("ListbarProfiles_Group_2_items").Div("ListbarProfiles_2_Item_0").WaitUntilExists(20);
browser.RadioButton(Find.ById("ctl00_ctl00_uxContent_ContentPlaceHolder1_rb_phoneNothing")).Checked = true;
browser.Span(Find.ByText("Next")).Click();
}
示例7: NewContact
/// <summary>
/// Method Creates a New User on the Admin -> New User page.
/// Will Save if save == true else will flash the Save button.
/// Contact Info is stored in Contacts XML. Method requires GMSAddContact.xml be created.
/// </summary>
/// <param name="browser">WatiN Browser Object</param>
/// <param name="configpath">Path to Config File GMSAddContact.xml</param>
/// <param name="save">Save Value true will save false will cancel</param>
public void NewContact(Browser browser, string configpath, bool save)
{
//TODO: Possibly streamline this method
#region XMLDoc
XmlDocument admindoc = new XmlDocument();
admindoc.Load(configpath);
XmlNodeList xl = admindoc.SelectNodes("//GMSAddContact/contact");
#endregion
foreach (XmlNode xn in xl)
{
string companynumber = xn["conum"].InnerText;
string scac = xn["scac"].InnerText;
string name = xn["name"].InnerText;
string efrom = xn["effectivefrom"].InnerText;
string eto = xn["effectiveto"].InnerText;
string addy1 = xn["addy1"].InnerText;
string addy2 = xn["addy2"].InnerText;
string addy3 = xn["addy3"].InnerText;
string addy4 = xn["addy4"].InnerText;
string city = xn["city"].InnerText;
string state = xn["state"].InnerText;
string zip = xn["zip"].InnerText;
string fname = xn["fname"].InnerText;
string lname = xn["lname"].InnerText;
string title = xn["title"].InnerText;
string phone = xn["phone"].InnerText;
string fax = xn["fax"].InnerText;
string email = xn["email"].InnerText;
string invoiceformat = xn["invoiceformat"].InnerText;
string invoicedelivery = xn["invoicedelivery"].InnerText;
string railinc = xn["railinc"].InnerText;
string includebr = xn["includebr"].InnerText;
string gbentity = xn["gbentity"].InnerText;
string additionalscac = xn["additionalscac"].InnerText;
browser.Button(Find.ById(new Regex("ctl00_MainContent_NewButton"))).Click();
browser.WaitUntilContainsText("Effective From");
// Company Info
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_CompanyCodeCtl"))).SetAttributeValue("value", companynumber);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_ScacCtl"))).SetAttributeValue("value", scac);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_NameCtl"))).SetAttributeValue("value", name);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_EffectiveFromCtl"))).TypeText(efrom);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_EffectiveThruCtl"))).TypeText(eto);
// Address Info
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_Address1Ctl"))).SetAttributeValue("value", addy1);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_Address2Ctl"))).SetAttributeValue("value", addy2);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_Address3Ctl"))).SetAttributeValue("value", addy3);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_Address4Ctl"))).SetAttributeValue("value", addy4);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_CityCtl"))).SetAttributeValue("value", city);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_StateCtl"))).SetAttributeValue("value", state);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_ZipCtl"))).SetAttributeValue("value", zip);
// Detail Info
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_FirstNameCtl"))).SetAttributeValue("value", fname);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_LastNameCtl"))).SetAttributeValue("value", lname);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_TitleCtl"))).SetAttributeValue("value", title);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_PhoneCtl"))).SetAttributeValue("value", phone);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_FaxCtl"))).SetAttributeValue("value", fax);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_EmailCtl"))).SetAttributeValue("value", email);
// Artifacts
browser.SelectList(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_InvoiceFormatCtl"))).Select(invoiceformat);
browser.SelectList(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_InvoiceDeliveryCtl"))).Select(invoicedelivery);
if (railinc.Equals("Y"))
{
browser.CheckBox(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_RailincCtl"))).Checked = true;
}
if (includebr.Equals("Y"))
{
browser.CheckBox(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_IncludeBrcCtl"))).Checked = true;
}
if (gbentity.Equals("Y"))
{
browser.CheckBox(Find.ById(new Regex("ctl00_MainContent_ASPxRoundPanel1_GBEntityCtl"))).Checked = true;
//.........这里部分代码省略.........
示例8: EditDetails
/// <summary>
/// Method Edits the Details of an Added Edit
/// </summary>
/// <param name="browser">WatiN Browser Object</param>
/// <param name="name"></param>
/// <param name="level"></param>
/// <param name="efrom"></param>
/// <param name="eto"></param>
/// <param name="exception"></param>
/// <param name="errortype"></param>
/// <param name="recprob"></param>
/// <param name="source"></param>
/// <param name="errorlevel"></param>
public void EditDetails(Browser browser, string name, string level, string efrom, string eto, string exception, string errortype, string recprob, string source, string errorlevel)
{
browser.RadioButton(Find.ByLabelText(errorlevel)).Checked = true;
browser.TextField(Find.ById(new Regex("ctl00_MainContent_rpEditDetails_tBoxEditName"))).SetAttributeValue("value", name);
browser.SelectList(Find.ById(new Regex("ctl00_MainContent_rpEditDetails_ddlEditLevel"))).Select(level);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_rpEditDetails_deEffFrom_I"))).TypeText(efrom);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_rpEditDetails_deEffThru_I"))).TypeText(eto);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_rpEditDetails_ctrlException_rpException_tBoxException"))).SetAttributeValue("value", exception);
browser.SelectList(Find.ById(new Regex("ctl00_MainContent_rpEditDetails_ctrlException_rpException_ddlErrorType"))).SelectByValue(errortype);
browser.SelectList(Find.ById(new Regex("ctl00_MainContent_rpEditDetails_ctrlException_rpException_ddlProbability"))).Select(recprob);
browser.SelectList(Find.ById(new Regex("ctl00_MainContent_rpEditDetails_ctrlException_rpException_ddlSource"))).Select(source);
}
示例9: SearchExceptionReasons
/// <summary>
/// Method to search Admin Search Exception Reasons
/// </summary>
/// <param name="browser">WatiN Browser Object</param>
/// <param name="code">Code Value</param>
/// <param name="description">Description Value</param>
/// <param name="category">Category Value</param>
/// <param name="includeinactive">Include Inactive Value</param>
///
public void SearchExceptionReasons(Browser browser, string code, string description, string category, bool includeinactive)
{
browser.TextField(Find.ById(new Regex("ctl00_MainContent_SearchRoundPanel_ReasonCodeTextBox"))).SetAttributeValue("value", code);
browser.TextField(Find.ById(new Regex("ctl00_MainContent_SearchRoundPanel_DescriptionTextBox"))).SetAttributeValue("value", description);
browser.SelectList(Find.ById(new Regex("ctl00_MainContent_SearchRoundPanel_CategoryDropDownList"))).Select(category.Trim());
browser.CheckBox(Find.ById(new Regex("ctl00_MainContent_SearchRoundPanel_InactiveCheckBox"))).Checked = includeinactive;
browser.Button(Find.ById(new Regex("ctl00_MainContent_SearchRoundPanel_SearchButton"))).Click();
}
示例10: TestUsersales
public void TestUsersales(Browser browser,string bigsource,string littlesource,string size,string material,string made,string weight,string price,string date1,string date,string storehouse)
{
//#*****************************************************************************
//# Purpose: define User sales function.
//# Author: bobby
//# Last Modify: apr 13, 2009
//#*****************************************************************************
browser.Link(Find.ById("ctl00_linkTrade")).Click();
browser.WaitUntilContainsText("请在左边的菜单选择您要进行的操作。 如有疑问,请点击下面相关链接查看操作流程图或查看交易指南");
Assert.IsTrue(browser.ContainsText("请在左边的菜单选择您要进行的操作。 如有疑问,请点击下面相关链接查看操作流程图或查看交易指南"));
browser.Link(Find.ByText("我要销售")).Click();
browser.WaitUntilContainsText("请在左边的菜单选择您要进行的操作。 如有疑问,请点击下面相关链接查看操作流程图或查看交易指南");
Assert.IsTrue(browser.ContainsText("请在左边的菜单选择您要进行的操作。 如有疑问,请点击下面相关链接查看操作流程图或查看交易指南"));
browser.Link(Find.ByText("资源挂牌")).Click();
browser.WaitUntilContainsText("可选择以下两种上传方式");
Assert.IsTrue(browser.ContainsText("可选择以下两种上传方式"));
//清空失误
if (browser.Link(Find.ById("ctl00_ContentPlaceHolder1_GridView1_ctl02_edititem")).Exists)
{
WatiN.Core.DialogHandlers.ConfirmDialogHandler dh1 = new WatiN.Core.DialogHandlers.ConfirmDialogHandler();
browser.AddDialogHandler(dh1);
browser.Button(Find.ByValue("全部删除")).ClickNoWait();
dh1.WaitUntilExists(15);//
dh1.OKButton.Click();//
dh1.WaitUntilExists(15);
dh1.OKButton.Click();
browser.RemoveDialogHandler(dh1);
}
browser.Image(Find.ByAlt("在线上传")).Click();
browser.WaitUntilContainsText("提示:此处显示所选品种的规格填写规则,单位 为毫米");
Assert.IsTrue(browser.ContainsText("提示:此处显示所选品种的规格填写规则,单位 为毫米"));
//大品种
browser.SelectList(Find.ById("ctl00_ContentPlaceHolder1_cmbCategory")).Option(bigsource).Select();
browser.WaitUntilContainsText(bigsource);
Assert.IsTrue(browser.ContainsText(bigsource));
//小品种
browser.SelectList(Find.ById("ctl00_ContentPlaceHolder1_cmbProductName")).Option(littlesource).Select();
browser.WaitUntilContainsText(littlesource);
Assert.IsTrue(browser.ContainsText(littlesource));
//规格
browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_gg_h")).TypeText(size);
browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_gg_k")).TypeText(size);
browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_gg_c")).TypeText(size);
//材质
browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_cz")).TypeText(material + date1);
//厂家
browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_sccj")).TypeText(made + date1);
//重量
browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_weight")).TypeText(weight);
//价格
browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_price")).TypeText(price);
//日期
browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_manufacturedate")).TypeText(date);
//仓库
browser.SelectList(Find.ById("ctl00_ContentPlaceHolder1_cmblistck")).Option(storehouse).Select();
browser.WaitUntilContainsText(storehouse);
Assert.IsTrue(browser.ContainsText(storehouse));
//确定资源录入
browser.Button(Find.ById("ctl00_ContentPlaceHolder1_Button2")).Click();
//挂牌
browser.CheckBox(Find.ById("ctl00_ContentPlaceHolder1_GridView1_ctl02_gv_Chk")).Checked = true;
browser.WaitUntilContainsText("可选择以下两种上传方式");
Assert.IsTrue(browser.ContainsText("可选择以下两种上传方式"));
//第一次
WatiN.Core.DialogHandlers.ConfirmDialogHandler dh = new WatiN.Core.DialogHandlers.ConfirmDialogHandler();
browser.AddDialogHandler(dh);
browser.Button(Find.ByValue("全部挂")).ClickNoWait();
dh.WaitUntilExists(15);//
dh.OKButton.Click();//
dh.WaitUntilExists(15);
dh.OKButton.Click();
browser.RemoveDialogHandler(dh);
}
示例11: TestUserbargainingorder
public void TestUserbargainingorder(Browser browser, string url, string material, string date1, string number, string ordertype, string button)
{
//#*****************************************************************************
//# Purpose: define User placeorder function.
//# Author: bobby
//# Last Modify: apr 13, 2009
//#*****************************************************************************
browser.Link(Find.ById("ctl00_linkTrade")).Click();
browser.WaitUntilContainsText("请在左边的菜单选择您要进行的操作。 如有疑问,请点击下面相关链接查看操作流程图或查看交易指南");
Assert.IsTrue(browser.ContainsText("请在左边的菜单选择您要进行的操作。 如有疑问,请点击下面相关链接查看操作流程图或查看交易指南"));
browser.Link(Find.ByText("我要采购")).Click();
browser.WaitUntilContainsText("请在左边的菜单选择您要进行的操作。 如有疑问,请点击下面相关链接查看操作流程图或查看交易指南");
Assert.IsTrue(browser.ContainsText("请在左边的菜单选择您要进行的操作。 如有疑问,请点击下面相关链接查看操作流程图或查看交易指南"));
//采购
browser.Link(Find.ByUrl(url + "SearchProduct.aspx")).Click();
browser.WaitUntilContainsText("清空购物车");
Assert.IsTrue(browser.ContainsText("清空购物车"));
//查询资源
browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_txtSteel_Num")).TypeText(material + date1);
browser.Button(Find.ById("ctl00_ContentPlaceHolder1_btnSearch1")).Click();
//清空购物车
WatiN.Core.DialogHandlers.ConfirmDialogHandler dh2 = new WatiN.Core.DialogHandlers.ConfirmDialogHandler();
browser.AddDialogHandler(dh2);
browser.Link(Find.ById("ctl00_ContentPlaceHolder1_linkClearCart")).ClickNoWait();
dh2.WaitUntilExists(15);//
dh2.OKButton.Click();//
browser.RemoveDialogHandler(dh2);
Thread.Sleep(1500);
//点击该资源并购买
browser.Image(Find.ByAlt("buy product")).Click();
browser.TextField(Find.ByClass("cinput")).TypeText(number);
browser.WaitUntilContainsText(number);
Assert.IsTrue(browser.ContainsText(number));
browser.Button(Find.ByClass("addBuyCartBtn")).Click();
Thread.Sleep(1500);
//点击pop出来的确认对话框
WatiN.Core.DialogHandlers.ConfirmDialogHandler dh = new WatiN.Core.DialogHandlers.ConfirmDialogHandler();
browser.AddDialogHandler(dh);
browser.Link(Find.ById("ctl00_ContentPlaceHolder1_linkBuildOrders")).ClickNoWait();
dh.WaitUntilExists(15);//
dh.OKButton.Click();//
browser.RemoveDialogHandler(dh);
//自动分单
browser.WaitUntilContainsText("系统自动分单");
Assert.IsTrue(browser.ContainsText("系统自动分单"));
browser.SelectList(Find.ById("ctl00_ContentPlaceHolder1_dlPreviewList_ctl00_cmbPurcharseordertype")).Option(Find.ByText(ordertype)).Select();
//点击pop出来的确认对话框
WatiN.Core.DialogHandlers.ConfirmDialogHandler dh1 = new WatiN.Core.DialogHandlers.ConfirmDialogHandler();
browser.AddDialogHandler(dh1);
browser.Button(Find.ById("ctl00_ContentPlaceHolder1_btnBuld")).ClickNoWait();
dh1.WaitUntilExists(3);//
dh1.OKButton.Click();//
browser.RemoveDialogHandler(dh1);
//意向订单
browser.WaitUntilContainsText("选择需要的订单,生成意向订单");
Assert.IsTrue(browser.ContainsText("选择需要的订单,生成意向订单"));
browser.RadioButton(Find.ByName("radionSelect")).Checked = true;
//意向订单-->订单生效
//这个要参数化
browser.Button(Find.ById(button)).Click();
browser.TextField(Find.ById("ctl00_ContentPlaceHolder1_txtDiscount")).TypeText("10");
//WatiN.Core.DialogHandlers.AlertAndConfirmDialogHandler dh3 = new WatiN.Core.DialogHandlers.AlertAndConfirmDialogHandler();
//browser.AddDialogHandler(dh3);
browser.Button(Find.ById("ctl00_ContentPlaceHolder1_btnSubmit")).ClickNoWait();
//dh3.WaitUntilExists(3);//
//dh3.OKButton.Click();//
//browser.RemoveDialogHandler(dh3);
//Thread.Sleep(2000);
}
示例12: USPopulatePersonalInfoPage
private void USPopulatePersonalInfoPage(Browser browser)
{
var pi = new USPersonalInformationPage(browser);
pi.txtEAANumber = "1";
// Populate personal info page
pi.txtContactNameFirst = "First";
pi.txtContactNameMiddle = "Middle";
pi.txtContactNameLast = "Last";
pi.txtAddress1 = "Address1";
pi.txtZipCode = "54025";
pi.txtDaytimePhone = "9204370123";
pi.txtCellPhone = "2628930720";
pi.txtEveningPhone = "9204686577";
pi.txtCity = "City";
pi.txtEmailAddress = "[email protected]";
OptionCollection stateOptions = browser.SelectList("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xPersonalInformation_ddlState").Options;
stateOptions[3].Select();
}
示例13: USPopulateAircraftPage
private void USPopulateAircraftPage(Browser browser, string tag)
{
browser.TextField(Find.ById("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_txtAircraftFAANumber")).Value = tag;
browser.TextField(Find.ById("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_txtAircraftYear")).Value = tag;
browser.TextField(Find.ById("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_txtAircraftMake")).Value = tag;
browser.TextField(Find.ById("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_txtAircraftModel")).Value = tag;
browser.TextField(Find.ById("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_txtTotalSeats")).Value = tag;
browser.TextField(Find.ById("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_txtEngineMake")).Value = tag;
OptionCollection aircraftUse = browser.SelectList("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_ddlAircraftUse").Options;
aircraftUse[3].Select();
OptionCollection gearConfiguration = browser.SelectList("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_ddlGearConfiguration").Options;
gearConfiguration[3].Select();
OptionCollection hullCoverage = browser.SelectList("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_ddlHullCoverage").Options;
hullCoverage[3].Select();
browser.RadioButton(Find.ById("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_rbLimits_2")).Click();
browser.TextField(Find.ById("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_txtHullValue")).Value = tag;
OptionCollection medicalPayments = browser.SelectList("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_ddlMedicalPayments").Options;
medicalPayments[3].Select();
browser.RadioButton(Find.ById("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_cbxQuoteFor_1")).Click();
browser.TextField(Find.ById("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_txtAirportName")).Value = tag;
browser.TextField(Find.ById("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_txtHullValue")).Value = tag;
OptionCollection aircraftStatus = browser.SelectList("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_ddlAircraftStatus").Options;
aircraftStatus[3].Select();
browser.TextField(Find.ById("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_txtAirportCity")).Value = tag;
OptionCollection airportState = browser.SelectList("main_0_eaamain_0_eaacontent_0_acmain_1_Quote_xQuoteWizard_xAircraft_ddlAirportState").Options;
airportState[3].Select();
}