如何使用Selenium IDE自动化新gmail UI发送电子邮件? [英] How to automate new gmail UI to send email by using Selenium IDE?

查看:154
本文介绍了如何使用Selenium IDE自动化新gmail UI发送电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前的gmail用户界面已更改,它会在弹出的DIV中打开,并且每个新撰写窗口的ID参数都会更改。任何人都可以尝试给我的代码?

解决方案

您可以使用XPath来完成所有工作(使用 .xpath(xpath表达式)):


  • 打开Gmail页面

  • 照常登录

  • 单击compose按钮(其XPath表达式:// div [text()='COMPOSE']
  • (电子邮件对话框会弹出)

  • 在收件人文本区域输入(发送按键)键入(发送键)主题到主题输入中。// textarea [@ name ='to']
  • //输入[@ name ='subjectbox']
  • 键入(发送键)电子邮件内容到可编辑div :// div [@ class ='gmail_default'](或// div [@ aria-label ='Message Body'] ),因为它似乎最近改变了他们的HTML)

  • 命中发送:// div [text()='发送']


The current gmail UI has changed, it opens in a pop up DIV and the ID parameters are changing for each new compose window. Can anyone try to give me the code?

解决方案

You can do all using XPath (find using By.xpath("xpath expression")):

  • Open the gmail page
  • Login as usual
  • Click on compose button (its XPath expression: "//div[text()='COMPOSE']")
  • (The email dialog will pop up)
  • Type (send keys) the addesses in the "To" text area: "//textarea[@name='to']"
  • Type (send keys) the subject to the "Subject" input: "//input[@name='subjectbox']"
  • Type (send keys) the email content to the editable div: "//div[@class='gmail_default']" (or "//div[@aria-label='Message Body']"), as it seems they changed their HTML recently)
  • Hit send: "//div[text()='Send']"

这篇关于如何使用Selenium IDE自动化新gmail UI发送电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆