第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

使用 Selenium 在 textArea 中輸入完整的 html

使用 Selenium 在 textArea 中輸入完整的 html

C#
慕碼人8056858 2022-11-22 16:27:41
我有一個(gè)文本區(qū)域,我需要在那里輸入完整的 HTML。在 BDD,我將傳遞文件的路徑,但我不知道如何捕獲完整的 HTML(帶有標(biāo)簽)以通過(guò) SendKeys 應(yīng)用于文本區(qū)域。我使用 Specflow + Selenium + C#Scenario Outline: Input Disclaimer Filme  Given I choose the type of disclaymer <type>  When I open the html file <file>  Then I send then   Examples:    | type               | file                                  |     |    "Cota Capital"  |   "C:\Disclaimers\CotaCapital.html"   |        |    "Caucionamento" |   "C:\Disclaimers\Caucionamento.html" |   方法內(nèi)部:driver.FindElement(By.Id("TxtConteudo")).SendKeys(fullHtml);我想打開(kāi)文件,讀取所有 html,將其保存在某個(gè) var / string 中,然后將其傳遞給 textArea。
查看完整描述

1 回答

?
墨色風(fēng)雨

TA貢獻(xiàn)1853條經(jīng)驗(yàn) 獲得超6個(gè)贊

只需閱讀內(nèi)容,然后將其傳遞到文本區(qū)域,在您的步驟定義中。


string fullHtml = File.ReadAllText(file);

char tab = '\u0009';

fullHtml = fullHtml.Replace(tab.ToString(), "");

driver.FindElement(By.Id("TxtConteudo")).SendKeys(fullHtml);


查看完整回答
反對(duì) 回復(fù) 2022-11-22
  • 1 回答
  • 0 關(guān)注
  • 159 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)