testproject-io / csharp-opensdk

TestProject OpenSDK For C#
https://testproject.io
Apache License 2.0
16 stars 12 forks source link

Report doesnt show results properly #227

Open Chrys123 opened 3 years ago

Chrys123 commented 3 years ago

It still fails intermittently on findElement and it doesnt show screenshot on the failed end result findElement no screenshot

Chrys123 commented 3 years ago

This is on Open SDK C#

s-glatshtein commented 3 years ago

Hi Chrys. Couple of questions for clarification:

Chrys123 commented 3 years ago

So the screenshot issue on failure is consistent. I cant see the screenshot that the failed test is generated. I am using SDK 65

s-glatshtein commented 3 years ago

0.65? It's pretty old. I'm assuming your version is a little newer :) What about the code that looks for this element? can you share it please?

Chrys123 commented 3 years ago

1.22

On Wed, 14 Jul 2021, 14:11 Shai Glatshtein, @.***> wrote:

0.65? It's pretty old. I'm assuming your version is a little newer :) What about the code that looks for this element? can you share it please?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/testproject-io/csharp-opensdk/issues/227#issuecomment-879879246, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHZJAVDC3OCBCOASBKQPRGLTXWEJRANCNFSM5AAUH6PQ .

s-glatshtein commented 3 years ago

Can you please share the code that looks for this element? Without the code sample we cannot solve the problem.

Chrys123 commented 3 years ago
    public bool atRevalidationAppSixthStepSummaryPage(string date, string enddate,string employmenttype, string scopeofpractice, string registrationarea){
    boolResult = this.driver.FindElement(this.datesColumn).Displayed;
    Assert.AreEqual(this.driver.FindElement(this.datesColumnContainer).Text, date);
    //Assert.AreEqual(this.driver.FindElement(this.toDateContainer).Text, enddate);
    boolResult = this.driver.FindElement(this.typeOfEmploymentColumn).Displayed;
    Assert.AreEqual(this.driver.FindElement(this.typeOfEmploymentColumnContainer).Text, employmenttype);
    boolResult = this.driver.FindElement(this.scopeOfPracticeColumn).Displayed;
    Assert.AreEqual(this.driver.FindElement(this.scopeOfPracticeColumnContainer).Text, scopeofpractice);
    ****boolResult = this.driver.FindElement(this.workSettingColumn).Displayed;****
    Assert.AreEqual(this.driver.FindElement(this.workSettingColumnContainer).Text, registrationarea);
    return true;
  }

The bold above is where it seems to fail in the report. In the dev environment is fine

{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//th[. = 'Work setting']\"}\n (Session info: chrome=91.0.4472.124)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00AF3733+2504499]\n\tOrdinal0 [0x00A8C401+2081793]\n\tOrdinal0 [0x00992628+1058344]\n\tOrdinal0 [0x009BCEBB+1232571]\n\tOrdinal0 [0x009E68F2+1403122]\n\tOrdinal0 [0x009D5EBA+1334970]\n\tOrdinal0 [0x009E4CDB+1395931]\n\tOrdinal0 [0x009D5D4B+1334603]\n\tOrdinal0 [0x009B22B4+1188532]\n\tOrdinal0 [0x009B3149+1192265]\n\tGetHandleVerifier [0x00C6FB8C+1512252]\n\tGetHandleVerifier [0x00D1B0DF+2214031]\n\tGetHandleVerifier [0x00B74BC3+484211]\n\tGetHandleVerifier [0x00B73E69+480793]\n\tOrdinal0 [0x00A9218D+2105741]\n\tOrdinal0 [0x00A966E8+2123496]\n\tOrdinal0 [0x00A96827+2123815]\n\tOrdinal0 [0x00A9FB73+2161523]\n\tBaseThreadInitThunk [0x74F40419+25]\n\tRtlGetAppContainerNamedObjectPath [0x776172FD+237]\n\tRtlGetAppContainerNamedObjectPath [0x776172CD+189]\n"}

s-glatshtein commented 3 years ago

Thanks for the information. I'll start working on it from our end. In the meanwhile, it would help me if when it happens to you again you would send me the agent logs over intercom. It has to be right after the execution or the logs will be overwritten. I'll keep you posted when i find the root cause

SantoshYakkala commented 3 years ago

You have the screenshot in your local HTML report, but not on the report submitted to the server. @s-glatshtein @Chrys123 I think this issue was fixed as part of the latest agent 3.1.0. It was happening because of the report timeout. Now it is not happening on the latest agent.

s-glatshtein commented 3 years ago

Hi @Chrys123. We released a new C# SDK which (among other things) takes into account the result of element.Displayed and Invisibility checks. Can you please try it and see if it helps with you issue?

Chrys123 commented 3 years ago

I will get back to you shortly.

On Thu, 26 Aug 2021, 16:23 Shai Glatshtein, @.***> wrote:

Hi @Chrys123 https://github.com/Chrys123. We released a new C# SDK which (among other things) takes into account the result of element.Displayed and Invisibility checks. Can you please try it and see if it helps with you issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/testproject-io/csharp-opensdk/issues/227#issuecomment-906509454, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHZJAVAVAPMWGWLCMQXBVFDT6ZMAPANCNFSM5AAUH6PQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

Chrys123 commented 3 years ago

Still problematic. I ran now coded tests from the platform. The tests are ran as normal but the results wrong 1 passed and 2 show as skipped. also it doesnt show the correct number of browsers wrong results 1 wrong results

Chrys123 commented 3 years ago

There is no problem with the tests actually running

s-glatshtein commented 3 years ago

Hi @Chrys123. Right now it is required that the driver created by the test is the safe as the browser it targets in the platform. That means if your test creates a FirefoxDriver you have to run it on a Firefox browser only. Running it on Chrome will give the error you showed.

Chrys123 commented 3 years ago

But I don't understand the error. I'm creating Firefox for Firefox. I don't have this issue when I run the tests from development.

Also from cloud they run as normal but at the end they throw errors.

I don't understand all this and I hope the problems are solved soon

On Sun, 5 Sep 2021, 07:03 Shai Glatshtein, @.***> wrote:

Hi @Chrys123 https://github.com/Chrys123. Right now it is required that the driver created by the test is the safe as the browser it targets in the platform. That means if your test creates a FirefoxDriver you have to run it on a Firefox browser only. Running it on Chrome will give the error you showed.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/testproject-io/csharp-opensdk/issues/227#issuecomment-913092506, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHZJAVGZDAO6WTB6HRSZPUDUAMB23ANCNFSM5AAUH6PQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

s-glatshtein commented 3 years ago

Your tests wants to create a firefox driver, but you ran it in the platform as a chrome browser

Chrys123 commented 3 years ago

Not really, the tests are parametrised anyway so I am not sure what do you mean by that

s-glatshtein commented 3 years ago

Basically there's a conflict between the target you select in the platform and the type of driver used in your test. Your test settings indicate the test is expected to run in Chrome, as follows: image

The error is telling me the test you executed has tried to create a FirefoxDriver. This is what's causing the error message you are seeing.

Chrys123 commented 3 years ago

I’m using all 4 drivers in the initialization in a case/switch loop and i parametrise the browsers that I want to execute in my test classes, as I need to execute in different browsers.

I select exactly the same versions on the platform.

It should work like it does in my dev environment.

So this result is not justified.

Please fix this issue

On Tue, 14 Sep 2021 at 4:41 PM Shai Glatshtein @.***> wrote:

Basically there's a conflict between the target you select in the platform and the type of driver used in your test. Your test settings indicate the test is expected to run in Chrome, as follows: [image: image] https://user-images.githubusercontent.com/58419147/133289405-79057b3d-7962-4d0b-960d-913a552fdce6.png

The error is telling me the test you executed has tried to create a FirefoxDriver. This is what's causing the error message you are seeing.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/testproject-io/csharp-opensdk/issues/227#issuecomment-919273221, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHZJAVFQGXGLGWZJHPCHTT3UB5UMHANCNFSM5AAUH6PQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Chrys123 commented 2 years ago

It seems that this issues does not happen anymore but all the others do!

It reports false results. Failed element clicks etc.

It doesnt show the browser count either.

Please fix this issue asap