1
votes

Hi I have exported the below test case from Katalon recorder to Robot Framework code.I am trying to run this in PyCharm or RIDE using Python 2.7. PyCharm and RIDE both seem to not like the Resource seleniumLibrary.robot code.

How can I import this seleniumLibrary.robot file? Where is it? I have downloaded Robot Framework, SeleniumLibrary, Selenium2Library, WxPython, and RIDE and all are working now I am just trying to get this code to run.

I followed the instructions below to get up and running

http://seleniummaster.com/sitecontent/index.php/selenium-robot-framework-menu/selenium-robot-framework-python-menu/191-selenium-robot-framework-installation-with-python

*** Settings ***
Suite Setup    Open Browser    https://www.katalon.com/    firefox
Suite Teardown    Close Browser
Resource    seleniumLibrary.robot

*** Variables ***
${undefined}    https://www.katalon.com/

*** Test Cases ***
Test Case
    open    https://abcxyz.com/catalog-portal/
    click    xpath=//div[5]/div/div[2]/img
    selectWindow    win_ser_1
    selectFrame    index=0
    click    xpath=//td[@onclick="if (warnUnfinishedPage()) return false; changePage('pc.quote.html.QuoteSummarySection','refresh');  return false;"]
    click    xpath=(.//*[normalize-space(text()) and normalize-space(.)='Email'])[1]/following::td[5]
    type    name=t1st__TBOX    603449
    click    xpath=(.//*[normalize-space(text()) and normalize-space(.)='All'])[2]/following::input[1]
    click    link=Q603449
    click    link=Email
    addSelection    id=null    Doe, John ([email protected])
    click    xpath=(.//*[normalize-space(text()) and normalize-space(.)='Email this Quote'])[1]/following::input[2]
    select    name=FORMAT    Text
    click    link=Send
    close    win_ser_1
    selectWindow    win_ser_local
    close    win_ser_local
2
This is the first search result for "katalon seleniumLibrary.robot": forum.katalon.com/discussion/4216/robot-framework-issue - Bryan Oakley
I saw that, but I already have selenium2library installed. I don’t see a file called seleniumLibrary.robot on my c drive anywhere. Do I need to put the files somewhere. I’m lost. Any help is appreciated. - Joe Rivera
I would really encourage you to read the answer given in the link by @bryan more thoroughly. It does not say you should find it on your hard drive. - A. Kootstra
Why are you being aggro, Kootstra? If you know the answer to the problem, just tell us. I read the link by Bryan, it is not immediately clear what to do with that file (seleniumLibrary.robot), how to connect it, etc. - Gleb Varenov

2 Answers

0
votes

The settings and variables sections are mostly placeholders. You should customize these to be compatible with the development environment you have created.

In this case the resource file seleniumLibrary.robot needs to be created in the Resources folder of your project.

EXAMPLE FOR COMPLETELY NEW PROJECT:

  1. Create a new folder for your project
  2. Create folder named "Resources" in the root of your project folder
  3. Create folder named "Testsuites" in the root of your project folder
  4. Create a testsuite file in the "Testsuites" folder (f.ex "01_testsuite.robot")
  5. Copypaste your imported code from katalon recorder to this testuite file
  6. Create "seleniumLibrary.robot" file in the resources folder.
  7. Copy paste this code in the file. Note the Library line in the beginning of the file.
  8. Open the project folder in RIDE
  9. If your development environment has been setup correctly you should be able to run your testsuite and/or testcase with RIDE.
0
votes

Try to remove that resource line in the code and change it to Library Selenium2Library. I think the issue is that katalon studio is generating a code that uses seleniumlibrary.