Advertisement
AhmedSokr

Untitled

Mar 26th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. private void button5_Click(object sender, EventArgs e)
  2. {
  3. driver.Navigate().GoToUrl("https://web.whatsapp.com/");
  4. richTextBox1.Text += "Logging in.\n";
  5. timer6.Start(); //timer7.Start();
  6. }
  7. private void timer6_Tick(object sender, EventArgs e)
  8. {
  9. if (IsElementPresent(By.ClassName("iHhHL")))
  10. {
  11. driver.Navigate().GoToUrl("https://api.whatsapp.com/send?phone=" + listBox2.Text);
  12. C++;
  13. listBox2.SelectedItem = listBox2.Items[C - 1];
  14. timer6.Stop();
  15. timer7.Start();
  16. }
  17. }
  18.  
  19. private void timer7_Tick(object sender, EventArgs e)
  20. {
  21. if (IsElementaction(By.Id("action-button")))
  22. {
  23. driver.FindElement(By.Id("action-button")).Click();
  24. }
  25.  
  26. timer7.Stop();
  27. timer8.Start();
  28. }
  29. private void timer8_Tick(object sender, EventArgs e)
  30. {
  31. if (IsCheckNumber(By.XPath(".//div[@class='_1WZqU PNlAR']")))
  32. {
  33. driver.FindElement(By.XPath(".//div[@class='_1WZqU PNlAR']")).Click();
  34. string selectitem = listBox2.SelectedItem.ToString();
  35. listBox2.Items.Remove(selectitem);
  36. timer8.Stop();
  37. timer6.Start();
  38. }
  39. else
  40. {
  41.  
  42. if (listBox2.SelectedItem != null)
  43. {
  44. string selectitem = listBox2.SelectedItem.ToString();
  45. listBox3.Items.Add(selectitem);
  46. listBox2.Items.Remove(selectitem);
  47. C--;
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement