Hello friends

I have question about automating testing.

Currently I started using selenium webdriver on C#, I made onetest but there is a problem. After publishing and deploying product fromdevelopment environment to test environment html id and name are changing likein this example:

one button had an id: om_apm_wt123:wtMainContent:om_util_wt142:wtMain:om_apm_los_wt71:block:wtPrintButton

and now it has

om_apm_wt123:wtMainContent:om_util_wt152:wtMain:om_apm_los_wt76:block:wtPrintButton

 

So, it makes writing automated test cases kind a complicated. Doanyone had the same issue? Or which program or tool do you use for creatingautomated tests on Outsystems web applications?..

 

Thank you in advance for your any advice or answer.

 

Sincerely,

 

Lasha

Lasha Gagnidze wrote:

Hello friends

I have question about automating testing.

Currently I started using selenium webdriver on C#, I made onetest but there is a problem. After publishing and deploying product fromdevelopment environment to test environment html id and name are changing likein this example:

one button had an id: om_apm_wt123:wtMainContent:om_util_wt142:wtMain:om_apm_los_wt71:block:wtPrintButton

and now it has

om_apm_wt123:wtMainContent:om_util_wt152:wtMain:om_apm_los_wt76:block:wtPrintButton

 

So, it makes writing automated test cases kind a complicated. Doanyone had the same issue? Or which program or tool do you use for creatingautomated tests on Outsystems web applications?..

 

Thank you in advance for your any advice or answer.

 

Sincerely,

 

Lasha

Hi Lasha Gagnidze,

https://success.outsystems.com/Documentation/Development_FAQs/How_to_do_UI_testing_with_Selenium

You can have refrence here

regards,

amreen


Hey Lasha,

Here's a simple approach. The last part of the Id never changes because it is the name the developer has given that widget in Service Studio. So you can use the "ends with" CSS selector that just checks for the end of the id.

Like so:

*[id=$PrintButton]

Here's the w3 reference:

 https://www.w3schools.com/cssref/sel_attr_end.asp

Lasha Gagnidze wrote:

Hello friends

I have question about automating testing.

Currently I started using selenium webdriver on C#, I made onetest but there is a problem. After publishing and deploying product fromdevelopment environment to test environment html id and name are changing likein this example:

one button had an id: om_apm_wt123:wtMainContent:om_util_wt142:wtMain:om_apm_los_wt71:block:wtPrintButton

and now it has

om_apm_wt123:wtMainContent:om_util_wt152:wtMain:om_apm_los_wt76:block:wtPrintButton

 

So, it makes writing automated test cases kind a complicated. Doanyone had the same issue? Or which program or tool do you use for creatingautomated tests on Outsystems web applications?..

 

Thank you in advance for your any advice or answer.

 

Sincerely,

 

Lasha

Hi,


In selenium there is a command to find the element. Please look at the example below:


webdriver.findElement(By.xpath("//*[contains(@id,'PrintButton')]")).click()

This command will work in both testing  and development environment.


P.S.:This is a command done  in java you can edit it to use in C# Code.


Regards,

Manthan Shah.