- cslewis56
- Posts : 1
Join date : 2015-02-27
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:
The problem is that most Selenium and PhantomJS code examples show the "component Under Test" being tested by using a URL. For example,
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 ?
•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
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));
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 ?
- For every change in the code of selenium RC, Is that necesary to compile the selenium RC code every time.
- Upload and download examples using selenium RC
- Need Selenium Webdriver + Excel sheet examples
- Selenium Tutorials with Practice Exercises and Complete Examples (ToolsQA.com)
- Can I set the GeckoDriver path in selenium programatically when using node?
Permissions in this forum:
You cannot reply to topics in this forum