-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Locate elements with Java, XPath and ControlType #60
Comments
Hi, |
Great, any workaround for now? Thx for the fast response :) |
You can use the 'Window' as a control type value, but it will be a dirty hack for this particular case and not work for another control types. |
Maybe I'll be better with waiting for the fix. Thx so far! |
Resolved in v1.5.0 |
Hm, unfortunately not. Maybe I'm doing something wrong? Without ControlType/ProgrammaticName everything works as expected. |
Attribute |
Ah, I think I messed something up when replacing the old version. Everything is working as expected. Thx alot :) |
cool |
Hi, i tried to setup xpath for notepad++ and it did not work for me |
Hi, |
@heler12 , driver element usually represents root of your desktop, so searching for But note that it will traverse a lot of elements in all open windows on your desktop which might make your test run very slow. It is recommended to first locate a window of interest and then use xpath starting from this window. So, you can use your old locator, but you will need to replace
|
Dear All, It dosent work. Help will be really appericiated. |
I got it worked.Thanks guys. |
i am haveing same issue , could pls. let me know..Thanks |
@venkatags I am facing the similar problem, may i know how is it resolved? |
What code you have used to retrieve the text ? could you please send . |
I am trying to locate the element(textbox) on the dialog box . There are two elements that has same name "Account". I am interested in the following element (as shown by the spy tool).. I used theXpath. It does not work. What is that I am missing, please @findby(how = How.XPATH, using = "//*[contains(@ControlType,'ControlType.edit') and contains(@name,'Account')]") From Inspect.ext tool - spy toolControlType: UIA_EditControlTypeId (0xC354) |
Tried the following as well - xception in thread "main" org.openqa.selenium.TimeoutException: Timed out after 350 seconds waiting for visibility of element located by By.xpath: //*[contains(@ControlType,'ControlType.edit') and contains(@name,'Account')] |
Please help as soon as possible... thank you |
@kirshru Could you send the exact screenshots showing all the element properties from inspect tool. There is something wrong in your xpath. The best & the fastest way to traverse through the required element is to traverse from root to node. |
I was able to solve. Thank you
Also any solution to scroll down list box and select
Thx
Kiran
…On Friday, May 25, 2018, ankitvaish04 ***@***.***> wrote:
@kirshru <https://github.com/kirshru> Could you send the exact
screenshots showing all the element properties from inspect tool. There is
something wrong in your xpath. The best & the fastest way to traverse
through the required element is to traverse from root to node.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#60 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AL4wvGj3aElk69Qbt38kcY8he3ceaUxDks5t180kgaJpZM4GRUQZ>
.
|
We are facing similar problem with automation of windows application using c# and winium. We have two controls with same name and different automationid. But the driver is not recognizing the control with automationid. Is there a way to identify the xpath of required control with UiSpy? |
@ganeshsomisetty driver.findelement(By.id("")) should work could you share your code? |
@rateebhatt, this is probably a stupid question but I need to be sure to understand, does your previous answer mean that |
yes correct |
@rateebhat, we have used the same for identifying the element. We are using c# and UISpy for identifying the automation id of windows application form elements. Automationid is different for two elements having same name(on UISpy) on the form. Unable to click the text box element or send keys input is not working. Any suggestions? |
please try and access the element properties and see if you can do any other action other than click to clarify is element is not found at all OR if the element is found however click could not be performed. You could use following to make sure element is clickable before performing click action. |
Hi Please let us know how you have resolved the issue ... tried using the following xpath ... winium is not recognizing the same driver.findElement(By.xpath("//[@classname='Edit']//[contains(@AutomationId,'603')]")).click(); //[@AutomationId='603']//[@classname='Edit'] |
@skyline-gleb @kirshru @venkatags Kindly help on this to resolve driver.findElement(By.xpath("//[@classname='Edit']//[contains(@AutomationId,'603')]")).click(); //[@AutomationId='603']//[@classname='Edit'] WebDriverWait wait= new WebDriverWait (driver,10000); |
Hey,
Is there a possibility to locate an element with XPath and the ControlType of an element?
When I try to locate an element with
/*[contains(@Name,'WindowName')]
and use the methodelement.getAttribute("ControlType");
I'll get the following output for the attribute:{ProgrammaticName=ControlType.Window, Id=50032, LocalizedControlType=window}
.How can I check for
ControlType.Window
in my XPath query? The query/*[contains(@ControlType,'ControlType.Window') and contains(@Name,'WindowName')]
seems not to work.The text was updated successfully, but these errors were encountered: