-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to do when lots of page objects are in different directories? #8
Comments
Currently, the only solution is to make sure that func1_subfolder`,
func1_subfolder1, etc are all in your PYTHONPATH. The page object library
uses the core robot mechanism for finding libraries, and it only searches
in PYTHONPATH.
One simple solution might be to create a keyword that runs in each suite's
setup that adds ${CURDIR} to PYTHONPATH
…On Mon, Jul 17, 2017 at 10:51 PM, bajiacun ***@***.***> wrote:
Hi,
My product is very complex, it has more than 100 pages, so I don't want to
put all the page objects files in the same level's directory. I try to
organize the page objects by function as below.
The folder structure:
demo
|-- resources
| |-- function1_folder
| | |-----func1_subfolder1
| | | |------page1
| | | |------page2
| | |-----func1_subfolder2
| | | |------page3
| | | |------page4
| | |-----page5
| |-- function2_folder
| | |-----page6
| | | ----page7
|-- results
|-- tests
|-- test1.robot
|-- test2.robot
I can execute my test cases when all the pages are in the same directory,
but when I organize the pages as above, "The current page should be"
keyword can't find the module name "page1" , "page2" and so on.
Can you tell me how to use this library to test the pages as show above,
thank you very much.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#8>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABEmYg4n_Ni1xn2dCgoQfaloRSfKgx4cks5sPCumgaJpZM4Oaz8U>
.
|
@boakley , thank you very much for your answer. as you said "add ${CURDIR} to PYTHONPATH", can you give me an example, sorry, I am new for robot framework, in my opinion, ${CURDIR} is the directory of the testsuite, but the pages are not in this directory, so how to get the pages directory and how to add it to the PYTHONPATH, thank you very much. |
@CTHakkas - if you check this project's
All you need to change is in config.py the path to your |
Hi,
My product is very complex, it has more than 100 pages, so I don't want to put all the page objects files in the same level's directory. I try to organize the page objects by function as below.
The folder structure:
demo
|-- resources
| |-- function1_folder
| | |-----func1_subfolder1
| | | |------page1
| | | |------page2
| | |-----func1_subfolder2
| | | |------page3
| | | |------page4
| | |-----page5
| |-- function2_folder
| | |-----page6
| | | ----page7
|-- results
|-- tests
|-- test1.robot
|-- test2.robot
I can execute my test cases when all the pages are in the same directory, but when I organize the pages as above, "The current page should be" keyword can't find the module name "page1" , "page2" and so on.
Can you tell me how to use this library to test the pages as show above, thank you very much.
The text was updated successfully, but these errors were encountered: