Ubuntu+Chromium+Webdrive+Selenium 自动化调试环境

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu+Chromium+Webdrive+Selenium 自动化调试环境相关的知识,希望对你有一定的参考价值。

参考技术A 直接apt安装,不用去google下安装包,apt库中已经是有编译好的对应chromium版本的webdriver而且版本都还算比较新的。

安装完成后创建一个软连接

我的python环境是python3.8
在selemium的firefox中插件中一个因为is引起的错误

Chromium build ubuntu 中获取 --nohooks --no-history chromium 时出错

【中文标题】Chromium build ubuntu 中获取 --nohooks --no-history chromium 时出错【英文标题】:Error while fetch --nohooks --no-history chromium in Chromium build ubuntu 【发布时间】:2021-08-14 10:05:55 【问题描述】:

我正在尝试在 ubuntu 上构建 chromium,我遵循了 chromium 官方网站的所有说明 但之后我遇到了一些错误

fetch --nohooks --no-history chromium

因为我是新手,所以找不到解决此问题的方法。 我尝试多次构建它,但同样的问题出现了..

错误:

1:28:42] Still working on:
[1:28:42]   src/third_party/icu
Syncing projects:  98% (55/56) src/third_party/icu                  
src/third_party/libavif/src (ERROR)
----------------------------------------
[0:32:54] Started.
[0:32:54] 

________ running 'git init --bare /home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_gittmp_srcyd5hsx90' in '/home/mypc/Desktop/code/chromium'

[0:32:54] Initialized empty Git repository in /home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_gittmp_srcyd5hsx90/
[0:32:54] 
________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/external/github.com/AOMediaCodec/libavif.git --template=/home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_gittmp_srcyd5hsx90 /home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_src_9qd9xci0' in '/home/mypc/Desktop/code/chromium'

[0:32:54] Cloning into '/home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_src_9qd9xci0'...
[0:32:56] error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400
[0:32:56] fatal: the remote end hung up unexpectedly
[0:32:57] 
________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/external/github.com/AOMediaCodec/libavif.git --template=/home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_gittmp_srcyd5hsx90 /home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_src_9qd9xci0' in '/home/mypc/Desktop/code/chromium' attempt 2 / 4

[0:32:57] Cloning into '/home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_src_9qd9xci0'...
[0:32:57] error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400
[0:32:57] fatal: the remote end hung up unexpectedly
[0:32:58] 
________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/external/github.com/AOMediaCodec/libavif.git --template=/home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_gittmp_srcyd5hsx90 /home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_src_9qd9xci0' in '/home/mypc/Desktop/code/chromium' attempt 3 / 4

[0:32:58] Cloning into '/home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_src_9qd9xci0'...
[0:32:59] error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400
[0:32:59] fatal: the remote end hung up unexpectedly
[0:33:01] 
________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/external/github.com/AOMediaCodec/libavif.git --template=/home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_gittmp_srcyd5hsx90 /home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_src_9qd9xci0' in '/home/mypc/Desktop/code/chromium' attempt 4 / 4

[0:33:01] Cloning into '/home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_src_9qd9xci0'...
[0:33:01] error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400
[0:33:01] fatal: the remote end hung up unexpectedly
Traceback (most recent call last):
  File "/home/mypc/Desktop/code/depot_tools/gclient_scm.py", line 1048, in _Clone
    self._Run(clone_cmd, options, cwd=self._root_dir, retry=True,
  File "/home/mypc/Desktop/code/depot_tools/gclient_scm.py", line 1388, in _Run
    gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
  File "/home/mypc/Desktop/code/depot_tools/gclient_utils.py", line 674, in CheckCallAndFilter
    raise subprocess2.CalledProcessError(
subprocess2.CalledProcessError: Command 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/external/github.com/AOMediaCodec/libavif.git --template=/home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_gittmp_srcyd5hsx90 /home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_src_9qd9xci0' returned non-zero exit status 128 in /home/mypc/Desktop/code/chromium
[0:33:05] _____ Conflicting directory found in /home/mypc/Desktop/code/chromium/src/third_party/libavif/src. Moving to /home/mypc/Desktop/code/chromium/_bad_scm/src/third_party/libavif/srco15x1xp5.
----------------------------------------


Warnings:
Conflicting directory /home/mypc/Desktop/code/chromium/src/third_party/libavif/src moved to /home/mypc/Desktop/code/chromium/_bad_scm/src/third_party/libavif/srco15x1xp5.
Traceback (most recent call last):
  File "/home/mypc/Desktop/code/depot_tools/gclient_scm.py", line 548, in update
    self._Clone(revision, url, options)
  File "/home/mypc/Desktop/code/depot_tools/gclient_scm.py", line 1048, in _Clone
    self._Run(clone_cmd, options, cwd=self._root_dir, retry=True,
  File "/home/mypc/Desktop/code/depot_tools/gclient_scm.py", line 1388, in _Run
    gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
  File "/home/mypc/Desktop/code/depot_tools/gclient_utils.py", line 674, in CheckCallAndFilter
    raise subprocess2.CalledProcessError(
subprocess2.CalledProcessError: Command 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/external/github.com/AOMediaCodec/libavif.git --template=/home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_gittmp_srcyd5hsx90 /home/mypc/Desktop/code/chromium/src/third_party/libavif/_gclient_src_9qd9xci0' returned non-zero exit status 128 in /home/mypc/Desktop/code/chromium

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mypc/.vpython-root/6b08bc/lib/python3.8/shutil.py", line 791, in move
    os.rename(src, real_dst)
FileNotFoundError: [Errno 2] No such file or directory: '/home/mypc/Desktop/code/chromium/src/third_party/libavif/src' -> '/home/mypc/Desktop/code/chromium/_bad_scm/src/third_party/libavif/srco15x1xp5/src'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mypc/Desktop/code/depot_tools/metrics.py", line 291, in print_notice_and_exit
    yield
  File "/home/mypc/Desktop/code/depot_tools/gclient.py", line 3200, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/home/mypc/Desktop/code/depot_tools/gclient.py", line 3186, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/home/mypc/Desktop/code/depot_tools/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/home/mypc/Desktop/code/depot_tools/gclient.py", line 2740, in CMDsync
    ret = client.RunOnDeps('update', args)
  File "/home/mypc/Desktop/code/depot_tools/gclient.py", line 1779, in RunOnDeps
    work_queue.flush(revision_overrides, command, args, options=self._options,
  File "/home/mypc/Desktop/code/depot_tools/gclient_utils.py", line 969, in flush
    reraise(e[0], e[1], e[2])
  File "/home/mypc/Desktop/code/depot_tools/gclient_utils.py", line 67, in reraise
    raise value
  File "/home/mypc/Desktop/code/depot_tools/gclient_utils.py", line 1046, in run
    self.item.run(*self.args, **self.kwargs)
  File "/home/mypc/Desktop/code/depot_tools/gclient.py", line 925, in run
    self._got_revision = self._used_scm.RunCommand(command, options, args,
  File "/home/mypc/Desktop/code/depot_tools/gclient_scm.py", line 132, in RunCommand
    return getattr(self, command)(options, args, file_list)
  File "/home/mypc/Desktop/code/depot_tools/gclient_scm.py", line 550, in update
    self._DeleteOrMove(options.force)
  File "/home/mypc/Desktop/code/depot_tools/gclient_scm.py", line 207, in _DeleteOrMove
    shutil.move(self.checkout_path, dest_path)
  File "/home/mypc/.vpython-root/6b08bc/lib/python3.8/shutil.py", line 811, in move
    copy_function(src, real_dst)
  File "/home/mypc/.vpython-root/6b08bc/lib/python3.8/shutil.py", line 435, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/home/mypc/.vpython-root/6b08bc/lib/python3.8/shutil.py", line 264, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/home/mypc/Desktop/code/chromium/src/third_party/libavif/src'

Subprocess failed with return code 1.

PS。我也是***的新手

【问题讨论】:

在同样的错误之后,我使用了另一个命令继续,gclient sync;这得到了整个项目。 【参考方案1】:

要运行该工具(这是一个 bash 脚本),您可以尝试指定获取文件的路径(绝对或相对)。即如果你是depot_tools,你可以试试 ./fetch --nohooks --no-history chromium

看看有没有帮助

【讨论】:

【参考方案2】:

(2021.06.02) 我用: fetch --nohooks --no-history chromium,得到同样的错误。

我试试: fetch --nohooks chromium,工作完成。

发生了什么?我不知道。

【讨论】:

这应该是评论吗? 我真的不想安装历史。正如“文档”中所说,下载历史记录可能需要更长的时间

以上是关于Ubuntu+Chromium+Webdrive+Selenium 自动化调试环境的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu怎么安装chromium

Chromium build ubuntu 中获取 --nohooks --no-history chromium 时出错

ubuntu16.04查看软件的安装位置

ubuntu18.04上使用LLDB调试Chromium_Android

在 ubuntu linux 上构建 chromium 源代码后的输出

Ubuntu14.04下安装chromium浏览器,安装好后,却无法使用(报错),该如何解决呢?