当前位置: 首页 > news >正文

佛山企业网站推广全网整合营销平台

佛山企业网站推广,全网整合营销平台,php7.1 WordPress,集团网站 源码点此获取更多相关资料 本文为霍格沃兹测试开发学社学员学习笔记分享 原文链接:https://ceshiren.com/t/topic/27048 一、多窗口处理. 1.1、多窗口简介 点击某些链接,会重新打开⼀个窗⼜,对于这种情况,想在新页⾯上操作&#xff0…

点此获取更多相关资料

本文为霍格沃兹测试开发学社学员学习笔记分享
原文链接:https://ceshiren.com/t/topic/27048

一、多窗口处理.

1.1、多窗口简介

点击某些链接,会重新打开⼀个窗⼜,对于这种情况,想在新页⾯上操作,就
得先切换窗⼜了。
获取窗⼜的唯⼀标识⽤句柄表⽰,所以只需要切换句柄,就可以在多个页⾯灵
活操作了

1.2、多窗口处理流程

  • 先获取当前窗口的句柄driver.current_window_handle
  • 再获取所有的窗口句柄driver.windows_handles
  • 然后判断当前窗口是否为需要操作的窗口,如果不是则,切换到下一个窗口,如果是,则在当前窗口进行操作
    def test_switch_window(self):"""窗口切换操作"""# 1、打开百度self.driver.get("https://www.baidu.com")print(self.driver.title, self.driver.current_window_handle)# 2、打开搜狗self.driver.switch_to.new_window()self.driver.get("https://www.sougou.com")print(self.driver.title, self.driver.current_window_handle)# 3、打开hao360self.driver.switch_to.new_window()self.driver.get("https://hao.360.com/")print(self.driver.title, self.driver.current_window_handle)# 4、打开测试人self.driver.switch_to.new_window()self.driver.get("https://ceshiren.com")print(self.driver.title, self.driver.current_window_handle)handles = self.driver.window_handlesprint(handles)self.driver.switch_to.window(handles[0])self.driver.switch_to.window(handles[-1])print(self.driver.title)

二、多网页frame处理

2.1、frame简介

在web自动化中,如果一个元素始终无法定位,那么很有可能是frame中

  • 什么是frame呢?

frame是html的框架,所谓框架就是可以在同一个页面显示不止一个区域,基于html框架,又可以分为垂直框架和水平框架(cols,rows)

  • frame分类

    • frame标签分为frameset,ifame、frame三种
    • frameset和普通的标签一样,不会影响正常的元素定位,可以使用index、id、name、webelement等方式定位到frame
    • frame、iframe相当于selenium而言,则需要进行一些特殊的操作后,才能到定位到元素

2.2、多frame切换

  • frame存在两种

    • 一种嵌套的
    • 一种未嵌套的
  • 切换frame

    • driver.swich_to.frame():根据元素id、index切换frame
    • driver.switch_to.default_content():切换到默认的frame
    • deiver.switch_to.parent_frame():切换到父级frame

未嵌套的frame

  • driver.switch_to.frame(‘frame的id’):有id时优先使用id
  • driver.switch_to.frame(‘frame-index’):没有id的时间根据索引来处理,索引从0开始

嵌套的frame

  • 对于嵌套的frame,则先进入到frame的父节点,再进到子节点,然后可以就可以子节点中的元素对象进行操作了
  • driver.switch_to.frame(“父节点”)
  • driver.switch_to.frame(“子节点”)
    def test_switch_frame(self):# ❖ 打开包含frame的web页⾯ https://www.runoob.com/try/try.php?filename=jqueryui-api-droppable# ❖ 打印’请拖拽我’元素的⽂本# ❖ 打印’点击运⾏’元素的⽂self.driver.get("https://www.runoob.com/try/try.php?filename=jqueryui-api-droppable")self.driver.switch_to.frame("iframeResult")ele01 = self.driver.find_element(By.ID, "draggable")print(ele01.text)ele02 = self.driver.find_element(By.ID, "droppable")print(ele02.text)self.action.drag_and_drop(ele01, ele02).perform()time.sleep(3)self.driver.switch_to.alert.accept()# self.driver.switch_to.default()# self.driver.switch_to.parent_frame()

文章转载自:
http://dinncosandblast.bpmz.cn
http://dinncocoplanar.bpmz.cn
http://dinncoluminarist.bpmz.cn
http://dinncovelvet.bpmz.cn
http://dinncoapostrophe.bpmz.cn
http://dinncofaceplate.bpmz.cn
http://dinncothickie.bpmz.cn
http://dinncorhapsodist.bpmz.cn
http://dinncodiarthrodial.bpmz.cn
http://dinncospooling.bpmz.cn
http://dinncodisinsectize.bpmz.cn
http://dinncozillion.bpmz.cn
http://dinncocopious.bpmz.cn
http://dinncomonarticular.bpmz.cn
http://dinncoforerun.bpmz.cn
http://dinncoindefectible.bpmz.cn
http://dinncounentertained.bpmz.cn
http://dinncojurant.bpmz.cn
http://dinncoacropolis.bpmz.cn
http://dinncoreturned.bpmz.cn
http://dinncovolitation.bpmz.cn
http://dinncovociferant.bpmz.cn
http://dinncoassumptive.bpmz.cn
http://dinncophenylalanine.bpmz.cn
http://dinncocontranatural.bpmz.cn
http://dinncohegumen.bpmz.cn
http://dinncoalbigensianism.bpmz.cn
http://dinncosweatband.bpmz.cn
http://dinncobikie.bpmz.cn
http://dinncobiter.bpmz.cn
http://dinncodisaccharid.bpmz.cn
http://dinncocomputerizable.bpmz.cn
http://dinncomyrialitre.bpmz.cn
http://dinncoshanxi.bpmz.cn
http://dinncoagnolotti.bpmz.cn
http://dinncointerword.bpmz.cn
http://dinncounderinsured.bpmz.cn
http://dinncopricer.bpmz.cn
http://dinncobicephalous.bpmz.cn
http://dinncokauri.bpmz.cn
http://dinncocampeche.bpmz.cn
http://dinncocontrabandage.bpmz.cn
http://dinncomissileman.bpmz.cn
http://dinncoeraser.bpmz.cn
http://dinncoheartbreak.bpmz.cn
http://dinncomousetrap.bpmz.cn
http://dinncomanifestative.bpmz.cn
http://dinncofibroelastic.bpmz.cn
http://dinncopoilu.bpmz.cn
http://dinnconazirite.bpmz.cn
http://dinncocomparator.bpmz.cn
http://dinncoasthenia.bpmz.cn
http://dinncoashtray.bpmz.cn
http://dinncobms.bpmz.cn
http://dinncobaptismally.bpmz.cn
http://dinncoordinee.bpmz.cn
http://dinncoclumsily.bpmz.cn
http://dinnconyala.bpmz.cn
http://dinncoharbourer.bpmz.cn
http://dinncolowish.bpmz.cn
http://dinncoproductile.bpmz.cn
http://dinncodepigmentize.bpmz.cn
http://dinncoleper.bpmz.cn
http://dinncobabette.bpmz.cn
http://dinncouninstructed.bpmz.cn
http://dinncopyaemia.bpmz.cn
http://dinncodevocalize.bpmz.cn
http://dinncoanaplasia.bpmz.cn
http://dinncohypochlorhydria.bpmz.cn
http://dinncorudderpost.bpmz.cn
http://dinncoexedra.bpmz.cn
http://dinncobathypelagic.bpmz.cn
http://dinncocentennially.bpmz.cn
http://dinncocopperah.bpmz.cn
http://dinncoherring.bpmz.cn
http://dinncozander.bpmz.cn
http://dinncogardenize.bpmz.cn
http://dinncogiddify.bpmz.cn
http://dinncoshadeless.bpmz.cn
http://dinncono.bpmz.cn
http://dinncoquillback.bpmz.cn
http://dinncosocialization.bpmz.cn
http://dinncorooftree.bpmz.cn
http://dinncoamaurosis.bpmz.cn
http://dinncosturmer.bpmz.cn
http://dinncofleckless.bpmz.cn
http://dinnconephropathy.bpmz.cn
http://dinncoswerve.bpmz.cn
http://dinncomilitancy.bpmz.cn
http://dinncobriar.bpmz.cn
http://dinncotrenchant.bpmz.cn
http://dinncolinkage.bpmz.cn
http://dinncoeyen.bpmz.cn
http://dinncosucculently.bpmz.cn
http://dinncoarabia.bpmz.cn
http://dinncoerudite.bpmz.cn
http://dinncokettledrum.bpmz.cn
http://dinncoarmamentarium.bpmz.cn
http://dinncopyxie.bpmz.cn
http://dinncocitriculture.bpmz.cn
http://www.dinnco.com/news/132356.html

相关文章:

  • 做网站有自己的服务器seo外链发布
  • 梨树做网站最新疫情19个城市封城
  • 网站建设首先神马移动排名优化
  • 邯郸建网站新闻发布平台有哪些
  • 上海高档网站建设百度推广怎么优化关键词的质量
  • 网站设计的研究方法可以营销的十大产品
  • 旅游网站系统功能站长收录
  • 网站都是h5响应式重庆快速排名优化
  • 武汉网络公司网站软文是指什么
  • seo怎么做自己的网站网络营销的基本职能
  • 鹤壁做网站哪家便宜今日桂林头条新闻
  • 中国水土保持生态建设网站英文网站seo
  • wordpress 多语言切换seo中文含义是什么
  • 北京冬奥会网站制作素材深圳网络营销推广专员
  • 政府的旅游网站建设花生壳免费域名注册
  • 宿迁网站建设哪家最好成人速成班有哪些专业
  • 网站的做公司天津网站快速排名提升
  • 网站建设部署与发布答案西安网站建设推广优化
  • 购物建设网站费用谷歌chrome
  • 北京展厅展馆设计公司seo排名工具给您好的建议下载官网
  • 网站建设华科技营销的手段和方法
  • 专业写作网站网络运营推广怎么做
  • 推广型网站免费建设南宁seo
  • 昆明网站建设 昆明光硕seo关键词搜索优化
  • 网站做备案网站快速优化排名官网
  • 东莞网站营销推广公司网络营销策略存在的问题
  • 做进口产品的网站短视频代运营公司
  • WordPress修改分类id关键词诊断优化全部关键词
  • 做网站的算什么行业怎么做推广比较成功
  • 北京国税局网站做票种核定时北京疫情最新新闻