Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void button5_Click(object sender, EventArgs e)
- {
- driver.Navigate().GoToUrl("https://web.whatsapp.com/");
- richTextBox1.Text += "Logging in.\n";
- timer6.Start(); //timer7.Start();
- }
- private void timer6_Tick(object sender, EventArgs e)
- {
- if (IsElementPresent(By.ClassName("iHhHL")))
- {
- driver.Navigate().GoToUrl("https://api.whatsapp.com/send?phone=" + listBox2.Text);
- C++;
- listBox2.SelectedItem = listBox2.Items[C - 1];
- timer6.Stop();
- timer7.Start();
- }
- }
- private void timer7_Tick(object sender, EventArgs e)
- {
- if (IsElementaction(By.Id("action-button")))
- {
- driver.FindElement(By.Id("action-button")).Click();
- }
- timer7.Stop();
- timer8.Start();
- }
- private void timer8_Tick(object sender, EventArgs e)
- {
- if (IsCheckNumber(By.XPath(".//div[@class='_1WZqU PNlAR']")))
- {
- driver.FindElement(By.XPath(".//div[@class='_1WZqU PNlAR']")).Click();
- string selectitem = listBox2.SelectedItem.ToString();
- listBox2.Items.Remove(selectitem);
- timer8.Stop();
- timer6.Start();
- }
- else
- {
- if (listBox2.SelectedItem != null)
- {
- string selectitem = listBox2.SelectedItem.ToString();
- listBox3.Items.Add(selectitem);
- listBox2.Items.Remove(selectitem);
- C--;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement