Firefox headless not working as expected on azure devops raising NoSuchElementException - c#

I'm currently facing an issue trying to run a selenium web automation with firefox(headless) on azure devops, I have the same browser version installed on the windows agent but still I get errors.
It works fine for Chrome on Azure and also locally it works fine for firefox so not really sure what is causing this issue.
These are the logs:
NUnit3TestExecutor discovered 2 of 2 NUnit test cases using Current Discovery mode, Non-Explicit run
1640697828054 geckodriver INFO Listening on [::1]:58930
1640697828085 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "--marionette" "enable-automation" "--no-sandbox" "--headless" "--disable-gpu" "--window-size=1920,1080" "-foreground" "-no-remote" "-profile" "C:\\Users\\agent\\AppData\\Local\\Temp\\rust_mozprofileQUnaTu"
1640697829048 Marionette INFO Marionette enabled
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at C:\\Users\\agent\\AppData\\Local\\Temp\\rust_mozprofileQUnaTu\\search.json.mozlz4", (void 0)))
1640697832365 Marionette INFO Listening on port 58933
1640697832633 RemoteAgent WARN TLS certificate errors will be ignored for this session
1640697866771 Marionette INFO Stopped listening on port 58933
Given is presented the home page
-> error: Timed out after 30 seconds (33.8s)
And the user enters his credentials "empty"
-> skipped because of previous errors
Then Corresponding error message is displayed "empty"
-> skipped because of previous errors
1640697868763 geckodriver INFO Listening on [::1]:59006
Failed LoginWithBadInput("empty",null) [41 s]
Error Message:
OpenQA.Selenium.WebDriverTimeoutException : Timed out after 30 seconds
----> OpenQA.Selenium.NoSuchElementException : Unable to locate element: //h2[contains(text(),'Sign in with your email address')]
Stack Trace:
at OpenQA.Selenium.Support.UI.DefaultWait`1.Until[TResult](Func`2 condition)
at LFL.Automation.Framework.Actions.BaseActions.WaitFor(By by) in C:\agent\_work\3\s\Automation.Financial.Framework\Actions\BaseActions.cs:line 34
at ClientPortalAutomationFinal.Pages.LoginPage.ConfirmLoginPage() in C:\agent\_work\3\s\ClientPortalAutomationFinal\Pages\LoginPage.cs:line 49
at ClientPortalAutomationFinal.Steps.LoginSteps.GivenIsPresentedTheHomePage() in C:\agent\_work\3\s\ClientPortalAutomationFinal\Steps\LoginSteps.cs:line 29
at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch match, Object[] arguments, TimeSpan& duration)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(IContextManager contextManager, StepInstance stepInstance)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep()
at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors()
at ClientPortalAutomationFinal.Features.LoginFeature.ScenarioCleanup()
at ClientPortalAutomationFinal.Features.LoginFeature.LoginWithBadInput(String flag, String[] exampleTags) in C:\agent\_work\3\s\ClientPortalAutomationFinal\Features\Login.feature:line 8
--NoSuchElementException
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElementByXPath(String xpath)
at OpenQA.Selenium.By.<>c__DisplayClass19_0.<XPath>b__0(ISearchContext context)
at OpenQA.Selenium.By.FindElement(ISearchContext context)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(By by)
at LFL.Automation.Framework.Actions.BaseActions.<>c__DisplayClass11_0.<WaitFor>b__0(IWebDriver drv) in C:\agent\_work\3\s\Automation.Financial.Framework\Actions\BaseActions.cs:line 34
at OpenQA.Selenium.Support.UI.DefaultWait`1.Until[TResult](Func`2 condition)
Based on this looks like the browser it's opening but not able to navigate the website not really sure.
Hopefully someone has some idea of what could be the issue, thanks!

This error message...
OpenQA.Selenium.WebDriverTimeoutException : Timed out after 30 seconds
----> OpenQA.Selenium.NoSuchElementException : Unable to locate element: //h2[contains(text(),'Sign in with your email address')]
...implies that NoSuchElementException while trying to locate the element with the locator strategy.
Generally <h2> tags are header elements. Ideally, to locate any visible element you need to induce WebDriverWait for the ElementIsVisible() and you can use the following Locator Strategy:
Using XPath:
new WebDriverWait(driver, TimeSpan.FromSeconds(20)).Until(ExpectedConditions.ElementIsVisible(By.XPath("//h2[contains(., 'Sign in with your email address')]")));

Related

C# - selenium webdriver unable to open chrome browser window

Below is the selenium script to open chrome browser in C# on Windows 10 Visual Studio Code. I'm using Chrome 74 (64 bit) and corresponding ChromeDriver 74.0.3729.6. One thing to note is Chrome is not installed in default directory. This is due to our Office security purpose. It has installed in a different location. When I run the script It gives me error -Failed to create a Chrome process. Could some one please help me to understand why chrome browser isn't opening?
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using NUnit.Framework;
using SeleniumExtras.PageObjects;
namespace NAS
{
[TestFixture]
class Program
{
public static IWebDriver driver;
public Program(){}
[OneTimeSetUp]
public void startBrowser()
{
ChromeOptions opt = new ChromeOptions();
opt.BinaryLocation = #"C:\\ProgramData\\Microsoft\\AppV\\Client\\Integration\\520B8677-106E-430B-8927-6F9261C56329\\Root\\VFS\\ProgramFilesX86\\Google\\Chrome\\Application\\";
driver = new ChromeDriver(#"C:\\Progra~1\\Selenium",opt);
driver.Navigate().GoToUrl("http://www.google.com");
driver.Manage().Window.Maximize();
}
[Test]
public void testLogin()
{
Console.WriteLine("test running..");
}
[OneTimeTearDown]
public void closeBrowser()
{
driver.Close();
}
}
}
Error:
Running selected tests in c:\NAS\bin\Debug\netcoreapp2.2\NAS.dll
NUnit3TestExecutor converted 1 of 1 NUnit test cases
TearDown failed for test fixture NAS.Program
**OpenQA.Selenium.WebDriverException : unknown error: Failed to create a Chrome process.**
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729#{#29}),platform=Windows NT 10.0.14393 x86_64)
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
at NAS.Program.startBrowser() in c:\NAS\Program.cs:line 30
--TearDown
at NAS.Program.closeBrowser() in c:\NAS\Program.cs:line 46
NUnit Adapter 3.12.0.0: Test execution complete
NAS.Program.testLogin: failed
Total tests: 1. Passed: 0. Failed: 1. Skipped: 0
After adding executable name - chrome.exe
Running selected tests in c:\NAS\bin\Debug\netcoreapp2.2\NAS.dll
NUnit3TestExecutor converted 1 of 1 NUnit test cases
SetUp failed for test fixture NAS.Program
OpenQA.Selenium.WebDriverException : unknown error: Chrome failed to start: crashed
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location C:\ProgramData\Microsoft\AppV\Client\Integration\520B8677-106E-430B-8927-6F9261C56329\Root\VFS\ProgramFilesX86\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729#{#29}),platform=Windows NT 10.0.14393 x86_64)
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
at NAS.Program.startBrowser() in c:\NAS\Program.cs:line 28
NUnit Adapter 3.12.0.0: Test execution complete
NAS.Program.testLogin: failed
Total tests: 1. Passed: 0. Failed: 1. Skipped: 0
I think your just missing the executable name, like so for example
var chromeOptions = new ChromeOptions()
{
BinaryLocation = "D:\\Chrome\\chrome.exe"
};
var driver = new ChromeDriver(chromeOptions);

Not able to start a Selenium RemoteWebDriver instance in C# .NET4.5.2

here is my setup:
I've tried various driver/webdriver/grid versions, added capabilities just in case one mandatory was missing but had the same result.
Error also present if I delete the driver.exe file so this shouldn't be considered.
Start grid with bat file
start cmd /k java -jar grid3.14.jar -role hub -newSessionWaitTimeout 10
start cmd /k java -jar grid3.14.jar -role node -hub http://192.168.1.229:4444/grid/register
Execute C# code bellow
var options = new ChromeOptions();
var uri = new Uri("http://192.168.1.229:4444/wd/hub");
var driver = new RemoteWebDriver(uri, options);
Test fails with error:
Result StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress, DriverOptions options)
at UnitTests.CodeRUnner.Run() in C:\UnitTests\UnitTests\Main.cs:line 26
Result Message:
Test method UnitTests.Main.Run threw exception:
System.InvalidOperationException: Unable to create new service: ChromeDriverService
Build info: version: '3.10.0', revision: '176b4a9', time: '2018-03-02T19:11:12.151Z'
System info: host: 'DESKTOP-F9MP198', ip: '192.168.1.229', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_181'
Driver info: driver.version: unknown (SessionNotCreated)
Node console log
17:19:01.903 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Hub log
17:19:01.895 INFO [RequestHandler.process] - Got a request to create a new session: Capabilities {browserName: chrome, goog:chromeOptions: {}}
17:19:01.896 INFO [TestSlot.getNewSession] - Trying to create a new session on test slot {server:CONFIG_UUID=2feea0b8-ace3-4bf5-8410-834034caba1c, seleniumProtocol=WebDriver, browserName=chrome, maxInstances=5, platformName=WIN10, platform=WIN10}

C# Protractor angular never provided resumeBootstrap

This is my first stackoverflow question. I already searched for some answers on this site, but all the solutions I found didn't worked for me, or they were meant for Java or javascript.
The situation
As a junior automation tester I created a sort of Automation Test Framework in C# with the Selenium Webdriver and Protractor.Net.
The Framework consists of 2 parts.
The page objects
The tests
There is also a page object base class. In this class I defined methods that are used by every page object, such as a method for opening a specific program module.
In the tests, there is also a base class. In this class the Test attributes (C# UnitTest) are defined, such as TestInitialize, TestCleanup, AssemblyCleanup.
In the Test Base class I also defined the NgWebDriver, ChromeDriver:
driver = new NgWebDriver(new OpenQA.Selenium.Chrome.ChromeDriver());
driver.Manage().Window.Maximize();
In the Page Object Base class I defined a method to open a specific part of the
website:
public void OpenSPA(string spa)
{
driver.Navigate().GoToUrl(spa, true);
driver.Navigate().Refresh();
}
The pararmeter spa contains the url to navigate to.
The Testcase
The testcase is just simple:
open module x of the website
module x is just an url
The complete code of the testcase:
[TestMethod]
[TestCategory(cat), TestCategory(regression)]
public void Organisatie_CheckActief()
{
bool is_actief;
var organisatie = new CrmSPA(driver);
organisatie.VulVeld("Vrij zoeken", "XXXX");
is_actief = organisatie.IsRelatieActief();
//Assertion
Assert.IsTrue(is_actief == true, "Relatie is niet actief.");
The problem:
Since a couple of weeks ago I get the following error when running the testcase:
Test Name: Organisatie_CheckActief
Test FullName: FirstTest.Webdrivers.WijzigenOrganisatie_Basis.Organisatie_CheckActief
Test Source: C:\Users\XXXX\TestCases\\Organisatie\WijzigenOrganisatie_basis.cs : line 168
Test Outcome: Failed
Test Duration: 0:00:41,1353784
Result StackTrace:
bij OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
bij OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
bij OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScriptCommand(String script, String commandName, Object[] args)
bij OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteAsyncScript(String script, Object[] args)
bij Protractor.NgWebDriver.set_Url(String value) in c:\Users\Bruno\Projets\GitHub\bbaia\protractor-net\src\Protractor\NgWebDriver.cs:regel 163
--- End of inner exception stack trace ---
bij Protractor.NgWebDriver.set_Url(String value) in c:\Users\Bruno\Projets\GitHub\bbaia\protractor-net\src\Protractor\NgWebDriver.cs:regel 193
bij Protractor.NgNavigation.GoToUrl(String url, Boolean ensureAngularApp) in c:\Users\Bruno\Projets\GitHub\bbaia\protractor-net\src\Protractor\NgNavigation.cs:regel 112
bij FirstTest.PageObjects.BaseSPA.OpenSPA(String spa) in C:\Users\\Documents\Visual Studio 2015\Projects\\\FirstTest\PageObjects\BaseSPA.cs:regel 55
bij FirstTest.PageObjects.CrmSPA.CrmSPA..ctor(NgWebDriver driver) in C:\Users\\Documents\Visual Studio 2015\Projects\\\FirstTest\PageObjects\CRM\CrmSPA\CrmSPA.cs:regel 37
bij FirstTest.Webdrivers.WijzigenOrganisatie_Basis.Organisatie_CheckActief() in C:\Users\\Documents\Visual Studio 2015\Projects\\\FirstTest\TestCases\RelatieSPA\Organisatie\WijzigenOrganisatie_basis.cs:regel 174
Result Message:
Test method FirstTest.Webdrivers.WijzigenOrganisatie_Basis.Organisatie_CheckActief threw exception:
System.InvalidOperationException: **Angular could not be found on the page** 'https://XXXXX/CRM/Relaties/ ---> OpenQA.Selenium.WebDriverTimeoutException: asynchronous script timeout: result was not received in 30 seconds
(Session info: chrome=66.0.3359.139)
(Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT 6.1.7601 SP1 x86_64)
The Result on screen/browser
When running the test the following happens:
the chrome browser starts (OK)
the chrome browser opens maximized (ok)
the chrome browser gets the url (ok)
the browser is empty shows blank page (NOK)
somehow i found the following error:
angular never provided resumeBootstrap
I searched on google and stackoverflow and i tried some answers like the synchronize option:
driver.IgnoreSynchronization
the problem does not always shows up. sometimes the page is loaded and the test continues.
I already tried to reinstall protractor-net, a newer chromedriver and seleniumdriver. The problem still exist.
If anyone can help me with this.
This error message...
OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
...implies that the RemoteWebDriver incurred an error while executing a command.
Selenium being an open source framework, you can have a look at the source code here.
GoToUrl() is defined in RemoteNavigator.cs and accepts only one argument string url as follows :
/// Navigate to a url for your test
/// </summary>
/// <param name="url">String of where you want the browser to go to</param>
public void GoToUrl(string url)
{
this.driver.Url = url;
}
But in your code block while invoking GoToUrl() method along with the string spa you have also passed true. This possibly raises the error.
Solution
Within GoToUrl() method removing the argument true will solve your issue.

Apache Spark + Mobius Debug mode

I am new to Apache spark and trying to run this on Windows machine with Mobius.
but i am getting exception while running it.
first of all i have setup following environment variables
JAVA_HOME C:\Program Files\Java\jdk1.8.0_152
HADOOP_HOME C:\winutils
SPARK_HOME c:\spark [spark-2.0.2-bin-hadoop2.6]
SPARKCLR_HOME E:\SparkClr\spark-clr_2.11-2.0.200\runtime
In code provided correct file to read data from as file:///E:/Mobius/Mobius/SampleText.txt
I tried to run it in debug mode
E:\SparkClr\spark-clr_2.11-2.0.200\runtime\scripts>sparkclr-submit.cmd debug
[sparkclr-submit.cmd] SPARKCLR_JAR=spark-clr_2.11-2.0.200.jar
[sparkclr-submit.cmd] LAUNCH_CLASSPATH="E:\SparkClr\spark-clr_2.11-2.0.200\runtime\lib\spark-clr_2.11-2.0.200.jar;c:\spark\jars\*"
Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
17/12/19 11:34:23 INFO CSharpRunner: Starting CSharpBackend!
17/12/19 11:34:25 INFO CSharpRunner: Port number used by CSharpBackend is 5567
***********************************************************************
* [CSharpRunner.main] Backend running debug mode. Press enter to exit *
***********************************************************************
17/12/19 11:35:09 INFO SparkContext: Running Spark version 2.0.2
In my App.config Added following Entry [Port name with i got from above]
<add key="CSharpBackendPortNumber" value="5567"/>
I am getting below Exception message
JVM method execution failed: Nonstatic method partitions failed for class 12 when called with no parameters
Stack Trace
at Microsoft.Spark.CSharp.Interop.Ipc.JvmBridge.CallJavaMethod(Boolean isStatic, Object classNameOrJvmObjectReference, String methodName, Object[] parameters)
at Microsoft.Spark.CSharp.Interop.Ipc.JvmBridge.CallNonStaticJavaMethod(JvmObjectReference objectId, String methodName)
at Microsoft.Spark.CSharp.Proxy.Ipc.RDDIpcProxy.GetNumPartitions()
at Microsoft.Spark.CSharp.Core.RDD`1.GetDefaultPartitionNum()
at Microsoft.Spark.CSharp.Core.PairRDDFunctions.PartitionBy[K,V](RDD`1 self, Int32 numPartitions, Func`2 partitionFunc)
at Microsoft.Spark.CSharp.Core.PairRDDFunctions.ReduceByKey[K,V](RDD`1 self, Func`3 reduceFunc, Int32 numPartitions)
at Microsoft.Spark.CSharp.Examples.WordCountExample.Main(String[] args) in E:\Mobius\Mobius\examples\Batch\WordCount\Program.cs:line 35
I am not sure about CSharpWorkerPath.
Please help if anyone face this kind of issue earlier.

Selenium WebDriver with C#: select item from drop-down menu (doesn't work in IE)

It's needed to select the second item from the drop-down menu that is hidden by default. The problem it that it works fine in Fire Fox 41 browser but not in Internet Explorer 11. I'm using Selenium Web Driver with C#, nUnit in Visual Studio 2010. Tests are executed on remote VM with Selenium Server and IEDriver.
HTML looks like:
<ul id="CVC" class="buttonMenu" style="visibility: hidden; left: 183px;">
<li class="menuItem">First</li>
<li class="menuItem">Second</li>
<li class="menuItem">Third</li>
</ul>
I have C# code that works only in FireFox:
var menu = wd.FindElement(By.Id("CVC"));
var menuLi = menu.FindElements(By.TagName("li"));
menuLi[1].Click();
wd.FindElement(By.Id("TITLE")).SendKeys("blabla"); //continue to work with appeared pop-up
wd.FindElement(By.Id("CVC_OK")).Click();
When I run test in Internet Explorer an error appears:
Test Name: Bookmark
Test FullName: EEE.Tests.BT.BB
Test Source: d:\Selenium\Automation\EEEAutomation\EEEAutomation\Tests\BT.cs : line 19
Test Outcome: Failed
Test Duration: 0:00:39.319
Result Message: OpenQA.Selenium.ElementNotVisibleException : Cannot click on element (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 35 milliseconds
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'wkqacl0801', ip: '10.101.6.104', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_60'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreateProcessApi=false, pageLoadStrategy=normal, ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:39901/, takesScreenshot=true, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=dismiss}]
Session ID: 6f09c88a-bd73-4cab-9312-0587c8345023
Result StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at EEE.Tests.SubTests.CreateBBSubTest.Execute(IWebDriver wd) in d:\Selenium\Automation\EEEAutomation\EEEAutomation\Tests\SubTests\CreateBBSubTest.cs:line 103
at EEE.Tests.BT.BB() in d:\Selenium\Automation\EEEAutomation\EEEAutomation\Tests\BT.cs:line 54
Does anyone know how to make it worked in Internet Explorer 11?
Not sure if IE should be considered as a real browser. In any case I reread your problem, it seems that you expect IE to work like a browser on click event. In that case you might want to help it along :
using (var wd = new InternetExplorerDriver(
new InternetExplorerOptions {EnableNativeEvents = false}))
{
//your code
}
I figured out the solution by using JavaScript. I'm not sure that this is the best solution but at least it works not only in FF, but also in IE browser:
((IJavaScriptExecutor)wd).ExecuteScript("$('#CVC li:eq(1)').click()");
wd.FindElement(By.Id("TITLE")).Clear();
wd.FindElement(By.Id("TITLE")).SendKeys("blabla");
wd.FindElement(By.Id("CVC_OK")).Click();
This worked for me:
_driver.FindElement(By.Id("IdOfControl")).SendKeys(value);

Categories

Resources