I know bounds attribute contain size / location. but , which one is size [252,600] , location [416,634] ??
or vice versa ??
My requirement is i wrote some wrapper for page source. i want to convert this page in pure html page.
i.e. Button = <input type = 'button' style='top:'?px'; left:'?px'; width:'?px'; height:'?px';' text = 'Set Server IP' />
I tried with both size [252,600] , location [416,634] and location [252,600] , size[416,634] .
since, bounds contains location also.hence, what will be the location (i.e. top , left). so, i can render these element in html.
that will be look like same ui as rendered in android screen.
Thank You Sir,
I got your point. Yes, Now, UI is rendering as per expectation but still need improvement.
I have one more concern.
If i get page source by driver.getPageSource() then this command will display all ui source in xml.
but, how to know this element is visible on screen or not ?
Suppose one screen contain 2 buttons ( A / B). If A press some elements display & when B press A elements hide and B`s element display.
I want to get only A Elements when it is active or for B vice versa.
At that point, you use the other tools in appium to detect if the element is present. You can find the element by name (text or content-desc) or resource-id (if present). Alternatively, you can parse the page source that you already have there. We can see that you have a relatively unique content-desc, so find the element by name matching ‘Set Server IP’.
Thanks Mr. Willosser,
Yeah, we can find elements by name or resource-id.
Suppose, two buttons are given in xml source code(resource-id, content-desc/text are given null).
but, only one is displayed on android screen(i.e. activity) then how to know second one is hidden.
is there any properties in appium to get this information. ?
When you test on Android, you know nothing about what isn’t on the screen.
There is an api in the appium driver for find_elements() which returns an array. If you know two should be visible, but the length of the element list is one, then you can infer the other one is off screen.
Anyways Thank You Mr. Will Osser
You tried a lots for me to find the quick solution.
I can see you are the active user for many members.
Whenever i`ll have problem , i contact you.
@willosser ca you please tell me how to get the screen size scaling ratio? I have a JavaFX webview. I need to render screen shot image inside webview. I have a fixed width and height to webview. please tell me how to render the full image inside it ?