0
votes
*** Setting ***
Library    DateTime
Library    OperatingSystem
Library    Selenium2Library
Suite Teardown    Close Application
Resource    ../Custom Keywords/BrowserKeywords.robot
*** Test Cases ***
Create Case
    Open Browser    https://login.salesforce.com/    chrome
    Sleep    5s
    Maximize Browser Window
    Input Text    //input[@id='username']    XXXXXXXXXXXXXXXX
    Input Password    //input[@id='password']    XXXXXXXXXXXXXX
    Click Button    //input[@id='Login']
    Sleep    2s
    Click Element    //li[contains(@id,'Case_Tab')]
    Sleep    2s
    Click Button    //input[contains(@name,'new')]
    Sleep    5s
    Click Image    //img[@alt='Contact Name Lookup (New Window)']
    sleep    15s  
    Select Window    title='Search ~ Salesforce - Developer Edition'
    Sleep    5s
    Select Frame    //frame[@id="searchFrame"]
    Input Text    //input[@id='lksrch']    Test
    Click Button    //input[@name='go']
    Close Window
    Close all Browsers

Output:

KEYWORD Selenium2Library . Select Window title='Search ~ Salesforce - Developer Edition'

Documentation:

Selects the window matching locator and return previous window handle. Start / End / Elapsed: 20170801 12:40:14.275 / 20170801 12:40:14.701 / 00:00:00.426

00:00:00.339 KEYWORD Selenium2Library . Capture Page Screenshot

12:40:14.700 FAIL NoSuchWindowException: Message: no such window
(Session info: chrome=59.0.3071.115) (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10586 x86_64)

1

1 Answers

0
votes

I don't know if this is the only problem, but part of the problem is the quotes you have around the title. Unless the actual title has actual quotes, you need to remove them.

Select Window    title=Search ~ Salesforce - Developer Edition