public void LowBloodPressureTextValidation() { using (IWebDriver driver = new PhantomJSDriver()) { driver.Navigate().GoToUrl(webAppUri); IWebElement systolicElement = driver.FindElement(By.Id("BP_Systolic")); clearTextBox(systolicElement); systolicElement.SendKeys("70"); systolicElement.SendKeys(Keys.Tab); IWebElement diastolicElement = driver.FindElement(By.Id("BP_Diastolic")); clearTextBox(diastolicElement); diastolicElement.SendKeys("52"); diastolicElement.SendKeys(Keys.Tab); IWebElement bodyText = driver.FindElement(By.TagName("body")); System.Diagnostics.Debug.WriteLine(bodyText.Text); StringAssert.Contains(bodyText.Text, "Low Blood Pressure"); driver.Quit(); } }
/// <summary> /// Starting point for the application. /// </summary> /// <param name="args"> The arguments passed in from the console. </param> public static void Main(string[] args) { PhantomJSDriverService service = PhantomJSDriverService.CreateDefaultService(); service.IgnoreSslErrors = true; service.LoadImages = false; Console.WriteLine("gebruikersnaam"); string gebruikersnaam = Console.ReadLine(); Console.WriteLine("wachtwoord"); string wachtwoord = Console.ReadLine(); IWebDriver driver = new PhantomJSDriver(service); driver.Navigate().GoToUrl("https://mijn.ing.nl/internetbankieren/SesamLoginServlet"); IWebElement gebruikersnaamElem = driver.FindElement(By.XPath("//div[@id='gebruikersnaam']/descendant::input")); gebruikersnaamElem.SendKeys(gebruikersnaam); IWebElement wachtwoordElem = driver.FindElement(By.XPath("//div[@id='wachtwoord']/descendant::input")); wachtwoordElem.SendKeys(wachtwoord); IWebElement button = driver.FindElement(By.CssSelector("button.submit")); button.Click(); ((ITakesScreenshot)driver).GetScreenshot().SaveAsFile("ing.png", ImageFormat.Png); System.IO.File.WriteAllText("ing.html", driver.PageSource); driver.Quit(); Console.WriteLine("We are done"); Console.ReadKey(); }
static public void getItems(ref TimeStamp cTimestep) { var service = PhantomJSDriverService.CreateDefaultService(); var phantomJSDriverService = PhantomJSDriverService.CreateDefaultService(@"C:\phantomjs-2.1.1-windows\bin"); using (PhantomJSDriver driver = new PhantomJSDriver(phantomJSDriverService)) { driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10); driver.Url = @"http://www.finanzen.net/anleihen/" + cTimestep.link; driver.Navigate(); //Console.WriteLine(driver.PageSource); try { IWebElement element = driver.FindElement(By.ClassName("col-xs-5")); cTimestep.lastprice = Convert.ToDouble(element.Text.Replace(",", ".").Replace("-", "0").Replace("%", null).Replace("±", null)); element = driver.FindElement(By.ClassName("col-xs-4")); cTimestep.change = Convert.ToDouble(element.Text.Replace(",", String.Empty).Replace("-", "0").Replace("+", null).Replace("±", null)); element = driver.FindElement(By.ClassName("col-xs-3")); cTimestep.pctChange = Convert.ToDouble(element.Text.Replace(",", ".").Replace("-", "0").Replace("%", null).Replace("+", null).Replace("±", null)); cTimestep.high = cTimestep.lastprice; cTimestep.low = cTimestep.lastprice; cTimestep.timestamp = DateTime.Now; } catch (Exception e) { throw new Exception("Problem getting the input" + e + " \n WITH" + cTimestep.id); } } }
protected void Click(string path, string pathType) { if (pathType == "id") { IWebElement element = driver.FindElement(By.Id(path)); element.Click(); TestCase.Log("Clicked element with id=" + path); } else if (pathType == "name") { IWebElement element = driver.FindElement(By.Name(path)); element.Click(); TestCase.Log("Clicked element with name=" + path); } else if (pathType == "class") { IWebElement element = driver.FindElement(By.ClassName(path)); element.Click(); TestCase.Log("Clicked element with class=" + path); } else if (pathType == "xpath") { IWebElement element = driver.FindElement(By.XPath(path)); element.Click(); TestCase.Log("Clicked element with xpath=" + path); } }
public void HighBloodPressureImageValidation() { using (IWebDriver driver = new PhantomJSDriver()) { driver.Navigate().GoToUrl(webAppUri); System.Diagnostics.Debug.WriteLine(driver.PageSource); IWebElement diastolicElement = driver.FindElement(By.Id("BP_Diastolic")); clearTextBox(diastolicElement); diastolicElement.SendKeys("90"); diastolicElement.SendKeys(Keys.Tab); IWebElement bodyText = driver.FindElement(By.TagName("body")); System.Diagnostics.Debug.WriteLine(bodyText.Text); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(3)); IWebElement ambulance = driver.FindElement(By.Id("ambulanceImage")); Assert.IsNotNull(ambulance); driver.Quit(); } }
public bool ConnectionTest(string login, string password) { var service = PhantomJSDriverService.CreateDefaultService(); service.IgnoreSslErrors = true; service.LoadImages = false; service.ProxyType = "none"; service.SslProtocol = "any"; var options = new PhantomJSOptions(); options.AddAdditionalCapability("phantomjs.page.settings.userAgent", _phantomJsUserAgent); var phantomCheckConnection = new PhantomJSDriver(service, options); phantomCheckConnection.Navigate().GoToUrl($"{BaseUrl}/accounts/login"); phantomCheckConnection.FindElement(By.Id("input_login_email")).SendKeys(login); phantomCheckConnection.FindElement(By.Id("input_login_password")).SendKeys(password); phantomCheckConnection.FindElement(By.Id("signin_submit")).Click(); Func <IWebDriver, bool> del = ExpectedConditions.UrlContains($"{BaseUrl}/app/"); var result = del.Invoke(phantomCheckConnection); phantomCheckConnection.Quit(); return(result); }
static void Main(string[] args) { var url = "https://passport.cnblogs.com/user/signin"; var driver1 = new PhantomJSDriver(GetPhantomJSDriverService()); driver1.Navigate().GoToUrl(url); if (driver1.Title == "用户登录 - 博客园") { driver1.FindElement(By.Id("input1")).SendKeys("xielongbao"); driver1.FindElement(By.Id("input2")).SendKeys("1234"); driver1.FindElement(By.Id("signin")).Click(); } driver1.GetScreenshot().SaveAsFile(@"C:\aa.png", ScreenshotImageFormat.Png); var o = driver1.ExecuteScript("$('#signin').val('dsa')"); Console.WriteLine(driver1.PageSource); driver1.Navigate().GoToUrl(url); Console.WriteLine(driver1.PageSource); IWebDriver driver2 = new PhantomJSDriver(GetPhantomJSDriverService()); driver2.Navigate().GoToUrl("https://home.cnblogs.com/"); Console.WriteLine(driver2.PageSource); Console.WriteLine(driver1.PageSource); Console.Read(); }
/// <summary> /// 解析文件所含的全部资源 /// </summary> /// <param name="url"></param> public string SaveFromExtraFile(string url, Guid taskId) { using (var driver = new PhantomJSDriver(GetPhantomJSDriverService())) { $"正在加载地址:{url}...".Log(true); driver.Navigate().GoToUrl(url); //最大化窗口 MaxBrowser(driver); "正在调整浏览器窗体大小...".Log(true); //第1次加载更多 //用户的分享超过一屏时 IWebElement moreShare = null; try { moreShare = driver.FindElement(By.LinkText("更多")); } catch { "该用户可分享的内容少于一屏,跳过流程解析...".Log(true); } if (moreShare != null) { "正在点击页面的“更多”按钮...".Log(true); driver.FindElement(By.LinkText("更多")).Click(); System.Threading.Thread.Sleep(2000); "正在加载第二页内容...".Log(true); "第二页内容加载完成...".Log(true); //获取需要滚动加载的次数 "正在计算全部需要加载的页数...".Log(true); var cardCount = int.Parse(driver.FindElements(By.CssSelector("._fd86t")).First().Text.Replace(",", "")); var scrollCount = cardCount / 12 == 0 ? cardCount / 12 : (cardCount / 12) + 1; $"计算完成,全部需要加载{scrollCount}页...".Log(true); //默认滚动条移动到y轴3000的位置 var initialC = 3000; var i = 0; "开始执行脚本,滚动鼠标...".Log(true); do { //if (i > 20)//预设只滚动20次,太多次容易卡顿 // break; $"第{i + 1}次滚动...".Log(true); ((IJavaScriptExecutor)driver).ExecuteScript($"scrollTo(0,{initialC});"); System.Threading.Thread.Sleep(1000 + (i * 50)); i++; initialC += 500;//每次递增滚动500的距离 } while (i < scrollCount); } "页面所有内容全部加载完成...".Log(true); var insDir = url.Substring(url.LastIndexOf('/') + 1); "正在解析下载的资源...".Log(true); ExtraDownloadSource(driver.PageSource, taskId); driver.Quit(); return(insDir); } }
public IWebElement FindElementWithChecking(By by) { if (!Canceled) { return(_driver.FindElement(@by)); } _logger.Info( "Interrupted by Canceled flag. throw new WebDriverException"); throw new WebDriverException(); }
void crawl(string number) { var driverService = PhantomJSDriverService.CreateDefaultService(Environment.CurrentDirectory); driverService.HideCommandPromptWindow = true; IWebDriver driver = new PhantomJSDriver(driverService); driver.Navigate().GoToUrl("https://www.truecaller.com/"); try { // ((ITakesScreenshot)driver).GetScreenshot().SaveAsFile(@"E:\Haider\Haider\Beautiful Soup\img1.jpg", ScreenshotImageFormat.Jpeg); var set = driver.FindElement(By.ClassName("searchbar__query")); set.SendKeys("+" + number); var button = driver.FindElement(By.ClassName("searchbar__submit")); string js = "arguments[0].click();"; ((IJavaScriptExecutor)driver).ExecuteScript(js, button); Thread.Sleep(10); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10); string name = ""; string other_details = ""; Loboloba.Text = ""; foreach (var element in driver.FindElements(By.CssSelector("div.profile-name"))) { Loboloba.Text += name = element.Text + Environment.NewLine; } foreach (var element in driver.FindElements(By.CssSelector("div.profile-details-text"))) { Loboloba.Text += other_details = element.Text + Environment.NewLine; } } catch (Exception e) { MessageBox.Show(e.Message); } finally { driver.Close(); driver.Quit(); } }
protected void Page_Load(object sender, EventArgs e) { //var webClient = new WebClient(); //var form = new BasicHtmlForm(webClient); //form.Load(new Uri("http://www.weather.gov/"), new KeyValuePair<string, string>("name", "getForecast")); //form.InputControls.Single(c => c.Name == "inputstring").Value = "fairbanks, ak"; //using (var response = form.Submit()) //{ // if (response.ResponseType == WebResponseType.Html) // { // var scraper = new TestScraper(((HtmlWebResponse)response).Html); // var conditions = scraper.GetConditions(); // var temperature = scraper.GetTemperature(); // System.Diagnostics.Debug.WriteLine(conditions); // Weather.InnerText = temperature; // var scraper2 = new TestScraper2(((HtmlWebResponse)response).Html); // var craigslist = scraper2.GetList(); // } //} var webClient1 = new WebClient(); var form1 = new BasicHtmlForm(webClient1); form1.Load(new Uri("https://www.trulia.com/rent/"), new KeyValuePair <string, string>("data-reactid", "29")); form1.InputControls.Single(c => c.Name == "location-autocomplete").Value = "Frisco, TX"; using (var response = form1.Submit()) { if (response.ResponseType == WebResponseType.Html) { var scraper2 = new TestScraper2(((HtmlWebResponse)response).Html); // var craigslist = scraper2.GetList(); // Weather.InnerText = craigslist; } } IWebDriver driver = new PhantomJSDriver(); driver.Navigate().GoToUrl("https://twitter.com/Twitter"); var backpack = driver.Title; var back = driver.FindElement(By.XPath("//*[@class='u-linkComplex-target']")); var backpack2 = driver.FindElement(By.XPath("//*[contains(@class,'twitter-timeline-link')]/span[2]")); }
void sign_out() { var driverService = PhantomJSDriverService.CreateDefaultService(Environment.CurrentDirectory); driverService.HideCommandPromptWindow = true; IWebDriver driver = new PhantomJSDriver(driverService); driver.Navigate().GoToUrl("https://www.truecaller.com/"); try { var div = driver.FindElement(By.TagName("div")).FindElement(By.XPath("//*[contains(text(), 'Sign out')]")); string js = "arguments[0].click();"; ((IJavaScriptExecutor)driver).ExecuteScript(js, div); Thread.Sleep(10); MessageBox.Show("Signed Out Successfully"); lbl_Check.Text = "Signed Out"; btn_Sign_IN.Enabled = true; btn_Sign_OUT.Enabled = false; } catch (Exception e) { MessageBox.Show("You Need to Signed in, In order to get Signed Out"); MessageBox.Show(e.Message); } finally { driver.Close(); driver.Quit(); } }
public static Dictionary <string, double> ExecuteAndRead(string html, IEnumerable <string> elementNames) { var path = Path.Combine(Default.RangerFolder, fileName); // ToDo: Find a way to do this without writing to a file. File.WriteAllText(path, html); var service = PhantomJSDriverService.CreateDefaultService(Default.RangerFolder); service.HideCommandPromptWindow = true; var driver = new PhantomJSDriver(service); var filePath = Path.Combine("file:///", path); var url = new Uri(path); driver.Navigate().GoToUrl(url); var values = new Dictionary <string, double>(); foreach (var elementName in elementNames) { var element = driver.FindElement(By.Id(elementName)); var value = double.Parse(element.Text); values.Add(elementName, value); } driver.Quit(); File.Delete(path); return(values); }
static void Main(string[] args) { // web parser //BrowserDemo.OpenHtmlUnitDriver(); // BrowserDemo.OpenPhantomJs(); //TrackingDemo.TrackWithoutBrowser(); //TrackingDemo.TrackWithChrome(); // start http server //using (var server = new HttpServer("http://*****:*****@" <!DOCTYPE html><!--29175c33-bb68-31a4-a326-3fc888d22e35_v33--><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><style id="DS3Style" type="text/css">@media only screen and (max-width: 620px) {body[yahoo] .device-width { width: 450px !important}body[yahoo] .threeColumns { width: 140px !important}body[yahoo] .threeColumnsTd { padding: 10px 4px !important}body[yahoo] .fourColumns { width: 225px !important}body[yahoo] .fourColumnsLast { width: 225px !important}body[yahoo] .fourColumnsTd { padding: 10px 0px !important}body[yahoo] .fourColumnsPad { padding: 0 0 0 0 !important}body[yahoo] .secondary-product-image { width: 200px !important; height: 200px !important}body[yahoo] .center { text-align: center !important}body[yahoo] .twoColumnForty { width: 200px !importantheight: 200px !important}body[yahoo] .twoColumnForty img { width: 200px !important; height: 200px !important}body[yahoo] .twoColumnSixty { width: 228px !important}body[yahoo] .secondary-subhead-right { display: none !important}body[yahoo] .secondary-subhead-left { width: 450px !important}}@media only screen and (max-width: 479px) {body[yahoo] .navigation { display: none !important}body[yahoo] .device-width { width: 300px !important; padding: 0}body[yahoo] .threeColumns { width: 150px !important}body[yahoo] .fourColumns { width: 150px !important}body[yahoo] .fourColumnsLast { width: 150px !important}body[yahoo] .fourColumnsTd { padding: 10px 0px !important}body[yahoo] .fourColumnsPad { padding: 0 0 0 0 !important}body[yahoo] .secondary-product-image { width: 240px !important; height: 240px !important}body[yahoo] .single-product-table { float: none !important;margin-bottom: 10px !important;margin-right: auto !important;margin-left: auto !important;}body[yahoo] .single-product-pad { padding: 0 0 0 0 !important;}body[yahoo] .single-product-image {align:center;width: 200px !important;height: 200px !important}body[yahoo] .mobile-full-width { width: 300px !important}body[yahoo] .twoColumnForty {align:center; !importantwidth: 200px !important}body[yahoo] .twoColumnForty img {}body[yahoo] .twoColumnSixty {padding-left: 0px !important;width: 300px !important}body[yahoo] .secondary-subhead-left { width: 300px !important}body[yahoo] .ThreeColumnItemTable{ padding: 0px 0px 0px 74px !important}body[yahoo] .FourColumnFloater{float: right !important;}span.message-history{text-align: left !important;float: right !important;}}body[yahoo] .mobile-full-width { min-width: 103px;max-width: 300px;height: 38px;}body[yahoo] .mobile-full-width a { display: block;padding: 10px 0;}body[yahoo] .mobile-full-width td{ padding: 0px !important}td.wrapText{white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; }@-moz-document url-prefix() {td.wrapTextFF_Fix {display: inline-block}}body { width: 100% !important; -webkit-text-size-adjust: 100% !important; -ms-text-size-adjust: 100% !important; -webkit-font-smoothing: antialiased !important; margin: 0 !important; padding: 0 0 100px !important; font-family: Helvetica, Arial, sans-serif !important; background-color:#f9f9f9}.ReadMsgBody { width: 100% !important; background-color: #ffffff !important; }.ExternalClass { width: 100% !important; }.ExternalClass { line-height: 100% !important; }img { display: block; outline: none !important; text-decoration: none !important; -ms-interpolation-mode: bicubic !important; }td{word-wrap: break-word;}</style><!--[if gte mso 9]> <style>td.product-details-block{word-break:break-all}.threeColumns{width:140px !important}.threeColumnsTd{padding:10px 20px !important}.fourColumns{width:158px !important}.fourColumnsPad{padding: 0 18px 0 0 !important}.fourColumnsTd{padding:10px 0px !important}.twoColumnSixty{width:360px !important}table{mso-table-lspace:0pt; mso-table-rspace:0pt;}</style> <![endif]--></head><body yahoo="fix"><table id="area2Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9"><tr><td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><table width="600" class="device-width header-logo" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#f9f9f9" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 0; border: none;"><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 5px 0 10px 0; color: #333;" align="left">New message: Hi Kobo,As a buyer, I am interest...</p></td></tr></table></td></tr></table> <table id="area3Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse:collapse !important;border-spacing:0 !important;border:none;background-color:#f9f9f9;"><tr><td width="100%" valign="top" style="border-collapse:collapse !important;border-spacing:0 !important;border:none;"><table width="100%" height="7" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-image: url('http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png'); background-repeat: repeat-y no-repeat; margin: 0; padding: 0"><!--[if gte mso 9]><v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="mso-width-percent:1000;height:1px;"><v:fill type="tile" color="#dddddd" /></v:rect><v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="mso-width-percent:1000;height:6px;"><v:fill type="tile" src="http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png" color="#f9f9f9" /><div style="width:0px; height:0px; overflow:hidden; display:none; visibility:hidden; mso-hide:all;"><![endif]--><tr><td width="100%" height="1" valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #dddddd; font-size: 1px; line-height: 1px;"><!--[if gte mso 15]>&nbsp;<![endif]--></td></tr><tr><td width="100%" height="6" valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: none; font-size: 1px; line-height: 1px;">&nbsp;</td></tr><!--[if gte mso 9]></div></v:rect><![endif]--></table></td></tr></table> <table id="area4Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9"><tr><td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><table width="600" class="device-width header-logo" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 15px 0 20px; border: none;"><a href="http://rover.ebay.com/rover/0/e12050.m1831.l3127/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.com%2Flink%2F%3Fnav%3Dhome%26alt%3Dweb%26globalID%3DEBAY-ENCA%26referrer%3Dhttp%253A%252F%252Frover.ebay.com%252Frover%252F0%252Fe12050.m1831.l3127%252F7%253Feuid%253D68fe0bd048d04a84b6d8ef4046dde4cd%2526cp%253D1" style="text-decoration: none; color: #0654ba;"><img src="http://p.ebaystatic.com/aw/logos/header_ebay_logo_132x46.gif" width="132" height="46" border="0" alt="eBay" align="left" style="display: inline block; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; border: none;" /></a><img src="http://rover.ebay.com/roveropen/0/e12050/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd" alt="" style="border:0; height:1;"/></td></tr></table></td></tr></table> <table id="area5Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; background-color:#f9f9f9"> <tr> <td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <table id="PrimaryMessage" width="600" class="device-width" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#f9f9f9" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <tr><td valign="top" class="secondary-headline" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 20px 0 5px;"><h1 style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 15px; color: #808284; text-align: left; font-size: 13px; margin: 0 0 4px;" align="left">New message from:<a href="http://rover.ebay.com/rover/0/e12050.m44.l1181/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.com%2Flink%2F%3Fnav%3Duser.view%26user%3Dandfen6%26globalID%3DEBAY-ENCA%26referrer%3Dhttp%253A%252F%252Frover.ebay.com%252Frover%252F0%252Fe12050.m44.l1181%252F7%253Feuid%253D68fe0bd048d04a84b6d8ef4046dde4cd%2526cp%253D1" style="text-decoration: none; font-weight: bold; color: #336fb7;">andfen6</a><a href="http://rover.ebay.com/rover/0/e12050.m44.l1183/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Ffeedback.ebay.ca%2Fws%2FeBayISAPI.dll%3FViewFeedback%26userid%3Dandfen6%26ssPageName%3DSTRK%3AME%3AUFS" style="text-decoration: none; color: #888888;">(5)</a></h1></td></tr> <tr><td valign="top" class="viewing-problem-block" style="border-collapse: collapse !important; border-spacing: 0 !important; border-bottom-width: 1px; border-bottom-color: #f9f9f9; padding: 10px 0 30px; border-style: none none solid;"> <table width="600" class="device-width" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; border:0; cellpadding:0; cellspacing:0; align:center; bgcolor:#f9f9f9;"> <tr><td width="100%" class="wrapText device-width" valign="top" style="overflow: hidden; border-collapse: collapse !important; border-spacing: 0 !important; border: none; display: inline-block; max-width:600px;"><h3 style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 19px; color: #231f20; text-align: left; font-size: 14px; margin: 0 0 2px; font-weight:none;" align="left"><div id="UserInputtedText">Hi Kobo,<br /><br />As a buyer, I am interested....<br /><br />this is a test message</div></h3> <span style="color:#666666"></span> </td></tr> <tr><td valign="top" width="15" height="15" style="border-collapse: collapse !important; border-spacing: 20 !important; border: none;"></td></tr> <tr><td valign="top" class="cta-block" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 5px 0 5px; border: none;"><table align="left" cellpadding="0" cellspacing="0" border="0" class="mobile-full-width" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" class="center cta-button primary-cta-button" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; font-size: 14px; line-height: normal; font-weight: bold; box-shadow: 2px 3px 0 #e5e5e5; filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0079bc', endColorstr='#00519e',GradientType=0 ); background-image: linear-gradient(to bottom, #0079bc 0%,#00519e 100%); background-color: #0079bc; padding: 10px 17px; border: 1px solid #00519e;" bgcolor="#0079bc"><a href="http://rover.ebay.com/rover/0/e12050.m44.l1139/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fcontact.ebay.ca%2Fws%2FeBayISAPI.dll%3FM2MContact%26requested%3Dandfen6%26qid%3D1291497258010%26redirect%3D0" style="text-decoration: none; color: #ffffff; font-size: 14px; line-height: normal; font-weight: bold; font-family: Helvetica, Arial, sans-serif; text-shadow: 1px 1px 0 #00519e;"><span style="padding: 0px 10px">Reply</span></a></td></tr></table> </td></tr> </table></td></tr></table> <!--[if !mso]><!--><div id="V4PrimaryMessage" style="max-height: 0px; font-size: 0; overflow:hidden; display: none !important;"><div><table border="0" cellpadding="2" cellspacing="3" width="100%"><tr><td><font style="font-size:10pt; font-family:arial, sans-serif; color:#000"><strong>Dear rakutenkobo,</strong><br><br>Hi Kobo,<br /><br />As a buyer, I am interested....<br /><br />this is a test message<br><br></font><div style="font-weight:bold; font-size:10pt; font-family:arial, sans-serif; color:#000">- andfen6</div></td><td valign="top" width="185"><div></div></td></tr></table></div></div><!--<![endif]--> </td> </tr></table> <table id="area3Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9"> <tr> <td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><table width="100%" height="7" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-image: url(&#39;http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png&#39;); background-repeat: repeat-y no-repeat; margin: 0; padding: 0"> <tr><td width="100%" height="1" valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #dddddd;"></td></tr> <tr><td width="100%" height="6" valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: none;"></td></tr></table> </td> </tr> </table> <table id="area7Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9;"> <tr> <td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <table width="600" class="device-width" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#f9f9f9" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <tr><td valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; padding-right:20px;"><h1 style="font-family: Helvetica, Arial, sans-serif; font-weight: bold; line-height: 22px; color: #808284; text-align: left; font-size: 16px; text-align: left; margin-top: 0px; border-style: none none solid; border-bottom-color: #dddddd; border-bottom-width: 1px;" align="left">Get to know <a href="http://rover.ebay.com/rover/0/e12050.m3965.l1181/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.com%2Flink%2F%3Fnav%3Duser.view%26user%3Dandfen6%26globalID%3DEBAY-ENCA%26referrer%3Dhttp%253A%252F%252Frover.ebay.com%252Frover%252F0%252Fe12050.m3965.l1181%252F7%253Feuid%253D68fe0bd048d04a84b6d8ef4046dde4cd%2526cp%253D1" style="text-decoration: none; color: #336fb7;">andfen6</a> </h1><table style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 19px; text-align: left; font-size: 14px; margin-bottom: 10px; padding-bottom: 10px;" align="left"><tr><td valign="top" style="font-size: 20px; padding-left: 15px; padding-right: 5px;">&bull;</td><td style="padding-bottom: 5px">Located: Toronto, ON, Canada</td></tr><tr><td valign="top" style="font-size: 20px; padding-left: 15px; padding-right: 5px;">&bull;</td><td style="padding-bottom: 5px">Member since: Dec 17, 2015</td></tr><tr><td valign="top" style="font-size: 20px; padding-left: 15px; padding-right: 5px;">&bull;</td><td style="padding-bottom: 5px">Positive Feedback: 100%</td></tr></table></td></tr></table></td></tr></table> <table id="area10Container" class="whiteSection" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #ffffff"> <tr> <td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <table width="600" class="device-width" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" class="viewing-problem-block" style="border-collapse: collapse !important; border-spacing: 0 !important; border-bottom-width: 1px; border-bottom-color: #dddddd; padding: 40px 0 30px; border-style: none none solid;"><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="center">Only purchases on eBay are covered by the eBay purchase protection programs. Asking your trading partner to complete a transaction outside of eBay is not allowed.</p></td></tr></table> </td> </tr></table> <table id="area11Container" class="whiteSection" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #ffffff"><tr><td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <table width="600" class="device-width" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" class="ebay-footer-block" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 40px 0 60px; border: none;"> <div id="ReferenceId"><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="left"><strong>Email reference id: [#a05-c1pifaockd#]_[#68fe0bd048d04a84b6d8ef4046dde4cd#]</strong></p></div><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="left">We don't check this mailbox, so please don't reply to this message. If you have a question, go to <a style="text-decoration: none; color: #555555;" href="http://rover.ebay.com/rover/0/e12050.m1852.l6369/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Focsnext.ebay.ca%2Focs%2Fhome" target="_blank">Help & Contact</a>.</p> <p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="left">eBay sent this message to Nantha Gopalasamy (rakutenkobo). Learn more about <a style="text-decoration: none; color: #555555;" href="http://rover.ebay.com/rover/0/e12050.m1852.l3167/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Faccount%2Fprotecting-account.html" target="_blank">account protection</a>. eBay is committed to your privacy. Learn more about our <a style="text-decoration: none; color: #555555;" href="http://rover.ebay.com/rover/0/e12050.m1852.l3168/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Fpolicies%2Fprivacy-policy.html" target="_blank">privacy policy</a> and <a style="text-decoration: none; color: #555555;" href="http://rover.ebay.com/rover/0/e12050.m1852.l3165/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Fpolicies%2Fuser-agreement.html" target="_blank">user agreement</a>.</p><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="left">&copy;2016 eBay Inc., eBay International AG Helvetiastrasse 15/17 - P.O. Box 133, 3000 Bern 6, Switzerland</p></td></tr></table></td></tr></table></body></html>")) //{ // Thread thread = new Thread(server.Start); // thread.IsBackground = false; // thread.Start(); // Console.WriteLine("server started"); // using (var driver = new PhantomJSDriver()) // { // WebDriverWait driverWait = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); // driver.Manage().Window.Maximize(); // driver.Navigate().GoToUrl("http://*****:*****@" <!DOCTYPE html><!--29175c33-bb68-31a4-a326-3fc888d22e35_v33--><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><style id="DS3Style" type="text/css">@media only screen and (max-width: 620px) {body[yahoo] .device-width { width: 450px !important}body[yahoo] .threeColumns { width: 140px !important}body[yahoo] .threeColumnsTd { padding: 10px 4px !important}body[yahoo] .fourColumns { width: 225px !important}body[yahoo] .fourColumnsLast { width: 225px !important}body[yahoo] .fourColumnsTd { padding: 10px 0px !important}body[yahoo] .fourColumnsPad { padding: 0 0 0 0 !important}body[yahoo] .secondary-product-image { width: 200px !important; height: 200px !important}body[yahoo] .center { text-align: center !important}body[yahoo] .twoColumnForty { width: 200px !importantheight: 200px !important}body[yahoo] .twoColumnForty img { width: 200px !important; height: 200px !important}body[yahoo] .twoColumnSixty { width: 228px !important}body[yahoo] .secondary-subhead-right { display: none !important}body[yahoo] .secondary-subhead-left { width: 450px !important}}@media only screen and (max-width: 479px) {body[yahoo] .navigation { display: none !important}body[yahoo] .device-width { width: 300px !important; padding: 0}body[yahoo] .threeColumns { width: 150px !important}body[yahoo] .fourColumns { width: 150px !important}body[yahoo] .fourColumnsLast { width: 150px !important}body[yahoo] .fourColumnsTd { padding: 10px 0px !important}body[yahoo] .fourColumnsPad { padding: 0 0 0 0 !important}body[yahoo] .secondary-product-image { width: 240px !important; height: 240px !important}body[yahoo] .single-product-table { float: none !important;margin-bottom: 10px !important;margin-right: auto !important;margin-left: auto !important;}body[yahoo] .single-product-pad { padding: 0 0 0 0 !important;}body[yahoo] .single-product-image {align:center;width: 200px !important;height: 200px !important}body[yahoo] .mobile-full-width { width: 300px !important}body[yahoo] .twoColumnForty {align:center; !importantwidth: 200px !important}body[yahoo] .twoColumnForty img {}body[yahoo] .twoColumnSixty {padding-left: 0px !important;width: 300px !important}body[yahoo] .secondary-subhead-left { width: 300px !important}body[yahoo] .ThreeColumnItemTable{ padding: 0px 0px 0px 74px !important}body[yahoo] .FourColumnFloater{float: right !important;}span.message-history{text-align: left !important;float: right !important;}}body[yahoo] .mobile-full-width { min-width: 103px;max-width: 300px;height: 38px;}body[yahoo] .mobile-full-width a { display: block;padding: 10px 0;}body[yahoo] .mobile-full-width td{ padding: 0px !important}td.wrapText{white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; }@-moz-document url-prefix() {td.wrapTextFF_Fix {display: inline-block}}body { width: 100% !important; -webkit-text-size-adjust: 100% !important; -ms-text-size-adjust: 100% !important; -webkit-font-smoothing: antialiased !important; margin: 0 !important; padding: 0 0 100px !important; font-family: Helvetica, Arial, sans-serif !important; background-color:#f9f9f9}.ReadMsgBody { width: 100% !important; background-color: #ffffff !important; }.ExternalClass { width: 100% !important; }.ExternalClass { line-height: 100% !important; }img { display: block; outline: none !important; text-decoration: none !important; -ms-interpolation-mode: bicubic !important; }td{word-wrap: break-word;}</style><!--[if gte mso 9]> <style>td.product-details-block{word-break:break-all}.threeColumns{width:140px !important}.threeColumnsTd{padding:10px 20px !important}.fourColumns{width:158px !important}.fourColumnsPad{padding: 0 18px 0 0 !important}.fourColumnsTd{padding:10px 0px !important}.twoColumnSixty{width:360px !important}table{mso-table-lspace:0pt; mso-table-rspace:0pt;}</style> <![endif]--></head><body yahoo="fix"><table id="area2Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9"><tr><td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><table width="600" class="device-width header-logo" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#f9f9f9" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 0; border: none;"><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 5px 0 10px 0; color: #333;" align="left">New message: Hi Kobo,As a buyer, I am interest...</p></td></tr></table></td></tr></table> <table id="area3Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse:collapse !important;border-spacing:0 !important;border:none;background-color:#f9f9f9;"><tr><td width="100%" valign="top" style="border-collapse:collapse !important;border-spacing:0 !important;border:none;"><table width="100%" height="7" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-image: url('http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png'); background-repeat: repeat-y no-repeat; margin: 0; padding: 0"><!--[if gte mso 9]><v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="mso-width-percent:1000;height:1px;"><v:fill type="tile" color="#dddddd" /></v:rect><v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="mso-width-percent:1000;height:6px;"><v:fill type="tile" src="http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png" color="#f9f9f9" /><div style="width:0px; height:0px; overflow:hidden; display:none; visibility:hidden; mso-hide:all;"><![endif]--><tr><td width="100%" height="1" valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #dddddd; font-size: 1px; line-height: 1px;"><!--[if gte mso 15]>&nbsp;<![endif]--></td></tr><tr><td width="100%" height="6" valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: none; font-size: 1px; line-height: 1px;">&nbsp;</td></tr><!--[if gte mso 9]></div></v:rect><![endif]--></table></td></tr></table> <table id="area4Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9"><tr><td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><table width="600" class="device-width header-logo" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 15px 0 20px; border: none;"><a href="http://rover.ebay.com/rover/0/e12050.m1831.l3127/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.com%2Flink%2F%3Fnav%3Dhome%26alt%3Dweb%26globalID%3DEBAY-ENCA%26referrer%3Dhttp%253A%252F%252Frover.ebay.com%252Frover%252F0%252Fe12050.m1831.l3127%252F7%253Feuid%253D68fe0bd048d04a84b6d8ef4046dde4cd%2526cp%253D1" style="text-decoration: none; color: #0654ba;"><img src="http://p.ebaystatic.com/aw/logos/header_ebay_logo_132x46.gif" width="132" height="46" border="0" alt="eBay" align="left" style="display: inline block; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; border: none;" /></a><img src="http://rover.ebay.com/roveropen/0/e12050/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd" alt="" style="border:0; height:1;"/></td></tr></table></td></tr></table> <table id="area5Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; background-color:#f9f9f9"> <tr> <td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <table id="PrimaryMessage" width="600" class="device-width" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#f9f9f9" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <tr><td valign="top" class="secondary-headline" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 20px 0 5px;"><h1 style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 15px; color: #808284; text-align: left; font-size: 13px; margin: 0 0 4px;" align="left">New message from:<a href="http://rover.ebay.com/rover/0/e12050.m44.l1181/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.com%2Flink%2F%3Fnav%3Duser.view%26user%3Dandfen6%26globalID%3DEBAY-ENCA%26referrer%3Dhttp%253A%252F%252Frover.ebay.com%252Frover%252F0%252Fe12050.m44.l1181%252F7%253Feuid%253D68fe0bd048d04a84b6d8ef4046dde4cd%2526cp%253D1" style="text-decoration: none; font-weight: bold; color: #336fb7;">andfen6</a><a href="http://rover.ebay.com/rover/0/e12050.m44.l1183/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Ffeedback.ebay.ca%2Fws%2FeBayISAPI.dll%3FViewFeedback%26userid%3Dandfen6%26ssPageName%3DSTRK%3AME%3AUFS" style="text-decoration: none; color: #888888;">(5)</a></h1></td></tr> <tr><td valign="top" class="viewing-problem-block" style="border-collapse: collapse !important; border-spacing: 0 !important; border-bottom-width: 1px; border-bottom-color: #f9f9f9; padding: 10px 0 30px; border-style: none none solid;"> <table width="600" class="device-width" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; border:0; cellpadding:0; cellspacing:0; align:center; bgcolor:#f9f9f9;"> <tr><td width="100%" class="wrapText device-width" valign="top" style="overflow: hidden; border-collapse: collapse !important; border-spacing: 0 !important; border: none; display: inline-block; max-width:600px;"><h3 style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 19px; color: #231f20; text-align: left; font-size: 14px; margin: 0 0 2px; font-weight:none;" align="left"><div id="UserInputtedText">Hi Kobo,<br /><br />As a buyer, I am interested....<br /><br />this is a test message</div></h3> <span style="color:#666666"></span> </td></tr> <tr><td valign="top" width="15" height="15" style="border-collapse: collapse !important; border-spacing: 20 !important; border: none;"></td></tr> <tr><td valign="top" class="cta-block" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 5px 0 5px; border: none;"><table align="left" cellpadding="0" cellspacing="0" border="0" class="mobile-full-width" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" class="center cta-button primary-cta-button" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; font-size: 14px; line-height: normal; font-weight: bold; box-shadow: 2px 3px 0 #e5e5e5; filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0079bc', endColorstr='#00519e',GradientType=0 ); background-image: linear-gradient(to bottom, #0079bc 0%,#00519e 100%); background-color: #0079bc; padding: 10px 17px; border: 1px solid #00519e;" bgcolor="#0079bc"><a href="http://rover.ebay.com/rover/0/e12050.m44.l1139/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fcontact.ebay.ca%2Fws%2FeBayISAPI.dll%3FM2MContact%26requested%3Dandfen6%26qid%3D1291497258010%26redirect%3D0" style="text-decoration: none; color: #ffffff; font-size: 14px; line-height: normal; font-weight: bold; font-family: Helvetica, Arial, sans-serif; text-shadow: 1px 1px 0 #00519e;"><span style="padding: 0px 10px">Reply</span></a></td></tr></table> </td></tr> </table></td></tr></table> <!--[if !mso]><!--><div id="V4PrimaryMessage" style="max-height: 0px; font-size: 0; overflow:hidden; display: none !important;"><div><table border="0" cellpadding="2" cellspacing="3" width="100%"><tr><td><font style="font-size:10pt; font-family:arial, sans-serif; color:#000"><strong>Dear rakutenkobo,</strong><br><br>Hi Kobo,<br /><br />As a buyer, I am interested....<br /><br />this is a test message<br><br></font><div style="font-weight:bold; font-size:10pt; font-family:arial, sans-serif; color:#000">- andfen6</div></td><td valign="top" width="185"><div></div></td></tr></table></div></div><!--<![endif]--> </td> </tr></table> <table id="area3Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9"> <tr> <td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><table width="100%" height="7" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-image: url(&#39;http://p.ebaystatic.com/aw/navbar/preHeaderBottomShadow.png&#39;); background-repeat: repeat-y no-repeat; margin: 0; padding: 0"> <tr><td width="100%" height="1" valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #dddddd;"></td></tr> <tr><td width="100%" height="6" valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: none;"></td></tr></table> </td> </tr> </table> <table id="area7Container" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color:#f9f9f9;"> <tr> <td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <table width="600" class="device-width" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#f9f9f9" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <tr><td valign="top" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; padding-right:20px;"><h1 style="font-family: Helvetica, Arial, sans-serif; font-weight: bold; line-height: 22px; color: #808284; text-align: left; font-size: 16px; text-align: left; margin-top: 0px; border-style: none none solid; border-bottom-color: #dddddd; border-bottom-width: 1px;" align="left">Get to know <a href="http://rover.ebay.com/rover/0/e12050.m3965.l1181/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.com%2Flink%2F%3Fnav%3Duser.view%26user%3Dandfen6%26globalID%3DEBAY-ENCA%26referrer%3Dhttp%253A%252F%252Frover.ebay.com%252Frover%252F0%252Fe12050.m3965.l1181%252F7%253Feuid%253D68fe0bd048d04a84b6d8ef4046dde4cd%2526cp%253D1" style="text-decoration: none; color: #336fb7;">andfen6</a> </h1><table style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: 19px; text-align: left; font-size: 14px; margin-bottom: 10px; padding-bottom: 10px;" align="left"><tr><td valign="top" style="font-size: 20px; padding-left: 15px; padding-right: 5px;">&bull;</td><td style="padding-bottom: 5px">Located: Toronto, ON, Canada</td></tr><tr><td valign="top" style="font-size: 20px; padding-left: 15px; padding-right: 5px;">&bull;</td><td style="padding-bottom: 5px">Member since: Dec 17, 2015</td></tr><tr><td valign="top" style="font-size: 20px; padding-left: 15px; padding-right: 5px;">&bull;</td><td style="padding-bottom: 5px">Positive Feedback: 100%</td></tr></table></td></tr></table></td></tr></table> <table id="area10Container" class="whiteSection" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #ffffff"> <tr> <td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <table width="600" class="device-width" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" class="viewing-problem-block" style="border-collapse: collapse !important; border-spacing: 0 !important; border-bottom-width: 1px; border-bottom-color: #dddddd; padding: 40px 0 30px; border-style: none none solid;"><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="center">Only purchases on eBay are covered by the eBay purchase protection programs. Asking your trading partner to complete a transaction outside of eBay is not allowed.</p></td></tr></table> </td> </tr></table> <table id="area11Container" class="whiteSection" width="100%" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none; background-color: #ffffff"><tr><td width="100%" valign="top" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"> <table width="600" class="device-width" border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse: collapse !important; border-spacing: 0 !important; border: none;"><tr><td valign="top" class="ebay-footer-block" style="border-collapse: collapse !important; border-spacing: 0 !important; padding: 40px 0 60px; border: none;"> <div id="ReferenceId"><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="left"><strong>Email reference id: [#a05-c1pifaockd#]_[#68fe0bd048d04a84b6d8ef4046dde4cd#]</strong></p></div><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="left">We don't check this mailbox, so please don't reply to this message. If you have a question, go to <a style="text-decoration: none; color: #555555;" href="http://rover.ebay.com/rover/0/e12050.m1852.l6369/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Focsnext.ebay.ca%2Focs%2Fhome" target="_blank">Help & Contact</a>.</p> <p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="left">eBay sent this message to Nantha Gopalasamy (rakutenkobo). Learn more about <a style="text-decoration: none; color: #555555;" href="http://rover.ebay.com/rover/0/e12050.m1852.l3167/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Faccount%2Fprotecting-account.html" target="_blank">account protection</a>. eBay is committed to your privacy. Learn more about our <a style="text-decoration: none; color: #555555;" href="http://rover.ebay.com/rover/0/e12050.m1852.l3168/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Fpolicies%2Fprivacy-policy.html" target="_blank">privacy policy</a> and <a style="text-decoration: none; color: #555555;" href="http://rover.ebay.com/rover/0/e12050.m1852.l3165/7?euid=68fe0bd048d04a84b6d8ef4046dde4cd&loc=http%3A%2F%2Fpages.ebay.ca%2Fhelp%2Fpolicies%2Fuser-agreement.html" target="_blank">user agreement</a>.</p><p style="font-family: Helvetica, Arial, sans-serif; font-weight: normal; line-height: normal; color: #888888; text-align: left; font-size: 11px; margin: 0 0 10px;" align="left">&copy;2016 eBay Inc., eBay International AG Helvetiastrasse 15/17 - P.O. Box 133, 3000 Bern 6, Switzerland</p></td></tr></table></td></tr></table></body></html>"); { server.Start(); Console.WriteLine("server started"); driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl("http://localhost:7104/message/"); var element = driver.FindElement(By.Id("UserInputtedText")); Console.WriteLine(element.Text); for (int i = 0; i < 100; i++) { server.SetService("new content: " + i); driver.Navigate().GoToUrl("http://localhost:7104/message/"); Console.WriteLine(driver.PageSource); } } } // start async http server //HttpServerAsync.ListenAsync(); //WebClient wc = new WebClient(); // Make a client request. //Console.WriteLine(wc.DownloadString //("http://localhost:51111/MyApp/Request.txt")); // local parser //LocalParser.Process(); }
private void ExecuteAction(Operation operation, PhantomJSDriver driver) { if (driver.FindElement(By.XPath(operation.ExtentionData2)).Displayed&& !driver.FindElement(By.XPath(operation.ExtentionData3)).Displayed) { operation.Action?.Invoke(driver); var driverWait = new WebDriverWait(driver, TimeSpan.FromMilliseconds(operation.Timeout)); if (operation.Condition != null) { driverWait.Until(operation.Condition); } ExecuteAction(operation, driver); } else if (driver.FindElement(By.XPath(operation.ExtentionData3)).Displayed) { return; } }
public void Login(string userName, string password) { string loginUrl = "https://instagram.com/accounts/login/"; NavigateToUrl(loginUrl); var pageRoot = _driver.FindElement(By.Id("react-root")); var userNameElement = pageRoot.FindElement(By.Name("username")); var passwordElement = pageRoot.FindElement(By.Name("password")); var buttonElement = pageRoot.FindElement(By.TagName("button")); userNameElement.SendKeys(userName); passwordElement.SendKeys(password); buttonElement.Click(); }
public async Task <int> SetIp(string ip, string userEmail) { IWebDriver browser; var driverdir = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); browser = new PhantomJSDriver(driverdir); browser.Manage().Window.Maximize(); browser.Navigate().GoToUrl("https://www.sharedproxies.com/user.php?s=api"); IWebElement name = browser.FindElement(By.Id("Username")); IWebElement password = browser.FindElement(By.Name("Password")); name.SendKeys("lebedev1"); password.SendKeys("PfTcjijzIQHZHmzVRx1z" + Keys.Enter); IWebElement home = browser.FindElements(By.ClassName("buttonscontainer1")).First().FindElements(By.ClassName("buttons4")).First().FindElement(By.TagName("a")); home.Click(); browser.FindElements(By.TagName("a")).First(f => f.Text == "Change Authorized IPs").Click(); List <IWebElement> ips = browser.FindElement(By.Id("addipform")).FindElements(By.TagName("input")).ToList(); bool isNullContains = false; int idValue = 0; for (int i = 0; (ips.Count() - 1) > i; i++) { if (ips[i].GetAttribute("value") == "") { isNullContains = true; idValue = i; break; } } if (!isNullContains) { return(1); } ips[idValue].SendKeys(ip); IWebElement submitButton = browser.FindElements(By.TagName("input")).First(s => s.GetAttribute("value") == "Save Authorized IPs"); submitButton.Click(); return(2); }
public List <Song> GetSearch() { List <Song> search_results = new List <Song>(); IReadOnlyCollection <IWebElement> search_content; List <string> search_content_ids = new List <string>(); var service = PhantomJSDriverService.CreateDefaultService(); service.HideCommandPromptWindow = true; IWebDriver driver = new PhantomJSDriver(service); driver.Url = "http://www.playzer.fr"; IJavaScriptExecutor js = (IJavaScriptExecutor)driver; js.ExecuteScript("arguments[0].click();", driver.FindElement(By.XPath("//*[@id='panel_search']/img"))); driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5)); Thread.Sleep(TimeSpan.FromSeconds(1)); IWebElement search = driver.FindElement(By.Id("search_engine")); search.SendKeys(searchBox.Text); driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5)); Thread.Sleep(TimeSpan.FromSeconds(2)); js.ExecuteScript("arguments[0].click();", driver.FindElement(By.XPath("//*[@id='search_clips_tab']"))); driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5)); // Thread.Sleep(TimeSpan.FromSeconds(2)); driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5)); IWebElement result = driver.FindElement(By.Id("search_results")); driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5)); // Thread.Sleep(TimeSpan.FromSeconds(2)); driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5)); search_content = result.FindElements(By.XPath("//div[@class='content transition search_item_content']")); // Thread.Sleep(TimeSpan.FromSeconds(2)); driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(5)); int i = 1; foreach (IWebElement ids in search_content) { string song_ID = ids.GetAttribute("id"); string title = driver.FindElement(By.XPath("//*[@id='" + song_ID + "']/div[2]")).Text; string artist = driver.FindElement(By.XPath("//*[@id='" + song_ID + "']/div[3]")).Text; string url = driver.FindElement(By.XPath("//*[@id='" + song_ID + "']/div[1]/img[2]")).GetAttribute("src"); search_results.Add(new Song(title, artist, song_ID, url, i)); i++; } driver.Close(); driver.Quit(); driver.Dispose(); return(search_results); }
public void GetData(string upc) { foreach (var site in sites) { try { Dictionary <string, string> results = new Dictionary <string, string>(); driver.Url = "https://www.amazon.com/"; driver.Navigate(); RandomWait(); driver.FindElement(By.Id("twotabsearchtextbox")).Clear(); RandomWait(); driver.FindElement(By.Id("twotabsearchtextbox")).SendKeys(upc); RandomWait(); driver.FindElement(By.ClassName("nav-search-submit")).FindElement(By.ClassName("nav-input")).Click(); RandomWait(); var elem = driver.FindElement(By.CssSelector("[class='a-link-normal s-access-detail-page s-color-twister-title-link a-text-normal']")); results.Add("Name", elem.Text); results.Add("URL", elem.GetAttribute("href")); driver.Url = results["URL"]; driver.Navigate(); RandomWait(); results.Add("Price", driver.FindElement(By.Id("priceblock_ourprice")).Text); var elementsASIN = driver.FindElements(By.XPath("//th[contains(text(), 'ASIN')]/parent::tr/td")) .Concat(driver.FindElements(By.XPath("//*[contains(text(), 'ASIN:')]/parent::li"))); if (elementsASIN.Any()) { results.Add("ASIN", elementsASIN.First().Text.Replace("ASIN:", "")); } else { // get it from URL throw new Exception("Cannot find ASIN"); } Directory.CreateDirectory(Path.Combine(DATA_PATH, results["ASIN"])); //Directory.CreateDirectory(Path.Combine(DATA_PATH, results["ASIN"], site.Name)); File.WriteAllLines(Path.Combine(DATA_PATH, results["ASIN"], "results.txt"), results.Select(kvp => string.Join("|", kvp.Key, kvp.Value))); } catch (Exception ex) { File.WriteAllText(Path.Combine(ERROR_PATH, DateTime.Now.ToString("yyyyMMddTHHmmss") + ".html"), driver.PageSource); } } }
private News GetNews(PhantomJSDriver driver, CrawlerPartConfig cpc, Uri uri, int threadId, int milliseconds) { string title = driver.FindElement(By.XPath(cpc.Title_Xpath)).Text; var contentcollection = driver.FindElements(By.XPath(cpc.Content_Xpath)); string content = string.Empty; foreach (var item in contentcollection) { content += item.Text; } string source = string.Empty; string editor = string.Empty; DateTime?publishtime = null; if (!string.IsNullOrEmpty(cpc.Source_Xpath)) { source = driver.FindElement(By.XPath(cpc.Source_Xpath)).Text; } if (!string.IsNullOrEmpty(cpc.Editor_Xpath)) { editor = driver.FindElement(By.XPath(cpc.Editor_Xpath)).Text; } if (!string.IsNullOrEmpty(cpc.PublishTime_Xpath)) { publishtime = Convert.ToDateTime(driver.FindElement(By.XPath(cpc.PublishTime_Xpath)).Text.TrimStart().Substring(0, 16)); } News news = new News() { Id = Guid.NewGuid(), CrawlerConfigId = cpc.CrawlerConfigId, Title = title, Content = content, Editor = editor, Source = source, Address = uri.ToString(), SpendTime = milliseconds, ThreadId = threadId, PublishTime = publishtime }; //WriteLog.InsertLogs(uri.ToString(), "步骤二"); return(news); }
public static string GetPostCode(string city) { try { IWebDriver selenium = new PhantomJSDriver(); //IWebDriver selenium = new ChromeDriver(); selenium.Navigate().GoToUrl("http://opendata.baidu.com/post/s?wd=&p=mini&rn=20"); var input = selenium.FindElement(By.XPath("//input[@name=\"wd\" and @id=\"kw\"]")); var inputSub = selenium.FindElement(By.XPath("//input[@type=\"submit\" and @id=\"su\"]")); input.SendKeys(city); Thread.Sleep(new Random().Next(5000, 20000)); inputSub.Click(); IWebElement txtElement; try { txtElement = selenium.FindElement(By.XPath("//article[@class=\"list-data\"]/ul/li/a")); } catch (Exception) { throw; } if (txtElement == null) { selenium.Close(); return(null); } var text = txtElement.Text; if (string.IsNullOrEmpty(text)) { selenium.Close(); return(null); } var tsplit = text.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries); selenium.Close(); return(tsplit.Last()); } catch { return(null); } }
private void refresh_Click(object sender, EventArgs e) { IWebDriver driver = new PhantomJSDriver(); driver.Navigate().GoToUrl("https://payoneer-ua.liberwing.com/"); var driverService = PhantomJSDriverService.CreateDefaultService(); driverService.HideCommandPromptWindow = true; //var driverlil = new PhantomJSDriver(driverService); //Thread.Sleep(10000); //((IJavaScriptExecutor)driver).ExecuteScript("window.stop();"); //-------------------------------------------------------------------------------------------- var rate = driver.FindElement(By.XPath("//*[@id=\"curs_pb\"]")).GetAttribute("innerHTML"); var klocalka = driver.FindElement(By.XPath("//*[@id=\"toggleccources\"]")); klocalka.Click(); var mcCustomRate = driver.FindElement(By.XPath("//*[@id=\"ccurs_mc\"]")); mcCustomRate.Clear(); mcCustomRate.SendKeys(rate.ToString()); var iSum = driver.FindElement(By.XPath("//*[@id=\"isum\"]")); iSum.Clear(); USD = howmuch.Text; iSum.SendKeys(USD); var rMcUah = driver.FindElement(By.XPath("//*[@id=\"r_mc_grn\"]")).GetAttribute("innerHTML"); //-------------------------------------------------------------------------------------------- resultText.Text = rMcUah; rateText.Text = rate; if (Convert.ToDouble(rMcUah) > 20050) { resultText.ForeColor = Color.Green; } else { resultText.ForeColor = Color.Red; } //UPW.Text = Convert.ToString(Convert.ToInt32(howmuch.Text) + 6); //UPW.Text = Convert.ToString(Convert.ToInt32(UPW.Text) * 1.3); //clean.Text = Convert.ToString(Convert.ToInt32(howmuch.Text) * 0.965 - 3.15); driver.Quit(); }
public void VerifyExamUI(string strName, string strEmail) { //wd = new ChromeDriver(chromeOptions); //_wd = new InternetExplorerDriver(); using (IWebDriver _wd = new PhantomJSDriver()) { IJavaScriptExecutor _js = (IJavaScriptExecutor)_wd; _wd.Navigate().GoToUrl(@"http://www.lessismoore.net/exam?id=1&sf=8d679ae7-e939-474c-a3ff-8501ee636b12"); _wd.Manage().Timeouts().ImplicitWait = new System.TimeSpan(0, 0, 10); IWait <IWebDriver> wait = new WebDriverWait(_wd, System.TimeSpan.FromSeconds(5)); _wd.FindElement(By.Id("txtName")).SendKeys(strName); _wd.FindElement(By.Id("txtEmail")).SendKeys(strEmail); int[] ctrlIDs = { 101, 202, 303, 401, 504, 604, 703, 801, 902, 1003 }; foreach (int intID in ctrlIDs) { _wd.FindElement(By.Id("answer_" + intID.ToString())).Click(); _js.ExecuteScript("window.scrollBy(0,300)"); } _js.ExecuteScript("window.confirm = function(msg){return true;};"); _wd.FindElement(By.Id("txtSubmit")).Click(); //wait.Until(ExpectedConditions.AlertIsPresent()); //_wd.SwitchTo().Alert().Accept(); //wait.Until(ExpectedConditions.AlertIsPresent()); //_wd.SwitchTo().Alert().Accept(); wait.Until(ExpectedConditions.ElementExists(By.Id("hdnScore"))); int intScore; int.TryParse(_wd.FindElement(By.Id("hdnScore")).GetAttribute("value"), out intScore); Assert.True(intScore >= ctrlIDs.Length); } }
public void LowBloodPressureImageValidation() { using (IWebDriver driver = new PhantomJSDriver()) { driver.Navigate().GoToUrl(webAppUri); System.Diagnostics.Debug.WriteLine(driver.PageSource); IWebElement diastolicElement = driver.FindElement(By.Id("BP_Diastolic")); clearTextBox(diastolicElement); diastolicElement.SendKeys("90"); diastolicElement.SendKeys(Keys.Tab); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(3)); IWebElement ambulance = driver.FindElement(By.Id("ambulanceImage")); Assert.IsNotNull(ambulance); diastolicElement = driver.FindElement(By.Id("BP_Diastolic")); clearTextBox(diastolicElement); diastolicElement.SendKeys("50"); diastolicElement.SendKeys(Keys.Tab); WebDriverWait waitAgain = new WebDriverWait(driver, TimeSpan.FromSeconds(3)); bool imagePresent; try { IWebElement ambulanceGone = driver.FindElement(By.Id("ambulanceImage")); imagePresent = true; } catch { imagePresent = false; } Assert.IsFalse(imagePresent); driver.Quit(); } }
private void button_Click(object sender, RoutedEventArgs e) { var driverService = PhantomJSDriverService.CreateDefaultService(); driverService.HideCommandPromptWindow = true; var webDriver = new PhantomJSDriver(driverService); webDriver.Navigate().GoToUrl("http://www.udebug.com/UVa/10812"); IWebElement inputBox = webDriver.FindElement(By.Id("edit-input-data")); inputBox.SendKeys("3\n2035415231 1462621774\n1545574401 1640829072\n2057229440 1467906174"); IWebElement submitButton = webDriver.FindElement(By.Id("edit-output")); submitButton.Click(); string answer = webDriver.PageSource; int begin = answer.IndexOf("<pre>") + 5; answer = answer.Substring(begin, answer.IndexOf("</pre>") - begin); webDriver.Close(); MessageBox.Show(answer); }
public static ParsedSongInfo ParseVideoPage(String id) { IWebDriver ffDriver = new FirefoxDriver(); var driverService = PhantomJSDriverService.CreateDefaultService(); driverService.HideCommandPromptWindow = true; var options = new PhantomJSOptions(); options.AddAdditionalCapability("phantomjs.page.settings.userAgent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36"); var phantom = new PhantomJSDriver(driverService, options); phantom.Navigate().GoToUrl($"http://v.redonapp.com/yt/{id}"); String Title = phantom.FindElement(By.Id("result_title")).Text; String Uri = phantom.FindElement(By.Id($"o_{id}")).GetAttribute("rel"); ParsedSongInfo info = new ParsedSongInfo(Uri, Title); return(info); }
static void Main(string[] args) { string rootfilename = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); string filename = rootfilename + "\\output.csv"; int invalidCounter = 0; Console.WriteLine("Enter desired number of attempts (ex. 200):" + Environment.NewLine); var attemptsCount = Console.ReadLine(); Console.WriteLine("Running through " + attemptsCount.ToString() + " iterations, now select your desired prodcut...." + Environment.NewLine + " (1) ReadyNAS RNDP6000" + " (2) ReadyNAS 516" + " (3) ReadyNAS 716X" + " (4) R8000 Router" + " (5) R8500 Router" + " (6) A6210 WiFi USB Adapter" + " (7) ProSAFE M7300-24XF Switch" + " (8) ReadyNAS 526X" + " (9) ReadyNAS 528X" + " (10) R9000 Router" + " (11) ProSAFE XS728T Switch" + " (12) ProSAFE XS748T Switch MSRP 3,000$" + Environment.NewLine); var productChoice = Console.ReadLine(); //Using PhamtomJS for autoamtion IWebDriver driver = new PhantomJSDriver(@"C:\PhantomJs\bin\phantomjs\bin\"); StringBuilder validserials = new StringBuilder(); for (int i = 0; i < Convert.ToInt32(attemptsCount); i++) { driver.Navigate().GoToUrl("https://my.netgear.com/register/register.aspx"); string tempSerial = GenerateSerial(productChoice); driver.FindElement(By.Id("ContentPlaceHolder1_txtSerial")).SendKeys(tempSerial); driver.FindElement(By.Id("ContentPlaceHolder1_ddlMonth")).Click(); //Wait a bit just in case the js refresh takes awhile System.Threading.Thread.Sleep(5000); try { string sertype = driver.FindElement(By.Id("ContentPlaceHolder1_lblProductName")).Text; validserials.AppendLine(sertype + "," + tempSerial); } catch (NoSuchElementException) { invalidCounter++; } } Console.WriteLine("We found " + invalidCounter.ToString() + " invalid serials out of the total attempt count of " + attemptsCount.ToString()); }
public IWebElement PhFind(PhantomJSDriver browser, By by) { var _wait = new WebDriverWait(browser, TimeSpan.FromSeconds(120)); try { var result = _wait.Until(x => x.FindElements(by).FirstOrDefault() != null); } catch { } return(browser.FindElement(by)); }
private void InitPhantom(string login, string password) { var service = PhantomJSDriverService.CreateDefaultService(); service.IgnoreSslErrors = true; service.LoadImages = false; service.ProxyType = "none"; service.SslProtocol = "any"; var options = new PhantomJSOptions(); options.AddAdditionalCapability("phantomjs.page.settings.userAgent", _phantomJsUserAgent); _phantom = new PhantomJSDriver(service, options); _phantom.Navigate().GoToUrl($"{BaseUrl}/accounts/login"); _phantom.FindElement(By.Id("input_login_email")).SendKeys(login); _phantom.FindElement(By.Id("input_login_password")).SendKeys(password); _phantom.FindElement(By.Id("signin_submit")).Click(); new WebDriverWait(_phantom, TimeSpan.FromSeconds(10)).Until( ExpectedConditions.UrlContains($"{BaseUrl}/app/")); }
public void ChildFormSubmitTest() { using (IWebDriver driver = new PhantomJSDriver()) { driver.Navigate().GoToUrl("http://localhost:60123/"); IWebElement parentStartAction = driver.FindElement(By.Name("parent_start")); parentStartAction.Click(); var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); wait.Until(d => d.Title.StartsWith("ParentStart", StringComparison.OrdinalIgnoreCase)); using (var child = new ChildIFrame(driver)) { const string testMessage = "Beate"; var inputField = child.GetFirstNameField(); inputField.SendKeys(testMessage); var submitButton = child.GetSubmitButton(); submitButton.Click(); var resultField = child.GetResultField(); Assert.AreEqual(testMessage, resultField.GetAttribute("value")); } const string parentTestMessage = "parentMessage"; IWebElement parentAnotherField = driver.FindElement(By.Name("parent_another_field")); parentAnotherField.SendKeys(parentTestMessage); Assert.AreEqual(parentTestMessage, parentAnotherField.GetAttribute("value")); using (var child = new ChildIFrame(driver)) { const string testMessage = "fill those out as well"; var inputField = child.GetInputField(); inputField.SendKeys(testMessage); Assert.AreEqual(testMessage, inputField.GetAttribute("value")); } } }