Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
cslewis56
Posts : 1
Join date : 2015-02-27

Selenium and PhantomJS code examples that use directory path as opposed to using a URL Empty Selenium and PhantomJS code examples that use directory path as opposed to using a URL

Fri Feb 27, 2015 1:39 pm
Here are the details of my Development Environment:
•Visual Studio 2012 Ultimate with Update 4
•Google Chrome Version 38.0.2125.111 m
•Selenium Chrome Driver Win 32 2.12
•Windows 7 Professional with 32-bit Operating System
•Phantom JS 1.9.8
•NUnit 2.6.3
One of our Customers wanted us to create Test Harness Webpages that we can use to test various UI components of our web application.
The Test Harness should be Simple Webpage where we can test the ViewPanel of the web application or the Footer for the Web application.
It's the components like the ViewPanel or the footer that could be complex, but the Test Harness WebPage should be simple. Think of the Test Harness as an Isolated Science Laboratory area. We could have a Test Harness dedicated to testing a ViewPanel of the web application. Another Test Harness dedicated to testing a Footer of the web application.
In our Test Harness Webpage design, we load the "UI component Under Test" into the Test Harness Webpage by specifying the directory path ( relative path or absolute path ) that leads to the "UI component Under Test"
For example, our Test Harness Webpage code will specify a directory path ( relative path or absolute path ) like the following:
Code:
D:\WrkSpce\BlahBlahApplicationProjectBlahBlah\MainSection\BlahBlahSidePanelBlahBlah.aspx

or

\MainSection\BlahBlahFooterBlahBlah.cshtml
Therefore, our Test Harness Webpage does Not use a URL to locate the "UI component Under Test", but rather a directory path ( relative path or absolute path ) within the computer system.
The problem is that most Selenium and PhantomJS code examples show the "component Under Test" being tested by using a URL. For example,
Code:
ChromeOptions options = new ChromeOptions();
options.AddArgument("--start-maximized");
options.AddArgument("--disable-extensions");

IWebDriver driver =  new ChromeDriver(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\..\SeleniumConfigFiles"), options);

Uri  url = new Uri("http [colon] [forward slash] [forward slash]  localhost [colon] 2816 [forward slash]");    // Notice the URL being Used
IWait<IWebDriver> wait = new OpenQA.Selenium.Support.UI.WebDriverWait(driver, TimeSpan.FromSeconds(30.00));
Our team was interested in integrating Selenium and/or PhantomJS technology into the Test Harness Webpages
However, Most Selenium and PhantomJS code examples show the "component Under Test" being tested by using a URL. Our Test Harness Webpage loads the "UI component Under Test" by specifying the directory path ( relative path or absolute path ).
Could someone please show some Selenium and PhantomJS code examples that show the "component Under Test" being loaded by specifying the directory path ( relative path or absolute path ) within the computer system as opposed to using a URL ?
Back to top
Permissions in this forum:
You cannot reply to topics in this forum