在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/網(wǎng)絡安全/ 如何實現(xiàn)robot framework 無界面UI自動化測試

如何實現(xiàn)robot framework 無界面UI自動化測試

如題??吹揭黄恼碌慕榻B的方式是安裝phantomjs實現(xiàn),步驟如下:
1.安裝phantomjs以后配置環(huán)境變量
2.進入robot文件所在文件夾,用命令行啟動robot文件
但是嘗試后,還是打開了瀏覽器。
文章鏈接:https://www.jianshu.com/p/ba3...

回答
編輯回答
幼梔

用headless模式運行webdrive來后臺啟動browser.

option = webdriver.ChromeOptions()
option.add_argument("headless")
# driver = webdriver.Chrome(r'C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe',chrome_options=option)
# print(driver.title)
driver = webdriver.Chrome(r'C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe',chrome_options=option)
# driver.get('https://segmentfault.com/q/1010000015379801?utm_source=tag-newest')
driver.get('https://www.baidu.com/')
print(driver.title)
time.sleep(5) # Let the user actually see something!
search_box = driver.find_element_by_name('wd')
search_box.send_keys('ChromeDriver')
search_box.submit()
time.sleep(5) # Let the user actually see something!
driver.quit()

圖片描述

2018年8月15日 16:17