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

做网站镜像微信上如何投放广告

做网站镜像,微信上如何投放广告,asp网站制作工具,学院网站建设项目基于 Python 的 Page Factory 设计模式测试库, 类似于Java的Page Factory模式,旨在减少代码冗余,简单易用,具有高度的可扩展能力。 支持以annotation的方式定义元素 支持同一个元素多种定位方式 支持动态的定位方式 安装 pip install pyth…

基于 Python 的 Page Factory 设计模式测试库, 类似于Java的Page Factory模式,旨在减少代码冗余,简单易用,具有高度的可扩展能力。

支持以@annotation的方式定义元素
支持同一个元素多种定位方式
支持动态的定位方式

安装

pip install pythium

用法

from pythium import find_by, android_find_by, ios_find_by
from pythium import find_all, ios_find_all, android_find_all, Page, by
from appium.webdriver.webelement import WebElement as MobileElement
from selenium.webdriver.remote.webelement import WebElement
from typing import Any, List


class LoginPage(Page):

    @find_by(css=".search")
    @ios_find_by(ios_predicate='value == "Search something"')
    @android_find_by(android_uiautomator='resourceId("com.app:id/search_txtbox")')
    def search_input(self) -> WebElement: ...

    @property
    @find_by(css=".search")
    @ios_find_by(ios_predicate='value == "Search something"')
    @android_find_by(android_uiautomator='resourceId("com.app:id/search_txtbox")')
    def search_input_with_property(self) -> WebElement: ...

    @property
    @find_all(by(css=".icon-logo1"), by(css=".icon-logo"))
    def find_all_web_test(self) -> WebElement: return Any

    @property
    @ios_find_all(by(ios_predicate='value == "Search something"'), by(ios_predicate='value == "Search result"'))
    @android_find_all(by(android_uiautomator='resourceId("com.app:id/search_txtbox")'), by(android_uiautomator='resourceId("com.app:id/search_txtbox")'))
    def find_all_mobile_test(self) -> WebElement: return Any

    # for dynamical locator
    @find_by(xpath="//div[{n}]/a[{k}]/div[{m}]/{f}")
    @ios_find_by(xpath="//div[1]/a[{n}]/div[{k}]")
    def dynamical_locator(self, n, k, m=4, f=6) -> WebElement: ...

    # for list WebElements
    @find_by(css=".login")
    def list_web_elements(self) -> List[MobileElement]: ...```

    def _is_loaded(self):
        print("implement something...")

if __name__ == '__main__':
    from selenium import webdriver
    driver = webdriver.Chrome()
    login = LoginPage(driver)
    # no @property
    login.search_input.click()
    # with @property
    login.search_input_with_property.click()
    # for dynamical locator
    login.dynamical_locator(2, 3, 4, 5).click()
    # for list WebElement
    print(len(login.list_web_elements()))

find_all, ios_find_all, android_find_all 使用多个定位元素,元素之间为or的关系,按顺序查找

例子: @find_all(by(css=".icon-logo1"), by(id="icon"))
首先查找元素 by(css=".icon-logo1"), 如果找到则返回 WebElement;
如果没找到则通过 by(id="icon")继续找, 如果找到则返回WebElement, 最后没找到则抛出异常 Exception.
 

http://www.dt0577.cn/news/36524.html

相关文章:

  • 佛山网站推广市场app推广代理平台
  • 网站正在建设中超级优化大师下载
  • 江苏住房和城乡建设部网站班级优化大师头像
  • 选择做网站销售的优势seo官网
  • 网站搭建是什么专业游戏推广员每天做什么
  • 广告设计公司深圳品牌设计公司百度关键词优化查询
  • 网店erpseo快速排名是什么
  • 网站怎么做充值系统下载怎么建网站平台卖东西
  • 搭建网站需要学什么软件四川旅游seo整站优化
  • 交换广告是两个网站做友情链接吗搜索量排行
  • 用xp做网站是否先搭建iis重庆放心seo整站优化
  • 做微商哪个网站比较好nba最新交易信息
  • wordpress开发视频网站ip反查域名网站
  • 网站链接数百度点击器找名风软件
  • 佛山顺德网站建设公司前端培训哪个机构靠谱
  • 5000元网站seo推广广州营销seo
  • 网站怎么做的有创意新手如何自己做网站
  • 乒乓球网站怎么做品牌营销理论
  • 手机笑话网站模板推广软件是什么工作
  • 培训网站平台怎样做常州网站优化
  • 建设工程施工合同在哪个网站怎么让某个关键词排名上去
  • wordpress 微博组件西安抖音seo
  • 英文wordpress济南seo排行榜
  • wordpress代码板插件无锡seo培训
  • 做网站怎么让百度收录了百度指数查询官网
  • 佛山网站建站建设信息发布平台推广
  • 学校网站设计图片杭州关键词优化平台
  • 电子商务网站建设与管理笔试百度seo排名工具
  • 做手机网站要注意百度指数可以查询多长时间的
  • 必要是什么网站百度指数查询移动版