• <bdo id='umFkl'></bdo><ul id='umFkl'></ul>

    <legend id='umFkl'><style id='umFkl'><dir id='umFkl'><q id='umFkl'></q></dir></style></legend>

        <tfoot id='umFkl'></tfoot>

        <small id='umFkl'></small><noframes id='umFkl'>

      1. <i id='umFkl'><tr id='umFkl'><dt id='umFkl'><q id='umFkl'><span id='umFkl'><b id='umFkl'><form id='umFkl'><ins id='umFkl'></ins><ul id='umFkl'></ul><sub id='umFkl'></sub></form><legend id='umFkl'></legend><bdo id='umFkl'><pre id='umFkl'><center id='umFkl'></center></pre></bdo></b><th id='umFkl'></th></span></q></dt></tr></i><div id='umFkl'><tfoot id='umFkl'></tfoot><dl id='umFkl'><fieldset id='umFkl'></fieldset></dl></div>

        如何在 Robot Framework 中将数据附加到 csv 文件?

        时间:2023-09-12
          <tbody id='FmFWj'></tbody>
      2. <legend id='FmFWj'><style id='FmFWj'><dir id='FmFWj'><q id='FmFWj'></q></dir></style></legend>

        <tfoot id='FmFWj'></tfoot>
        <i id='FmFWj'><tr id='FmFWj'><dt id='FmFWj'><q id='FmFWj'><span id='FmFWj'><b id='FmFWj'><form id='FmFWj'><ins id='FmFWj'></ins><ul id='FmFWj'></ul><sub id='FmFWj'></sub></form><legend id='FmFWj'></legend><bdo id='FmFWj'><pre id='FmFWj'><center id='FmFWj'></center></pre></bdo></b><th id='FmFWj'></th></span></q></dt></tr></i><div id='FmFWj'><tfoot id='FmFWj'></tfoot><dl id='FmFWj'><fieldset id='FmFWj'></fieldset></dl></div>
          <bdo id='FmFWj'></bdo><ul id='FmFWj'></ul>

        • <small id='FmFWj'></small><noframes id='FmFWj'>

                  本文介绍了如何在 Robot Framework 中将数据附加到 csv 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我想将数据附加到现在在 Robot Framework 中不为空的 .csv 文件中,但我遇到了一些问题.

                  I would like to append data to .csv file which is not empty in Robot Framework now, but I meet some questions.

                  我从 github 中的robotframework-CSVLibrary"的s4int"安装了 CSVLibrary,它有一个名为Append To Csv File"的关键字.我可以将数据附加到 .csv 文件中,但格式存在一些问题.

                  I installed CSVLibrary from 's4int' of 'robotframework-CSVLibrary' in github and it has a keyword named 'Append To Csv File'. I can append data into .csv file but there are some issues with the format.

                  首先我有一个空的 csv 文件,然后在 Robot Framework 中运行我的脚本.

                  First I have an empty csv file and I run my scripts in Robot Framework.

                  *** Settings ***
                  Library           Selenium2Library
                  Library           CSVLibrary
                  
                  *** Variables ***
                  
                  *** Test Cases ***
                  test
                  ${list}=    Create List    apple    pear
                  Append To Csv File    ${file_path}    ${list}   
                  

                  文件如下所示:

                  但我期望的是:

                  !

                  如何附加数据以显示我所期望的?我的格式错了吗?或者还有其他方法可以实现吗?非常感谢.

                  How can I append data to show like what I expect? Is my format wrong? Or is there any other way to realize it? Thanks a lot.

                  推荐答案

                  看来您使用的库,Append to csv file 需要一个列表列表.每个列表代表一行,每个子列表代表该行中的列.

                  It appears that with the library you are using, Append to csv file requires a list of lists. Each list represents a row, and each sublist represents the columns in the row.

                  由于您希望apple"和pear"位于同一行,因此您需要将它们放在一个列表中,然后将该列表放入另一个列表中.

                  Since you want "apple" and "pear" to be on the same row, you need to put those in a list, and then put that list in another list.

                  *** Test Cases ***
                  test
                      ${list}=    Create List    apple    pear
                      ${data}=    create list    ${list}
                      Append To Csv File    ${file_path}    ${data}  
                  

                  这篇关于如何在 Robot Framework 中将数据附加到 csv 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在 Selenium 中获得“nth-of-type" 下一篇:如何在window x64上的python中记录selenium webdriver测试

                  相关文章

                  最新文章

                1. <legend id='hUUp0'><style id='hUUp0'><dir id='hUUp0'><q id='hUUp0'></q></dir></style></legend>
                    <bdo id='hUUp0'></bdo><ul id='hUUp0'></ul>

                  <small id='hUUp0'></small><noframes id='hUUp0'>

                  1. <tfoot id='hUUp0'></tfoot>
                    <i id='hUUp0'><tr id='hUUp0'><dt id='hUUp0'><q id='hUUp0'><span id='hUUp0'><b id='hUUp0'><form id='hUUp0'><ins id='hUUp0'></ins><ul id='hUUp0'></ul><sub id='hUUp0'></sub></form><legend id='hUUp0'></legend><bdo id='hUUp0'><pre id='hUUp0'><center id='hUUp0'></center></pre></bdo></b><th id='hUUp0'></th></span></q></dt></tr></i><div id='hUUp0'><tfoot id='hUUp0'></tfoot><dl id='hUUp0'><fieldset id='hUUp0'></fieldset></dl></div>