Hello everyone
i am a Maxime, beginner in RobotFramework and I am facing issue.
I am working with Python 3.9 and Robot 3.2.2.
I try to write some code to test a web application. For this I write python Class who use selenium to launch application under a web browser (Chrome).
To test it I need to launch 2 instances of my class.
When I do that with robot, it seems that robot use only the last version of my class (wrong driver)
here my example:
My robot code:
** Settings ***
Library AppUI WITH NAME UI1
Library AppUI WITH NAME UI2
*** Keywords ***
Test CheckCall
UI1.open application
UI2.open application
UI1.login login password #In this case Robot use last openned browser UI2 browser
UI2.login login password #This failed because login page is not display he already login …
Because I haven’t any answer maybe my issue is not clear so I write an example to reproduce this issue.
I am new user so I can not upload file so I will juste copy my code here:
My python lib :
from time import sleep
from selenium import webdriver as webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.by import By
class AppUI(object):
ROBOT_LIBRARY_SCOPE = ‘GLOBAL’
Here my robot test:
*** Settings ***
Library lib.appui.AppUI WITH NAME browser1
Library lib.appui.AppUI WITH NAME browser2
*** Keywords ***
Test Teardown
browser1.close application
browser2.close application
*** Test Cases *** #CHP O1
Test Search
[Teardown] Test Teardown
browser1.open application ${see_first_links_in_python_lib_new_user_can_only_put_2_links}
browser2.open application ${see_second_links_in_python_lib_new_user_can_only_put_2_links}
browser1.click forum logo
For me it is a robot issue, robot does not handle correctly class instances but maybe I am wrong and I do not use robot correctly so please if you guys have any idea how I can solve that tell me