Feedback - 5/13/2019, 4:08:32 PM


#1

Hello,

as I am new to Webtestit, I went through the ‘Quickstart: Create your first test’ chapter to start experimenting, and when I ran the tests, I got the following errors:

test/tests/Test1.ts(13,24): error TS2552: Cannot find name ‘HeaderPo’. Did you mean ‘header’?

test/tests/Test1.ts(14,24): error TS2304: Cannot find name ‘DetailPagePo’.
test/tests/Test1.ts(17,45): error TS2304: Cannot find name ‘Key’.
test/tests/Test1.ts(19,18): error TS2304: Cannot find name ‘title’.
test/tests/Test1.ts(25,24): error TS2552: Cannot find name ‘HeaderPo’. Did you mean ‘header’?
test/tests/Test1.ts(26,24): error TS2304: Cannot find name ‘DetailPagePo’.

Have you any idea why the page objects’ names are not recognized?

Thank you for your help.

B Plivard

SentryId: 0cebde83f4654060b8960edde0c51633

Email: [email protected]


unlisted #2

#3

Hello @bplivard!
Well as the error says, maybe you have some issues with Page Object instantiation. You can see in the first line of your error that the issue is located in the Test1.ts file on line 13. So you can try to check out what is wrong there. In order to use the actions from your Page Object, you first need to instantiate them in the test itself.
Can you please try to download and run one of our sample projects? You can do this from the welcome screen under the Samples category and see if the tests are running for you.
in this forum you can find usefull how to posts, like Test execution workflow, and I am sure it will give you more of an understanding of Ranorex Webtestit.
If you still get errors during the test execution feel free to contact us!
Kind regards


#4

Hello Smatijas,

thank you for you quick reply.

As you must have guest, I am new to development, so there are a few things
I don’t necessarily think about straigth away.
The reason the page objects were not recognized was quite simple:
I had not declared that they need to be imported first, at the top of the test file.
(import { LoginPage } from ‘…/pageobjects/LoginPage’; for instance).

The thing is, though, I only realized this after having opened the file in Visual Studio,
where the suggestion to import the class was automatically provided by the tool…

Could this be a suggestion for an improvement for the not so development savvy testers?

Have a nice day.
Best regards


#5

Hi @bplivard!
We are happy that you are finding your way around our tool! About the import stuff - we have quick fix feature in place, so in case of a missing import, you have the possibility to auto-import the missing Page Object files, like in the video I am sending you.

Also, there is the organize import feature to have all your imports fixed and well organized :slight_smile: