Solved

How to use Selenium alongside Test SDK?

  • 12 December 2023
  • 3 replies
  • 48 views

Userlevel 4
Badge +1

I’m working on UI tests using Acumatica’s Test SDK which wraps around selenium. There are a number of things that I would like to do which the Test SDK does not seem to provide functionality for. My question is, can I use vanilla Selenium alongside the Test SDK and if so how? Specifically I’m wondering how/if I could go about connecting to the same WebDriver(which to my understanding is how Selenium sends commands to the browser). When I try creating a new WebDriver and using that it ends up creating a new browser window which is not what I’m wanting.

 

Other info 

Browser : Chrome

OS : Windows 10

Acumatica Version : 23r2

 

Here is the sample code I used to create a new WebDriver but like I said it opens in a new window not the window that is already open. 

var driver = new ChromeDriver("C:\\Projects\\TestSDK_23_105_0016_17\\Chrome");

 

icon

Best answer by AaronB 18 December 2023, 15:40

View original

3 replies

Userlevel 4
Badge +1

Hi @AaronB

Pinging you on this since you seemed to indicate that Selenium code could be used alongside the Acumatica TestSDK in this thread :
 

 

Thanks,
Philip Engesser

Userlevel 4
Badge +1

Hi Thanks for the ping!

You can use Browser.WebDriver to use the same browser window I believe. Browser comes from 
“using Core.Core.Browser;”

 

Here is an example.
var paybtn = Browser.WebDriver.FindElement(By.XPath("//button[@id='payBtn']"));

Userlevel 4
Badge +1

@AaronB thank you very much, that worked great!

Just as a note for any one else who might read this thread later on, I also had to switch to the main iframe in order to get Selenium to find elements in the main area of the page since Acumatica uses iframe’s for the main body of the different pages. Sample code is below.

Browser.WebDriver.SwitchTo().Frame("main");

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved