In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Environment
This project is developed under MacOS, the tools involved are platform-independent, and should also be applicable to Linux and Windows desktop systems. Before starting this example, make sure that the following tools are installed correctly, updated to the latest version, and configured correctly.
DockerFunFcli
The Fun and Fcli tools rely on docker to simulate the local environment.
For MacOS users, you can use homebrew to install:
Brew cask install dockerbrew tap vangie/formulabrew install funbrew install fcli
For Windows and Linux user installation, please refer to:
Https://github.com/aliyun/fun/blob/master/docs/usage/installation.mdhttps://github.com/aliyun/fcli/releases
After installation, remember to initialize the configuration by executing fun config first.
Note that if you have already installed fun, make sure the version of fun is above 2.10.2.
$fun-- version2.10.1 starts initialization quickly
Use the fun init command to quickly initialize this template project locally.
Fun init vangie/selenium-java-example installation depends on $fun install... Local testing
The test code ChromeDemo is as follows:
Public class ChromeDemo implements StreamRequestHandler {public void handleRequest (InputStream inputStream, OutputStream outputStream, Context context) throws IOException {System.setProperty ("webdriver.chrome.driver", "/ code/chromedriver"); ChromeOptions options = new ChromeOptions (); options.setBinary ("/ code/headless-chromium"); options.addArguments ("--disable-extensions") / / disabling extensions options.addArguments ("--disable-gpu"); / / applicable to windows os only options.addArguments ("--disable-dev-shm-usage"); / / overcome limited resource problems options.addArguments ("--no-sandbox"); / / Bypass OS security model options.addArguments ("--headless"); WebDriver driver = new ChromeDriver (options); driver.get ("https://ide.fc.aliyun.com");") OutputStream.write (("Page title is:" + driver.getTitle () + "\ n") .getBytes (); driver.quit () }} run $mvn package & & fun local invoke selenium...FC Invoke Start RequestId: 68c83b4c-b053-479c-9b0e-9503582ccb56handle user request is com.aliyun.fc.selenium.ChromeDemo::handleRequestcache is null starting ChromeDriver 2.35.528139 (47ead77cb35ad2a9a83248b292151462a66cd881) on port 20652Only local connections are allowed.Mar 05 locally 2019 11:34:27 AM org.openqa.selenium.remote.ProtocolHandshake createSessionINFO: Detected dialect: OSSPage title is: cloud integrated development environment FC Invoke End RequestId: 68c83b4c-b053-479c-9b0e-9503582ccb56RequestId: 68c83b4c-b053-479c-9b0e-9503582ccb56 Billed Duration: 5265 ms Memory Size: 1998 MB Max Memory Used: 240MB deployment $mvn package & & fun deploy execution $fcli function invoke-s chrome-f selenium Page title is: cloud integrated development environment
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.