Reputation: 293
I'm surprised to see this error message when executing Test Automation using RobotFramework with RED editor. Plz guide me on this issue getting rectified.
I dont have any test case called "Filter the customer". When running my suite it shows up the below error.
Note: I did the below, even then I'm having this issue. 1. I cleaned the Project 2. I also deleted and re-added the modified libraries. 3. Saved all the updated files.
The source is as below,
*** Setting ***
Resource ../KCC_Automation/ResourceFiles/KCC_Resource.txt
*** Test Cases ***
Login with valid credentials
Logon to KCC browser
Enter User Name
Enter Password
Click Login
Show Customers available in Customer List Page
Get the customer names and click them from Customer List Page
Begin the New Assessment for an opportunity
Filter by Customer Search
Expand the customer details and begin the New Assessment
Stop Testing
Logout of KCC
And the resource file is as below,
*** Keywords ***
Welcome1
${message} say hi
Log ${message}
Welcome2
${message} say hi Testers
Log ${message}
Welcome3
${message} type of 42
Log ${message}
Logon to KCC browser
Open Browser ${LOGIN URL} ${BROWSER}
Wait Until Page contains Element ${UserName_Field}
Enter User Name
Input Text ${UserName_Field} ${USERNAME}
sleep 2s
Enter Password
Input Text ${Password_Field} ${PASSWORD}
sleep 2s
Click Login
Click Element ${LoginButton}
sleep 5s
Get the customer names and click them from Customer List Page
set selenium speed 5s
wait until element is visible ${customers_grid}
wait until page contains element ${customers_grid}
sleep 3s
@{customers} get webelements ${customer_list}
${items} Store Texts @{customers}
#${items} storeTexts @{customers}[2]
${store} get text ${items}
Log ${store}
Filter by Customer Search
set selenium speed 5s
input text ${Customer_Search} ${Search_Text}
sleep 3s
${Entered_text}= get value ${Customer_Search}
should be equal ${Search_Text} ${Entered_text} The given message is incorrect true
Expand the customer details and begin the New Assessment
wait until page contains element ${customer_list}
click element ${customer_list}
sleep 2s
click element ${opportunity-status}
sleep 2s
click element ${forward_button}
sleep 2s
click element ${Btn_Add_Building}
sleep 2s
Logout of KCC
In the source file, I re-placed the test case name "Begin the New Assessment for an opportunity" by "filter the customers" as because earlier i named this testcase like this, executing it showing up below issue now, Is this RED editor issue?
[ ERROR ] Unexpected error: NoClassDefFoundError:
org/openqa/selenium/WebElement
java.lang.NoClassDefFoundError:
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetPublicMethods(Class.java:2902)
at java.lang.Class.getMethods(Class.java:1615)
at robot.utils.importer$py.import_$32(C:\jython2.7.0\Lib\site-packages\robot\utils\importer.py:274)
at robot.utils.importer$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\utils\importer.py)
at robot.utils.importer$py._import_class_or_module$5(C:\jython2.7.0\Lib\site-packages\robot\utils\importer.py:77)
at robot.utils.importer$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\utils\importer.py)
at robot.utils.importer$py.import_class_or_module$4(C:\jython2.7.0\Lib\site-packages\robot\utils\importer.py:74)
at robot.utils.importer$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\utils\importer.py)
at robot.model.visitor$py.visit_suite$2(C:\jython2.7.0\Lib\site-packages\robot\model\visitor.py:88)
at robot.model.visitor$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\model\visitor.py)
at robot.model.testsuite$py.visit$19(C:\jython2.7.0\Lib\site-packages\robot\model\testsuite.py:161)
at robot.model.testsuite$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\model\testsuite.py)
at robot.model.itemlist$py.visit$11(C:\jython2.7.0\Lib\site-packages\robot\model\itemlist.py:75)
at robot.model.itemlist$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\model\itemlist.py)
at robot.model.visitor$py.visit_suite$2(C:\jython2.7.0\Lib\site-packages\robot\model\visitor.py:88)
at robot.model.visitor$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\model\visitor.py)
at robot.model.testsuite$py.visit$19(C:\jython2.7.0\Lib\site-packages\robot\model\testsuite.py:161)
at robot.model.testsuite$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\model\testsuite.py)
at robot.utils.application$py._execute$10(C:\jython2.7.0\Lib\site-packages\robot\utils\application.py:94)
at robot.utils.application$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\utils\application.py)
at robot.utils.application$py.execute_cli$5(C:\jython2.7.0\Lib\site-packages\robot\utils\application.py:49)
at robot.utils.application$py.call_function(C:\jython2.7.0\Lib\site-packages\robot\utils\application.py)
at runpy$py._run_code$9(C:\jython2.7.0\Lib\runpy.py:73)
at runpy$py.call_function(C:\jython2.7.0\Lib\runpy.py)
at runpy$py._run_module_as_main$14(C:\jython2.7.0\Lib\runpy.py:161)
at runpy$py.call_function(C:\jython2.7.0\Lib\runpy.py)
Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.WebElement
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 191 more
Upvotes: 0
Views: 378
Reputation: 6981
Looking at the error it seems to me that you don't have the Selenium2Library loaded Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.WebElement
You can load a library by using the syntax:
*** Settings ***
Library Selenium2Library
Please keep in mind that this library requires either a pip install robotframework-selenium2library
or to install the Java Port of the Selenium2Library
Although I can't be sure, I suspect that when this issue is resolved your other problem is also fixed.
Upvotes: 1