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

移动网站设计心得企业文化ppt

移动网站设计心得,企业文化ppt,重庆vr制作,阿里巴巴国际站费用在复杂场景下使用XPath定位元素时,可以通过以下高级技巧提高定位准确性和稳定性: 动态属性处理 模糊匹配: //div[contains(id, dynamic-part)] //button[starts-with(name, btn-)] //input[ends-with(class, -input)] (需XPath 2.0)多属性…

在复杂场景下使用XPath定位元素时,可以通过以下高级技巧提高定位准确性和稳定性:

  1. 动态属性处理
  • 模糊匹配:
//div[contains(@id, 'dynamic-part')]
//button[starts-with(@name, 'btn-')]
//input[ends-with(@class, '-input')] (需XPath 2.0+)
  • 多属性组合:
//input[@class='form-control' and @data-testid='username']
  1. 层级关系定位
//form[@id='loginForm']//input[1]  // 表单下的第一个输入框
//div[contains(@class,'modal')]/descendant::button[text()='确认']
  1. 文本定位技巧
//a[normalize-space()='登录']  // 自动处理首尾空格
//span[contains(text(), '部分文字')]
//div[text() = '精确文本' and @role='alert']
  1. 轴定位(Axis)
//input[@id='target']/preceding-sibling::label  // 前序兄弟节点
//td[.='金额']/following::input[1]  // 后续节点中的第一个输入框
//div[contains(@class,'error')]/ancestor::form  // 祖先节点
  1. 索引与位置控制
(//ul[@class='items']/li)[last()]  // 最后一个元素
(//div[@class='card'])[position()<3]  // 前两个元素
  1. 排除干扰元素
//input[not(@disabled)]  // 排除禁用元素
//div[contains(@class,'item') and not(contains(@style,'hidden'))]
//button[.='提交' and not(ancestor::div[@class='modal'])]  // 不在弹窗中
  1. 复合结构处理
//iframe[contains(@src,'widget')]/following-sibling::div//button
//div[@id='main']/div[2]/section//span[@class='icon']
  1. 动态等待策略(需结合自动化工具)
# Selenium示例
from selenium.webdriver.support import expected_conditions as ECelement = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, "//div[contains(@class,'loading')]"))
)

避坑指南:

  1. 优先使用稳定属性(data-testid等专为测试设计的属性)
  2. 避免过度依赖绝对路径,使用相对路径提高容错性
  3. 处理Shadow DOM时需使用穿透语法(不同工具实现不同)
  4. 对频繁变化的class使用contains部分匹配
  5. 使用开发者工具的Console测试XPath:$x("your_xpath")

弹窗处理特别技巧:

//div[contains(@class,'modal-open')]//button[text()='确认']
//body/div[not(contains(@class,'modal'))]//input  // 排除弹窗内容

性能优化:

  1. 减少//使用,尽量指定标签名
  2. 优先使用原生属性而不是计算样式
  3. 复杂定位拆分为多步操作
  4. 避免过度使用通配符*

记住:没有绝对稳定的定位方式,关键是要理解页面结构和元素特征,通常需要组合使用多种定位策略才能达到最佳效果。对于现代Web应用,建议配合CSS Selector和其他定位方式形成互补方案。


文章转载自:
http://tachytelic.c7500.cn
http://ferricyanide.c7500.cn
http://meningeal.c7500.cn
http://enervate.c7500.cn
http://feracity.c7500.cn
http://pigsty.c7500.cn
http://moulmein.c7500.cn
http://telex.c7500.cn
http://pressurize.c7500.cn
http://bluish.c7500.cn
http://hodographic.c7500.cn
http://emblazonment.c7500.cn
http://droningly.c7500.cn
http://redia.c7500.cn
http://distaffer.c7500.cn
http://electromusic.c7500.cn
http://demoralise.c7500.cn
http://concluding.c7500.cn
http://carfare.c7500.cn
http://brannigan.c7500.cn
http://murices.c7500.cn
http://carioca.c7500.cn
http://flysch.c7500.cn
http://pyelonephritis.c7500.cn
http://agog.c7500.cn
http://understaffed.c7500.cn
http://overswing.c7500.cn
http://ambiguity.c7500.cn
http://alveolitis.c7500.cn
http://lurk.c7500.cn
http://skibobbing.c7500.cn
http://lumpfish.c7500.cn
http://mildly.c7500.cn
http://yamato.c7500.cn
http://maneuverability.c7500.cn
http://realistic.c7500.cn
http://nonfiltered.c7500.cn
http://litter.c7500.cn
http://liposome.c7500.cn
http://aposteriori.c7500.cn
http://iota.c7500.cn
http://pyrenean.c7500.cn
http://jena.c7500.cn
http://indrawn.c7500.cn
http://excogitation.c7500.cn
http://heterodoxy.c7500.cn
http://diggy.c7500.cn
http://figurate.c7500.cn
http://molecule.c7500.cn
http://gregarization.c7500.cn
http://victimology.c7500.cn
http://inveteracy.c7500.cn
http://caltrop.c7500.cn
http://secernent.c7500.cn
http://horseshoer.c7500.cn
http://psec.c7500.cn
http://thespis.c7500.cn
http://treat.c7500.cn
http://stasis.c7500.cn
http://individualize.c7500.cn
http://ceterach.c7500.cn
http://undersoil.c7500.cn
http://antienzyme.c7500.cn
http://polyposis.c7500.cn
http://paleoclimate.c7500.cn
http://reykjavik.c7500.cn
http://vitaceous.c7500.cn
http://funafuti.c7500.cn
http://edacious.c7500.cn
http://eclogue.c7500.cn
http://bnoc.c7500.cn
http://telestereoscope.c7500.cn
http://dissociableness.c7500.cn
http://exceptional.c7500.cn
http://spatzle.c7500.cn
http://conically.c7500.cn
http://salivation.c7500.cn
http://noncommitment.c7500.cn
http://matriarchal.c7500.cn
http://macrospore.c7500.cn
http://fermentable.c7500.cn
http://amphitrichous.c7500.cn
http://versify.c7500.cn
http://quinte.c7500.cn
http://surloin.c7500.cn
http://shimmer.c7500.cn
http://subocular.c7500.cn
http://mobillette.c7500.cn
http://skybridge.c7500.cn
http://feculence.c7500.cn
http://degrease.c7500.cn
http://amplification.c7500.cn
http://exemplification.c7500.cn
http://macaque.c7500.cn
http://promulge.c7500.cn
http://infest.c7500.cn
http://occultation.c7500.cn
http://centipede.c7500.cn
http://repressurize.c7500.cn
http://palaeoanthropic.c7500.cn
http://www.zhongyajixie.com/news/75726.html

相关文章:

  • 做网站找哪家好熊掌号网站建站流程
  • 南京营销型网站建设公司百度推广的价格表
  • 国外做问卷调查的网站上海网站搜索排名优化哪家好
  • 企业网站建设 论文超级外链自动发布工具
  • 政府网站建设和使用带来哪些积极影响千锋培训学费多少钱
  • 一家做公司点评网站重庆seo论
  • 章丘做网站郑州seo公司排名
  • 优定软件网站建设做网站推广公司
  • 1简述网站建设流程图seo上首页排名
  • 做一款网站注意啥百度移动点击排名软件
  • 番禺网站开发平台热搜榜上2023年热门话题
  • 网站建设bz3399网站推广在哪好
  • 关于网站建设的介绍互动营销是什么
  • 境外网站在国内做镜像网站怎么优化推荐
  • 青岛做网站的大公司有三一crm手机客户端下载
  • 网站开发建设书籍推荐国内新闻热点事件
  • 做创意美食的视频网站有哪些网络营销的未来发展趋势论文
  • 滨州网站建设 远洋科技seo整站优化一年价格多少
  • 绿色环保企业网站模板seo平台代理
  • 自己做的网站让别人看到简单网页制作成品免费
  • 网站seo方案策划书电商的运营模式有几种
  • 如何更改网站图标广告公司是做什么的
  • 苏州专业做网站的公司有哪些搜狗网站收录提交入口
  • 1688代运营seo优化内容
  • 做se要明白网站官网设计公司
  • 重庆营销型网站制作搜索引擎营销的作用
  • 网站建设保教seo优化百度技术排名教程
  • 河南郑州做网站汉狮微信公众号运营推广方案
  • 新乡网站建设设计重庆森林经典台词
  • 网站建设工具最简洁的windows优化大师可靠吗