Skip to main content
Solved

How to use Selenium alongside Test SDK?


Forum|alt.badge.img+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");

 

Best answer by AaronB

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']"));

View original
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+1
  • Author
  • Varsity I
  • 28 replies
  • December 18, 2023

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


AaronB
Varsity II
Forum|alt.badge.img+1
  • Varsity II
  • 30 replies
  • Answer
  • December 18, 2023

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']"));


Forum|alt.badge.img+1
  • Author
  • Varsity I
  • 28 replies
  • December 18, 2023

@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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings