I have below code in my custom keword file(ex: sample.py")
'''
Created on Jul 25, 2017
@author: simbolla
'''
from robot.api import logger
from robot.libraries.BuiltIn import BuiltIn
from Selenium2Library import Selenium2Library
from selenium import webdriver
def myseleniumkeyword():
logger.info("my logger", also_console = True)
selenium = BuiltIn().get_library_instance('Selenium2Library')
selenium._current_browser.find_element_by_id("lst-ib").send_keys("simba")
btn=selenium._current_browser.find_element_by_name('btnK')
selenium._current_browser.execute_script("arguments[0].click()",btn)
Robot festcase :
*** Settings ***
Library Selenium2Library
Library C:/Softwares/seleniumtest/selenium2/sample.py
*** Test Cases ***
sample
Open Browser http://www.google.com ie
Mykeword
*** Keywords ***
mykeword
myseleniumkeyword
When I tried to use my custom library in robot testcase , its throwing me this error "AttributeError: 'function' object has no attribute 'find_element_by_id'" in the result.
please some body guide me what is the mistake I am doing here.
Stack : Windows 8 professional, Python 2.7.12 , robotframework 3.0.2 , robotframework -Selenium2Library 1.8.0 ,Robotframework-ride 1.5.2.1
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsubscrib...@googlegroups.com.