robotframework + selenium driver + chrome driver | 瀬戸内の雲のように

robotframework + selenium driver + chrome driver で言語設定を日本語にするオプション

Posted: 2018-05-24


スポンサーリンク

目次

背景

近年の自動化ブームに乗り、私のチームでもいろいろと自動化の施策を行っています。

そんな中、Webアプリケーションなどブラウザで操作する系のアプリケーションの試験自動化には selenium がよく使われていると思います。

今回は、そんなseleniumの日本語設定についてメモしておきます。

環境

・amazon linux
・Robot Framework 3.0.4 (Python 2.7.14 on linux2)
・ChromeDriver 2.38.552522

困ったこと

自作のWebアプリケーションの私見自動化を行おうと思ったところ、ログインからつまづいてしまいました。

やりたいことは非常にシンプルで「ログイン」と書かれたボタンをクリックするというだけなのですが、なぜかうまくいきません。

 
確認したところ、原因はブラウザの言語設定でした。

 
最近?のwebアプリケーションはブラウザの言語設定を見て表示する言語を変えるらしく、会社パソコンから普通にアクセスすると日本語で表示されます。

しかし、デフォルトでは言語が英語になっているため、「Login」というボタンになっており、うまく動かなかったということです。

解決方法

chromedriverのオプションで言語設定ができました。

robotframeworkで書く場合の一例は以下のようになります。

    ### オプションの設定
    ${options} =  evaluate  sys.modules['selenium.webdriver'].ChromeOptions()  sys

    ### 日本語で表示させるオプション
    Call Method  ${options}  add_argument   --lang\=ja

    ### 起動
    Create Webdriver  Chrome  chrome_options=${options}

 
上記を取り入れて改善したのが以下のソースコードです

*** Settings ***
Library    SeleniumLibrary


*** Variables ***
${username}    user1
${password}    password123
${url}               http://localhost:8000/login

*** TestCases ***
My Test Case
    start headless chrome 
    go to myapp
    Close Browser

*** Keywords ***
check set_headless method
    ${version} =  evaluate  selenium.__version__  selenium
    ${selenium_version} =  evaluate  importlib.import_module('distutils.version').LooseVersion($version)  importlib
    # set_headlessメソッドが実装されたバージョン
か確認
    ${min_version} =  evaluate  importlib.import_module('distutils.version').LooseVersion('3.8.0')  importlib

    Pass Execution If  $selenium_version < $min_version  seleniumが${min_version}以上でないと動作しません


start headless chrome 
    check set_headless method
    ${options} =  evaluate  sys.modules['selenium.webdriver'].ChromeOptions()  sys
    Call Method  ${options}  set_headless

    ### 日本語で表示させるオプション
    Call Method  ${options}  add_argument   --lang\=ja
    Create Webdriver  Chrome  chrome_options=${options}

go to myapp
    # ブラウザでアクセスする
    Go To    ${url}

    # ログイン
    Input Text    username    ${username}
    Input Text    password    ${password}
    Click button    ログイン

    # 10秒待つ
    Sleep    10sec
    # スクリーンショットを撮る
    Capture Page Screenshot    filename=result_login.png

以上です。


スポンサーリンク




コメント一覧

2022/09/18 06:36:24

AlvinJowさん

You made your stand very nicely!!
help writing essays for scholarships how to write a good application essay blog writing services


2022/09/18 08:36:06

AlvinJowさん

You stated this exceptionally well!
how to write a really good essay how to write a good introductory paragraph for an essay writing services canada


2022/09/18 09:01:44

AlvinJowさん

Thanks a lot! A good amount of stuff!

how to write an persuasive essay website for essay writing custom writings service


2022/09/18 18:07:45

JoeteOaOaさん

fdating
a dating site
dating personal ads


2022/09/19 02:10:39

Wendellunapsさん

Fantastic stuff. Regards!
canadian online pharmacies legitimate by aarp discount prescription drug online pharmacy canada


2022/09/19 07:48:47

Michaelpedさん

Thank you! Loads of facts.

mexican border pharmacies aarp approved canadian online pharmacies buy prescription drugs canada https://canadianpharmacies-24h.com


2022/09/19 10:37:07

AlvinJowさん

You made your point!
steps to writing a persuasive essay good college application essays executive resume writers nyc


2022/09/19 10:56:28

AlvinJowさん

Nicely put, Kudos.
descriptive essay help https://service-essay.com/ best dissertation writers


2022/09/19 20:50:36

MarrisOaOaさん

community service essays
essay writing service best
i need help with writing an essay


2022/09/19 23:52:05

AlvinJowさん

You explained that wonderfully.
how to write a good transfer essay writing literary essays writing dissertation service


2022/09/20 05:46:28

Wendellunapsさん

You've made your point!
drugs from canada online discount prescription drug costco pharmacy pricing


2022/09/20 11:11:05

Michaelpedさん

You've made your position extremely nicely!!
get prescription online [url=https://canadianonlinepharmacybase.com]canadian pharmacies-24h[/url] canadian pharcharmy online https://canadarx-drugservices.com


2022/09/20 12:33:18

AlvinJowさん

Thank you! I enjoy it.
argumentative essay on college education https://topswritingservices.com/ professional resume writing services


2022/09/20 12:49:12

AlvinJowさん

Really quite a lot of valuable info.
college application essay help online to write an essay book report writers


2022/09/21 00:53:39

Michaelpedさん

Terrific info. Cheers!
buy medication without an rx mexican border pharmacies canadianpharmacyusa24h https://canadianpharmacylist.com


2022/09/21 09:16:09

Wendellunapsさん

Regards! I value it.
canadian online pharmacies canada prescriptions drugs cialis generic pharmacy online


2022/09/21 14:12:17

MartyOaOaさん

online custom essays
academic essay writing service
reviews of essay writing services


2022/09/21 23:11:05

Wendellunapsさん

Thanks, I value it.
canadian prescription medical pharmacies prescription drugs prices


2022/09/22 04:09:26

AlvinJowさん

Amazing info. Kudos!
value of a college education essay essay writing services professional writing service


2022/09/22 04:33:48

Michaelpedさん

Great tips. Thanks a lot.
best online pharmacies canada apollo pharmacy online prescription drugs online without https://northwestpharmacylabs.com


2022/09/22 14:10:18

BruceCandyさん

Amazing tons of useful advice.
rx price comparison online pharmacy reviews canadian pharcharmy online


2022/09/22 16:42:01

AlvinJowさん

Good stuff. Thanks.
best college essays write my essays seo writing services


2022/09/23 05:35:05

AshlenOaOaさん

help on writing an essay
help my essay
write my essay services


2022/09/23 05:35:03

AlvinJowさん

Whoa a lot of terrific data.
english writing essay essay rewriter writers freelance


2022/09/23 06:01:28

AlvinJowさん

Good advice. Thanks!
how to write a literary criticism essay essay help writing a speech


2022/09/24 01:22:21

CharitaOaOaさん

best website to buy essays
essay writer helper
essay help pros


2022/09/24 06:15:57

Wendellunapsさん

With thanks. Excellent information!
overseas pharmacies cialis generic pharmacy online prescription cost comparison


2022/09/24 17:48:47

AlvinJowさん

Reliable posts. Regards.
buy an essay cheap https://agbsl.pro/ book review writers


2022/09/24 19:19:51

CharitaOaOaさん

cheap custom essay papers
scholarship essay writing help
custom essay writing service toronto


2022/09/24 21:09:51

BruceCandyさん

You definitely made the point!
online medicine tablets shopping safeway pharmacy the canadian pharmacy


2022/09/25 09:12:44

AlvinJowさん

Wonderful knowledge. Regards.
sat essay writing help https://flowleadsua.com/ professional case study writers


2022/09/25 14:45:41

NaniceOaOaさん

help writing a compare and contrast essay
[url="https://buyacademicessay.com"]helping others essays[/url]
help me with my essay


2022/09/26 09:48:08

ChelsaeOaOaさん

essay help forum
custom essays writing service
help writing a compare and contrast essay


2022/09/27 05:12:26

PennyOaOaさん

essay helper app
custom essays no plagiarism
help with essay writing


2022/09/28 01:19:44

TammieOaOaさん

college essay help
essay writing services recommendations
best online essay writing services


2022/09/28 20:49:33

AntonieOaOaさん

essay writing service toronto
essay title help
what is the best online essay writing service


2022/09/30 11:44:06

CharoOaOaさん

help write essay online
cheap custom essay writing
write my essay for cheap


2022/10/01 06:23:35

DronaOaOaさん

customized essays
do essay writing services work
top 10 essay writers


2022/10/02 02:00:54

TwylaOaOaさん

help with writing essays for college applications
essay writing services toronto
essays to buy


2022/07/08 10:37:23

AurlieOaOaさん

casino 888 free slots
free slots casino world
slot machines casino


2022/07/18 16:07:06

JoeteOaOaさん

dissertation help uk
best rated essay writing service
how do i write a dissertation


2022/07/20 12:28:20

ChandaOaOaさん

dissertation format
professional writing service
online edd no dissertation


2022/07/21 06:35:29

AvivaOaOaさん

writing dissertation
buy dissertation writing services
getting help online


2022/07/22 02:07:13

DortheaOaOaさん

dissertation proposal writing services
dissertation vs thesis
dissertation proposal methodology example archived


2022/07/24 04:24:02

SuzannOaOaさん

dissertation proposal help
best dissertation writing services uk
dissertation proposal sample


2022/07/24 22:53:54

SalliOaOaさん

dissertation search
[url="https://dissertationwritingcenter.com"]dissertation proposal writing help[/url]
undergraduate dissertation


2022/07/25 19:14:25

DarsieOaOaさん

buy art online berlin
dissertation consulting
dissertation help uk


2022/07/25 18:28:12

TandiOaOaさん

free no deposit
no deposit online casino real money
top mobile casino


2022/07/26 17:02:58

MabelleOaOaさん

professional dissertation help
writing
defending your dissertation


2022/07/26 19:30:39

TandiOaOaさん

top casino site
best casino reviews
gambling online for real money


2022/07/27 10:31:12

Jariewereさん

Other tests may be ordered to determine whether other problems could be causing dementia or making it worse. cialis online without


2022/07/27 14:44:38

JenneeOaOaさん

defending your dissertation
citing a dissertation
dissertation online help


2022/07/27 20:34:24

AbagaelOaOaさん

bonus casino no deposit
best online casino us
casino no deposit bonus


2022/07/28 11:14:13

HerminaOaOaさん

dissertation help articles
writing a proposal for your dissertation
writing


2022/07/28 20:03:20

ShaylaOaOaさん

real money no deposit casino
real casino games
best online casino


2022/07/29 06:55:38

AudreOaOaさん

uk dissertation writing service
bestdissertation
custom dissertation writing help


2022/07/29 19:00:34

VerenaOaOaさん

best casino online
casino bonuser
online casino bonuses


2022/07/30 02:51:56

HestiaOaOaさん

defending dissertation
dissertation editing help
tips for writing dissertation


2022/07/30 17:27:07

DixieOaOaさん

best usa online casinos
online gambling reviews
online casino bonuses


2022/07/31 15:18:45

LaureenOaOaさん

best online us casinos
bonus online casino
online casino best bonus


2022/08/01 16:04:57

FranniOaOaさん

sign up bonus no deposit casino
the best online casino
real online casino


2022/08/02 14:26:32

PearlOaOaさん

free money no deposit casino
casino sign up bonus no deposit
online casino games real money


2022/08/03 12:50:10

BobbieOaOaさん

free money no deposit
casino games that pay real money
online casinos real money no deposit


2022/08/04 11:12:25

LeslieOaOaさん

casinos online
free welcome bonus no deposit
casino games win real money


2022/08/07 10:57:27

TrudieOaOaさん

best casino sites
casinos online
best online bingo


2022/08/07 20:27:41

HonorOaOaさん

buy vpn with crypto
best vpn for laptop
how to use a vpn


2022/08/08 10:19:08

JaynellOaOaさん

top online casinos usa
free online casino bonus
online spins


2022/08/08 16:44:15

TeddieOaOaさん

buy vpn
vpn buy account
buy vpn client


2022/08/09 18:11:48

DulceaOaOaさん

online casino real money
real money casino online
play bingo for real money


2022/08/10 01:08:21

JenneeOaOaさん

best vpn for windows
best buy vpn router
vpn free trial


2022/08/10 18:13:34

CarolanOaOaさん

online casinos no deposit
safe online casino
best online casinos for usa players


2022/08/10 21:23:23

JenneeOaOaさん

vpn avast
best vpn services 2019
vpn for mac free


2022/08/11 17:36:53

FanyaOaOaさん

sign up bonus casino no deposit
online casinos us
best welcome bonus online casino


2022/08/11 17:39:09

AshleighOaOaさん

best vpn to use in china
buy vpn canada
fastest free vpn


2022/08/12 14:39:13

KelseyOaOaさん

best vpn australia
best vpn for routers
firestick vpn free


2022/08/12 18:03:39

CarolinOaOaさん

usa casinos
wild casino online
online casinos for us players


2022/08/14 12:23:48

FifineOaOaさん

online casino real money usa
online casinos that pay real money
free no deposit bonus casino


2022/08/15 08:38:03

FifineOaOaさん

free sign up bonus
casino no deposit bonus
no deposit free bonus casino


2022/08/15 14:54:33

SheelaghOaOaさん

gom vpn
best ios vpn
the best vpn for windows 10


2022/08/15 21:06:45

Piniwhipsさん

What Is Propecia Hair Loss dosage of ivermectin for dogs


2022/08/16 07:42:49

GwenoreOaOaさん

online casino for us players
casino win real money
online casinos no deposit


2022/08/21 11:27:25

encathyさん

cialis dolor abdominal ivermectin tablet


2022/08/23 19:38:29

GladiOaOaさん

gay/bi dating apps
gay dating in little rock
biden gay boyfriend dating


2022/08/24 12:09:32

JoannOaOaさん

dating sites free
best online dating and chatrooms travel
website dating service


2022/08/24 15:00:08

JeraleeOaOaさん

dating british gay men
gay crossdresser dating
gay dating naked vh1


2022/08/25 10:42:22

KyrstinOaOaさん

gay dating naked vh1
best gay dating site
dating site for gay men over 50


2022/08/25 23:52:05

BertheOaOaさん

top rated dating websites
free datinsites chat
dating services for seniors


2022/08/26 21:00:01

KaitlynnOaOaさん

free chatting online dating sites
best online dating service
meet men online


2022/08/27 18:11:39

DavinaOaOaさん

shemale dating
free personals site
free site


2022/08/28 02:46:37

GladiOaOaさん

military gay dating
free gay dating sites
gay black dating site


2022/08/28 16:21:34

ChelsaeOaOaさん

dating for singles
tinder online
best online dating sites


2022/08/28 22:05:47

JeraleeOaOaさん

gay dating machismo
gay dating madison wi
gay on line dating


2022/08/29 14:38:23

EmaliaOaOaさん

farmers only dating
single website
best dating service


2022/08/29 17:30:31

KyrstinOaOaさん

free dating gay sites
free gay sex dating
gay or bisexual dating


2022/08/30 12:26:36

KarryOaOaさん

romancemingle
dating near me free
dating sites absolutely free


2022/08/30 13:44:39

CasandraOaOaさん

online gambling reviews
mobile gambeling
online casino usa


2022/08/31 09:12:49

AmataOaOaさん

casino real money
win real money online casino
casino real money


2022/08/31 11:06:33

LettiOaOaさん

absolutely free dating sites no fees ever
dating online dating
dating websites


2022/08/31 20:58:22

offemiaさん

cheap cialis online 14,19 Furthermore, routine low-dose exposure may diminish overall drug exposure in men who engage in sexual intercourse more than twice weekly and may minimize side effects in men who have trouble tolerating higher doses of the PDE5I


2022/09/01 09:06:52

uncothithさん

Use the lowest efficacy Cialis available buying cialis online safely


2022/09/02 00:28:49

LettiOaOaさん

online dting
asians dating site
dating sites that are totally free


2022/09/02 02:16:16

GennieOaOaさん

oc gay chat rooms
free gay sex chat rooms
gay video cam chat broadcast self


2022/09/02 22:21:48

DeeynOaOaさん

gay cam chat avenue
chat gay maduro
gay/bi men chat world


2022/09/03 00:46:14

Amuxureさん

where to buy priligy in malaysia Shipping pecularities, price, delivery terms in LA from ViaBestBuy online pharmacy


2022/09/03 13:27:41

dupdaydayさん

Look at advantages of the shipping rules and value in Albuquerque from ViaBestBuy online chemist s shop priligy alternative It is not known if ADCIRCA passes into your breast milk


2022/09/03 17:36:07

EmaleeOaOaさん

gay adult phone chat
gay chat room facebook
gay chat and hookup


2022/09/04 12:56:17

StephineOaOaさん

chat gay miami
free gay phone chat lines
chat gay vegas


2022/09/04 23:23:43

adazirlさん

cialis generic tadalafil An FDA lab test found certain honey and honey-based products contain Cialis and Viagra


2022/09/05 11:35:55

Snoseneさん

buy cialis cheap Cialis Original ГЁ un farmaco universale che ripristina il potere maschile


2022/09/06 20:55:46

Abrahamgonさん

Cheers. Quite a lot of postings!
top rated essay writing websites writing my essay essay writing service


2022/09/07 04:17:18

RobenaOaOaさん

gay chat the ave
gay chat porn
gay chat


2022/09/07 06:35:41

Alvenruilaさん

Awesome data. Many thanks. good thesis statement best college essays


2022/09/09 20:13:12

TallouOaOaさん

gay random chat x4
indiana gay chat
free gay chat rooms in ioq


2022/09/09 23:23:57

accemigさん

Hysteroscopy with D C may be diagnostic and therapeutic, sometimes being the treatment of choice when bleeding is severe, or when hormone therapy does not prove effective. generic over the counter clomid at walmart


2022/09/10 11:55:24

iodiblyさん

I felt like she was an old friend I was catching up with by the end of our first meeting. clomid for twins The clinic is open from 730 to 6 but monitoring only happens from 730 to 2.


2022/09/10 16:16:14

MarilinOaOaさん

gay chat colombia
gay chat app for android
local gay chat


2022/09/10 21:36:49

AlvinJowさん

Excellent forum posts. Appreciate it.
titles for college essays how to write a good essay for a scholarship executive resume writers nyc


2022/09/10 21:41:44

AlvinJowさん

With thanks, I value this!
best custom essay how to write a evaluation essay custom writings discount code


2022/09/13 01:20:22

Meaguemaxさん

where can i buy nolvadex


2022/09/13 13:16:41

BruceCandyさん

This is nicely expressed! .
pharmacy cheap no prescription pharmacy price comparison cvs online pharmacy


2022/09/13 14:13:42

fusaanimiさん

is tamoxifen an aromatase inhibitor


2022/09/14 02:19:33

AlvinJowさん

You stated that really well!
write essays online how to write an literary analysis essay novel writing help


2022/09/14 14:46:48

AlvinJowさん

Truly loads of amazing info.
essay on the help https://essaywriting4you.com/ quality writing services


2022/09/14 15:28:15

MavisOaOaさん

dating online chat and meet
date free site
date game online


2022/09/14 20:41:34

Michaelpedさん

You made your stand quite clearly.!
pharmacy online shopping pharmacy canada canadian pharmacy uk delivery https://online-pharmacy-inc.com


2022/09/15 01:32:40

AlvinJowさん

You actually expressed this wonderfully.
the best essay writing services https://theessayswriters.com/ custom thesis writing services


2022/09/15 03:38:37

AlvinJowさん

Thanks. Plenty of facts!

the perfect college essay https://freshappshere.com/ doctoral dissertation writing service


2022/09/15 04:21:53

Wendellunapsさん

Factor clearly considered..
pharmacy cheap no prescription international pharmacy cheap drugs online


2022/09/15 05:22:50

BruceCandyさん

Fantastic write ups. Thank you.
pharmacie canadienne canadian pharmaceuticals online canadian pharmacy no prescription


2022/09/15 09:57:58

Michaelpedさん

Very good facts. Cheers.
indian pharmacy mail order pharmacies canadian prescription drugs https://canadarx-drugservices.com


2022/09/15 16:01:24

AlvinJowさん

Nicely put. Appreciate it.
how to write a letter essay https://englishessayhelp.com/ top resume writing services 2020


2022/09/15 16:57:58

JuanitaOaOaさん

datng websites
searchingforsingles
free dating sites without registering


2022/09/15 18:40:10

BruceCandyさん

Amazing quite a lot of superb facts.
canadian pharmacies top best online pharmacy without a prescription canada prescriptions drugs


2022/09/16 03:05:26

AlvinJowさん

Good info, Many thanks.
well written college essays https://dissertationwritingtops.com/ write my homework


2022/09/16 04:50:07

AlvinJowさん

Amazing all kinds of awesome knowledge.
write a essay about yourself essay writing help for students dissertations writing service


2022/09/16 15:55:48

leagreeさん

The male C57BL 6J and c- fos- tTA transgenic mice were anesthetized with a pentobarbital solution 80 mg kg of body weight; intraperitoneal injection, and the fully anesthetized mice were placed in a stereotactic apparatus David Kopf Instruments, Tujunga, CA, USA. doxycycline for sinusitis


2022/09/16 17:45:18

MaisieOaOaさん

single women darling side
strydom mail
40 online dating


2022/09/16 18:02:53

AlvinJowさん

Whoa a good deal of helpful information.
writing short essays how to end a college essay hiring a freelance writer


2022/09/17 04:56:17

Reombakさん

Although Yun Yuanlang used a secret technique to forcibly raise a realm, it was much inferior to the real realm, and pressure top of head his speed was much lower than that of Zhao Ling. doxycycline with food Ridker PM, Vaughan DE, Stampfer MJ, et al.


2022/09/17 09:11:48

Wendellunapsさん

Terrific write ups. Regards.
canada pharmacies without script canada pharmaceuticals online generic walmart pharmacy online


2022/09/17 18:58:10

EachelleOaOaさん

which online dating site is best
date women free
meet site


2022/09/17 19:57:58

AlvinJowさん

Great info. Thanks a lot.
best writing services reviews writing my essay cite website in essay



コメントを投稿する


お名前


コメント内容





TOP back