您的位置:首页 > 汽车 > 时评 > 网站关键词优化排名软件系统_网站建设工作是干什么的_惠州seo整站优化_渠道推广

网站关键词优化排名软件系统_网站建设工作是干什么的_惠州seo整站优化_渠道推广

2025/1/7 18:53:06 来源:https://blog.csdn.net/xjhzjut/article/details/143935932  浏览:    关键词:网站关键词优化排名软件系统_网站建设工作是干什么的_惠州seo整站优化_渠道推广
网站关键词优化排名软件系统_网站建设工作是干什么的_惠州seo整站优化_渠道推广
################## selenium grid config start #######################
# UI自动化测试策略 Grid/Local
UIAutomation_TestStrategy = 'Grid'
selenium_grid_url = 'http://172.16.99.131:4444/wd/hub'
# Windows XP / linux
grid_platformName = 'linux'
# windows capabilities
windows_capabilities = {"platformName": "Windows XP", "browserName": "chrome"}
# linux capabilities
linux_capabilities = {"browserName": "chrome","browserVersion": "130.0","goog:chromeOptions": {"binary": "/usr/bin/google-chrome"},"platformName": "linux","se:containerName": "","se:noVncPort": 7900,"se:vncEnabled": True
}
proxy = "http://172.21.16.96:808"
################ selenium grid config end #########################

远程多节点运行:

from  conf import config
import time
import concurrent.futures
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilitiesdef run_test_on_grid():hub_url = config.selenium_grid_urloptions = webdriver.ChromeOptions()options.add_argument('--ignore-certificate-errors')options.add_argument('--ignore-ssl-errors')options.add_argument('--ignore-urlfetcher-cert-requests')options.add_argument('--disable-dev-shm-usage')options.add_argument('--ignore-certificate-errors-spki-list')options.add_argument('--no-sandbox')  # 在沙箱模式下运行浏览器,沙箱模式下的浏览器会忽略某些安全警告# # 95和96配置# if config.grid_platformName == "linux":#     capabilities = config.linux_capabilities#     # Configure proxy if needed#     proxy = config.proxy#     options.add_argument(f'--proxy-server={proxy}')# else:#     capabilities = config.windows_capabilities## # ubuntu配置## # Merge capabilities  for ubuntu## for key, value in capabilities.items():#     options.set_capability(key, value)driver = webdriver.Remote(command_executor=hub_url, options=options)driver.get("www.baidu.com")print(driver.title)time.sleep(10)return driverif __name__ == "__main__":drivers = []try:with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor:futures = [executor.submit(run_test_on_grid) for _ in range(2)]for future in concurrent.futures.as_completed(futures):drivers.append(future.result())except Exception as e:print(e)finally:for driver in drivers:driver.quit()

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com