Skip to content

how to change code ? #906

Open
Open
@YeonwooJeong

Description

@YeonwooJeong

I using java code. but I cannot use C# code

DesktopSession.Keyboard.SendKeys(Keys.Meta + "s" + Keys.Meta);

var CortanaWindow = DesktopSession.FindElementByName("Cortana");
var CortanaTopLevelWindowHandle = CortanaWindow.GetAttribute("NativeWindowHandle");
CortanaTopLevelWindowHandle = (int.Parse(CortanaTopLevelWindowHandle)).ToString("x"); // Convert to Hex -> how to change java code? what means this code.. String > int hex?

I tried to convert to Java.
String CortanaTopLevelWindowHandle = CortanaWindow.getAttribute("NativeWindowHandle");
int hex = Integer.parseInt(CortanaTopLevelWindowHandle ,16);
CortanaTopLevelWindowHandle = Integer.toHexString(hex);

is right?

// Create session by attaching to Cortana top level window
DesiredCapabilities appCapabilities = new DesiredCapabilities();
appCapabilities.SetCapability("appTopLevelWindow", CortanaTopLevelWindowHandle);
CortanaSession = new WindowsDriver(new Uri(WindowsApplicationDriverUrl), appCapabilities); -> what is WindowsApplicationDriverUrl? this is path of application?

// Use the session to control Cortana
CortanaSession.FindElementByAccessibilityId("SearchTextBox").SendKeys("add");

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions