Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
*** Settings ***
Library SeleniumLibrary
Library Process
Library OperatingSystem
*** Keywords ***
Start Chrome
${chrome_options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
Call Method ${chrome_options} add_argument --no-sandbox
Create Webdriver Chrome chrome_options=${chrome_options}
*** Test Cases ***
Test Firefox
Open Browser http://google.com Firefox
Title Should Be Google
Close Browser
Test Chrome
Start Chrome
Go To http://www.google.com
Title Should Be Google
Close Browser
Ping test
${result} = Run Process ping 127.0.0.1 -c 1 shell=True
Should Contain ${result.stdout} 64 bytes from 127.0.0.1:
*** Test Case ***
Aikataulut
Start Chrome
Go To https://www.matkahuolto.fi/
Maximize Browser Window
title should be Etusivu - Matkahuolto
#sleep 5
#Click Element //input[@placeholder='Hae']
#Input Text //input[@placeholder='Hae'] Helsinki
click element //button[normalize-space()='Hyväksy evästeet']
click element //a[normalize-space()='Hae aikatauluja']
sleep 5
click element //h1[normalize-space()='Osta liput - hae aikataulut']
press keys xpath=//body TAB
#click element //input[@id='27a2e0bc-b8fa-462c-92c9-6678278726fe-dep']
press keys none h+e+l+s+i+n+k+i+TAB
sleep 2
sleep 2
press keys none T+a+m+p+e+r+e+TAB+TAB+TAB+TAB
#Input Text //input[@id='477baa88-ed7f-4f3b-d646-faebc05ca97a-dep'] Helsinki
sleep 2
click element //button[normalize-space()='Hae aikatauluja']
sleep 5
#click element //input[@id='477baa88-ed7f-4f3b-d646-faebc05ca97a-arr']
#Input text //input[@id='477baa88-ed7f-4f3b-d646-faebc05ca97a-arr'] Tampere
${get text} get text //div[@data-select-connection-callback='selectConnection(theConnection)']
Log To Console ${get text}
#Append to file testi1.csv ${get text}
Close Browser
#END
#${get_text} Get WebElements ${NAVIGATION}