Unable to Select the ListItem in a PDF embedded in IE

Class library usage, coding and language questions.
nivasd16
Posts: 14
Joined: Fri Jan 22, 2016 11:17 pm

Unable to Select the ListItem in a PDF embedded in IE

Post by nivasd16 » Thu Nov 03, 2016 1:06 am

Hi team
A PDF will open as an embedded in an internet explorer and need to select a List item in that PDF. When i do the spy its identifying as List Item only. But when i try to select that listitem throwing an error message as
"Action 'select' failed on element '{ListItem:Lawful Permanent Resident}'.
Element is not valid.
Error HRESULT E_FAIL has been returned from a call to a COM component

the code i tried is
var Itemcnt = CmplHire.Lst_ResidenceStatus.Items

For (int iter1=0; iter1<Itemcnt .Count;iter1++)
{
if (Itemcnt [iter1].Text == "Lawful Permanent Resident")
{
Itemcnt [iter1].Select();
}
}



Attached is the Snapshot of the Repository and also the screenshot of the application
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Unable to Select the ListItem in a PDF embedded in IE

Post by odklizec » Thu Nov 03, 2016 9:20 am

Hi,

Could you please provide the problematic PDF? My guess is that you are trying to retrieve the item from collapsed listbox, which may be the reason of your problem. I think you will have to expand the listbox (click on it) before you try to read/select its items?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

nivasd16
Posts: 14
Joined: Fri Jan 22, 2016 11:17 pm

Re: Unable to Select the ListItem in a PDF embedded in IE

Post by nivasd16 » Thu Nov 03, 2016 4:31 pm

odklizec wrote:Hi,

Could you please provide the problematic PDF? My guess is that you are trying to retrieve the item from collapsed listbox, which may be the reason of your problem. I think you will have to expand the listbox (click on it) before you try to read/select its items?

Hi
Thanks for the reply. I tried that approach also . i added the below extra statements above the select code

CmplHire.Lst_ResidenceStatus.Focus();
CmplHire.Lst_ResidenceStatus.Click();

Even after that also its not worked

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Unable to Select the ListItem in a PDF embedded in IE

Post by odklizec » Thu Nov 03, 2016 4:43 pm

I still think it's because of invalid state of the listbox? Unfortunately, it's hard to suggest something reliable without sample PDF ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

nivasd16
Posts: 14
Joined: Fri Jan 22, 2016 11:17 pm

Re: Unable to Select the ListItem in a PDF embedded in IE

Post by nivasd16 » Thu Nov 03, 2016 5:11 pm

odklizec wrote:I still think it's because of invalid state of the listbox? Unfortunately, it's hard to suggest something reliable without sample PDF ;)
Attached is the Sample PDF. Kindly look at it and provide me some solution

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Unable to Select the ListItem in a PDF embedded in IE

Post by odklizec » Thu Nov 03, 2016 5:47 pm

I'm afraid, you forgot to attach the sample file?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

nivasd16
Posts: 14
Joined: Fri Jan 22, 2016 11:17 pm

Re: Unable to Select the ListItem in a PDF embedded in IE

Post by nivasd16 » Thu Nov 03, 2016 6:02 pm

nivasd16 wrote:
odklizec wrote:I still think it's because of invalid state of the listbox? Unfortunately, it's hard to suggest something reliable without sample PDF ;)
Attached is the Sample PDF. Kindly look at it and provide me some solution
i am not able to attach the PDF file getting an error message as "The extension pdf is not allowed."

nivasd16
Posts: 14
Joined: Fri Jan 22, 2016 11:17 pm

Re: Unable to Select the ListItem in a PDF embedded in IE

Post by nivasd16 » Thu Nov 03, 2016 6:12 pm

nivasd16 wrote:
nivasd16 wrote:
odklizec wrote:I still think it's because of invalid state of the listbox? Unfortunately, it's hard to suggest something reliable without sample PDF ;)
Attached is the Sample PDF. Kindly look at it and provide me some solution
i am not able to attach the PDF file getting an error message as "The extension pdf is not allowed."
send me your Email id i will send the pdf as an attachment

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Unable to Select the ListItem in a PDF embedded in IE

Post by odklizec » Thu Nov 03, 2016 6:23 pm

Just zip it ;) Zip archive is allowed.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

nivasd16
Posts: 14
Joined: Fri Jan 22, 2016 11:17 pm

Re: Unable to Select the ListItem in a PDF embedded in IE

Post by nivasd16 » Thu Nov 03, 2016 6:28 pm

odklizec wrote:Just zip it ;) Zip archive is allowed.
Attached the file.Unzip it and open that file with PDF , the image looks doc but need to open in PDf
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Unable to Select the ListItem in a PDF embedded in IE

Post by odklizec » Fri Nov 04, 2016 8:41 am

Hi,

Unfortunately, I'm not able to track the individual PDF elements with Spy. I'm using Ranorex 6.1.1 and I see you created your snapshot with 5.4.6. So there is a little chance something PDF-related got broken in 6.1.1? Which means I'm not able to help you right now.

BTW, what version of acrobat reader do you use?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

jma
Posts: 107
Joined: Fri Jul 03, 2015 9:18 am

Re: Unable to Select the ListItem in a PDF embedded in IE

Post by jma » Tue Nov 08, 2016 4:36 pm

Hi nivasd16,

I'm afraid I couldn't access individual elements either. But basically, PDF object recognition seems to work on my machine (Ranorex 6.1.1).

I could see from your snapshot that you embedded the PDF document in a web page. Did you make any special configuration to make the PDF objects accessible? Could you describe how you embedded the PDF in your web page? I tried embedding it via an iframe, but the result is the same like when tracking it from the PDF reader directly.