cannot open desire page through cucumber - webdriver

i am new to cucumber. i am facing one problem which i tried my best to solve but i did not fix it.
the problem is how to connect cucumber to specific web page on google chrome.
the below is code
"
import cucumber.api.PendingException;
import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class MyStepdefsss {
public WebDriver driver;
#Given("^go to desire web page$")
public void go_to_desire_web_page() throws Throwable {
System.setProperty("webdriver.chrome.driver" , "C:\\Users\\muhammad.ilyas\\chromedriver.exe");
driver = new ChromeDriver();
driver.get("https://www.youtube.com/watch?v=55vJUqHSbkQ");
}
"
when i run the above code which is mention in picture it give me result like
google chrome open and not proceeding to the required page
Here is code snipshot

There is a chance that your Desktop Chrome version is not compatible with the ChromeDriver. Are you sure you are using the latest ChromeDriver.exe.
Look for the latest here or upgrade your chrome browser version. Or you may be try degrading the ChromeDriver version to 2.7 or earlier in case you are already on latest.
Make sure to delete the existing ChromeDriver from the path or change the name.

Related

Upgrading Wicket 9.0.0 to 9.3.0: runtime error when try to access database

I am attempting to upgrade from Wicket 9.0.0 to Wicket 9.3.0. When I change the version in a quick-start application, everything is fine.
The problem occurs in my real application, where we were originally using Jakarta Enterprise Beans 8.0.0. At runtime, when a database access was attempted, we got an exception with the following message:
Last cause: net.sf.cglib.proxy.MethodInterceptor not found by org.objectweb.asm [23]
Trying to use Jakarta EE 9.1 instead
I changed my pom.xml as follows:
<jakartaee>9.1.0</jakartaee>
<wicket.version>9.3.0</wicket.version>
I downloaded the jar for Jakarta EE 9.1, changed "javax" to "jakarta" throughout my application, rebuilt it and tried to run again.
The result was still not perfect, but significantly better than before: a plain old null pointer exception instead of any weird errors about cglib.
Here's the section of code that now causes the trouble:
#EJB(name = "AdminNotesFacade")
private AdminNotesFacade adminNotesFacade;
public AdminNotesFacade getAdminNotesFacade() {
return adminNotesFacade; //ACTUALLY RETURNS NULL
}
So now the big question is: what do I need to do/change to make the #EJB work instead of returning null?
Checking the Payara log, I get this error:
java.lang.RuntimeException: Unable to load the EJB module. DeploymentContext does not contain any EJB. Check the archive to ensure correct packaging for D:\Dev\icase2\target\icase2.
If you use EJB component annotations to define the EJB, and an ejb or web deployment descriptor is also used, please make sure that the deployment descriptor references a Java EE 5 or higher version schema, and that the metadata-complete attribute is not set to true, so the component annotations can be processed as expected
at org.glassfish.ejb.startup.EjbDeployer.prepare(EjbDeployer.java:189)
Adding further details, 2022-05-06
I wonder if we were going off on the wrong track when we thought that we could fix this by upgrading our jakartaee version. From Wicket 9.0 to 9.3 is only a change of minor version and you wouldn't expect to have to make such fundamental changes to get a minor upgrade working.
I've tried using Wicket 9.9.1 instead, in case this problem has been fixed in more recent versions, but it's exactly the same.
Anyway, I have created a very small "quick-start" application, based on Wicket's own templates, to reproduce the problem. I have stuck with the original "javax" version, and added just one EJB - a JavaMail bean. I think it's probably interesting to know that it's not a specifically database-related issue. We just can't seem to load any EJBs at all.
In the Wicket 9.0.0 version, a simple form is displayed on the home page, allowing the user to enter their email address. When they submit the form, a test message is sent to that address. It works fine.
Then if I change the Wicket version to 9.3.0 but make no other changes at all, it doesn't even get to the stage of displaying the home page, it immediately crashes with the message "Last cause: net.sf.cglib.proxy.MethodInterceptor not found by org.objectweb.asm [23]"
For what it's worth, here's the code that triggers the error.
public class HomePage extends WebPage {
#EJB(name = "EmailerFacade")
private EmailerFacade emailerFacade;
private static final long serialVersionUID = 1L;
private String sendTo = "";
public HomePage(final PageParameters parameters) {
super(parameters);
add(new Label("version", getApplication()
.getFrameworkSettings().getVersion()));
FeedbackPanel feedback = new FeedbackPanel("feedback");
add(feedback);
final Form emailForm = new Form("emailForm") {
#Override
protected void onSubmit() {
emailerFacade.sendMessage(sendTo, "Test message from quick-start",
"Version is " + getApplication().getFrameworkSettings()
.getVersion());
info("Tried to send message to " + sendTo);
}
};
add(emailForm);
final TextField<String> emailAddress = new TextField<>("emailAddress",
new PropertyModel<>(this, "sendTo"));
emailAddress.setLabel(Model.of("Email address"));
emailAddress.setRequired(true);
emailForm.add(emailAddress);
}
}
Wicket 9.x is based on javax.servlet APIs. To deploy it on jakarta.servlet supporting web container you will need to migrate the bytecode with a tool like https://github.com/apache/tomcat-jakartaee-migration.
I am not sure whether Payara does something smart at runtime to support both javax.** and jakarta.** classes.
Tomcat 10.x supports migration of the classes at application start time by deploying your app in the special $CATALINA_HOME/webapps-javaee folder.
This answer was actually provided by Sven Meier. He commented:
Use the new system property to switch to ByteBuddy in Wicket 9.x:
-Dwicket.ioc.useByteBuddy=true
To expand a bit on this, I found I needed to do three things:
Set the system property "wicket.ioc.useByteBuddy" to true as specified by Sven
Add a dependency on byte buddy
Upgrade to a higher version than I was initially attempting to do: 9.3.0 was not good enough. I see in a comment above by Sven, he says that the migration to byte buddy was actually done in 9.5. So in fact I upgraded to the latest version, which is currently 9.9.1.
Here is the dependency on byte buddy that I added:
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.12.10</version>
</dependency>

Firebase dynamic link is not resolving in Xamarin Forms iOS

I am using Xamarin.Firebase.iOS.DynamicLinks 2.3.1.1 for dynamic links, Earlier it was working fine but recently it is not working. While trying to extract the short link, long link getting null. Is anyone knows why it is not working?
I have updated to the latest version (4.0.1) and its working fine. It not working any of the previous version of NuGet packages.
To answer your question. The Dynamic links are not working either on Firebase's end who choose to discontinue their old library or due to the newest IOS update 13.3. I say this because my app that is in production had its links working fine then they suddenly stopped working.
My current solution was to update Xamarin.Firebase.iOS.DynamicLinks to (4.0.1) and I was able to once again process the long url with its parameters.
A few things to note if you have other libraries such as Firestore, Analytics, Notifications etc.
You might run into linker failed exceptions. They occur because
Xamarin.Firebase.iOS.DynamicLinks (3.0.2.1) and prior depended on
Xamarin.Firebase.iOS.Core (>= 5.1.3) and the working
Xamarin.Firebase.iOS.DynamicLinks (4.0.1.1) references
Xamarin.Firebase.iOS.Core (>= 6.1.0.1) Somehow they reference methods that are no longer available.
The linking failed is fixed by checking each of your nuGets and manually installing their respective nuGets that reference ...iOS.Core (>= 6.1.0.1) : For example:
if you use Xamarin.Firebase.iOS.Storage (2.0.0) manually install
Xamarin.Firebase.iOS.Storage (3.4.0.1) because
Xamarin.Firebase.iOS.Storage (2.0.0) references
Xamarin.Firebase.iOS.Storage (>= 3.0.2) which in turn references:
Xamarin.Firebase.iOS.Core (>= 5.1.3) and it will cause native linking failed
And lastly, in my case Xamarin.Firebase.iOS.DynamicLinks (4.0.1.1) will make your method for generating ShortLinks, stop working too:
In Xamarin.Firebase.iOS.DynamicLinks (3.0.2.1) you would build your
DynamicLinkComponents with:
var shareLink = DynamicLinkComponents.FromLink(linkParameters,
"YOUR_DOMAIN.page.link");
Xamarin.Firebase.iOS.DynamicLinks (4.0.1.1) recomends you use
DynamicLinkComponents.Create(YOURlinkParameters, "YOUR_DOMAIN.page.link");
but it would return a null DynamicLinkComponents so i fixed by doing:
var shareLink = new DynamicLinkComponents();
shareLink.Link = YOURlinkParameters;
shareLink.Domain = "https://YOUR_DOMAIN.page.link";
I spent a week trying to troubleshoot this error and really hope others are able to see this and save you valuable time.
A work around to get Xamarin.Firebase.iOS.DynamicLinks 3.0.2.1 working (should work on 2.3.1.1 as well) is to have the IOS device open the link in the browser which will then redirect them back to the app.
The flow is Dynamic link > App [short link] > Browser > App with [long link].
Dynamic links are formatted "domain.page.link/ShortSequence" and long links parameters have "domain.page.link/?". You can look for the '?' to decide weather to process url or to redirect user as follows:
public override bool ContinueUserActivity(UIApplication application,
NSUserActivity userActivity, UIApplicationRestorationHandler completionHandler)
{
if (userActivity.ActivityType == NSUserActivityType.BrowsingWeb)
{
var sharedLink = userActivity.WebPageUrl;
if (!sharedLink.ToString().Contains("domain.page.link/?")){
await Launcher.OpenAsync(new Uri(sharedLink.ToString()));
return;
}
var handled = DynamicLinks.SharedInstance.FromUniversalLinkUrl(sharedLink);
//Process your DynamicLink parameters
}
return true;
}

Kivy Async Image - Static Google API doesn't load

i try to asyncronously load a static google maps image via the google api.
The code below is taken from the kivy reference base, it works with other images, but not if i use the google link. The link works fine in the web browser. (Also note that the source string is in one line in my original py file, that just doesn't display right here)
my kv
from kivy.app import App
from kivy.uix.image import AsyncImage
from kivy.lang import Builder
class TestAsyncApp(App):
def build(self):
return AsyncImage(
source='http://maps.googleapis.com/maps/api/'+\
'staticmap?center=47.909,7.85&zoom=13&size=600x300')
if __name__ == '__main__':
TestAsyncApp().run()
Help is very appreciated!
With Kivy 1.8.0, URLs like the one above don't work as expected. Kivy tries to parse the URL and find the file extension, which fails of course. In the development version, we now check the MIME type reported by the server, but you can work around this in 1.8.0 by using a fake query parameter:
return AsyncImage(
source='http://maps.googleapis.com/maps/api/'+\
'staticmap?center=47.909,7.85&zoom=13&size=600x300&ext=.png')

Driver.manage().timeouts() is not available

Using the latest jar of webdriver java(2.33), trying to set implicit wait but the timeouts() is not available in available options for driver.manage() in Eclipse.
It throws an error that this is not an available option for this class. Tried the same with 2.30 and same issue was repeating. Has any one seen such issue, please let me know on how this can be handled?
WebDriver driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
I got the problem. I was migrating scripts from RC to WebDriver and included both RC and Webdriver Java jars in the build path. Once i removed the RC files, it started working fine.
Thanks Arran, HemChe for atleast responding. Some ignorant fellow has rated my post -1 rating.

ExtensionContext error while creating Native Extension in Flex 3.6 SDK

I'm creating native extension with Flex 3.6. Coded native side then created Flex Library Project and then create .ane file. Finally imported .ane file to myFlex Project. Here is the problem I had. While I'm debugging app, "1046: Type was not found or was not a compile-time constant: ExtensionContext" error occurs. Attached the Library project .as class .
Thanks in Advance
package com.extension.samples
{
import flash.events.EventDispatcher;
import flash.events.IEventDispatcher;
import flash.external.ExtensionContext;
public class NetworkConnectionANE extends EventDispatcher
{
public var _extContext : ExtensionContext;
public function NetworkConnectionANE(target:IEventDispatcher=null)
{
_extContext = ExtensionContext.createExtensionContext("com.extension.samples.NetworkConnectionANE", null);
super(target);
}
public function Connect(path:String):int
{
return _extContext.call("nativeFunc", path);
}
public function dispose():void
{
_extContext.dispose();
}
}
}
Edit:
I tried to use .swc file that created from library project in another Flex Desktop app, but the same error
Also tried with _extContext = ExtensionContext.createExtensionContext("com.extension.samples.NetworkConnectionANE","");
Edit: The problem about Flex SDK,no problem in SDK 4.6. Now the question is, How to use Extension in lib project in Flex 3.6 SDK ?
Right click on the project in flash builder goto properties of project and add air libraries in the flex library compiler.
I had the same problem but it was resolved in the following way:
File > New > Flex Library Project
Check the "Include Adobe AIR Libraries" option
As I know ExtensionContext.createExtensionContext() can be null in these cases:
The call is not in an .ane file. You cannot call this from a .swc or a .swf file. In other words it needs to be compiled to an .ane file before calling it.
You try to use the extension in a platform, that is not supported by the extension. For example you try to use an iOS extension on PC.
The ID for the extension does not exists. The extension ID must be the same, as the one you specify in the extension.xml like:
<extension xmlns="http://ns.adobe.com/air/extension/3.5">
<id>com.extension.samples.NetworkConnectionANE</id>
<versionNumber>0.0.1</versionNumber>
....
btw you dont need to set the second parameter of the ExtensionContext.createExtensionContext call, unless you want to specify OS-specific APIs (I havent even seen apps, that do this)

Resources