-1

I can not select new window after clicking on lookup icon

*** Settings ***  
Suite Setup         Run Keywords    Test_Setup    AND    Salesorce_Auth

*** Test Cases ***

    Create_Contact  
        Click Element    //*[@id="Contact_Tab"]/a  
        Click Button    //input[contains(@name,'new')]    
        Sleep    5s  
        Click Element   //img[@alt='Account Name Lookup (New Window)']  
        sleep    15s  
        Select Window    title=Search ~ Salesforce - Developer Edition  
        Sleep    5s  
        Select Frame    //frame[@id="searchFrame"]

Getting the following error:

NoSuchWindowException: Message: no such window

Is a better way to input text on lookup window or perform lookup search using Robot Framework?

Also looks like "get window titles" does not return titles of the browser windows after i click on the lookup icon. (But it displays one item prior to clicking on the lookup icon)

Neha
  • 3
  • 3
  • 1
    Are you using plain SeleniumLibrary or in combination with SalesForce's [CumulusCI Robot Framework extension/library](https://cumulusci.readthedocs.io/en/latest/robotframework.html) – A. Kootstra Dec 19 '18 at 18:47
  • I am using Selenium2Library in combination with cumulusCI extension – Neha Dec 19 '18 at 18:56
  • Thank you A. Kootstra, I will try to use the populate lookup field function from cumulsci – Neha Dec 20 '18 at 20:21
  • I was able to get it to work using the function from cumulsci lib. Thanks! – Neha Jan 08 '19 at 13:31

1 Answers1

1

the get window titles should pick all of your open windows titles, by default your newest opened window should be the last tab in your browser, my example uses 2 tabs, the ${tab[1]} holds the title of the new window.

*** Settings ***  
Suite Setup         Run Keywords    Test_Setup    AND    Salesorce_Auth

*** Test Cases ***

Create_Contact  
    Click Element    //*[@id="Contact_Tab"]/a  
    Click Button    //input[contains(@name,'new')]    
    Sleep    5s  
    Click Element   //img[@alt='Account Name Lookup (New Window)']  
    sleep    15s  
    ${Tabs} =   Get Window Titles
    select window  title=${Tabs[1]} 
    Sleep    5s  
    Select Frame    //frame[@id="searchFrame"]
AutoTester213
  • 2,714
  • 2
  • 24
  • 48