hi,
i am trying to get date form web page.
is there a way in ranorex to get text from the open web using c#?
something like "getelementby..."
??
tnx
get element from web page
Re: get element from web page
Hi,
Generally speaking, yes, it's possible to get the value of an element via C# code. For example, you can use GetAttributeValueText method to do this. The code could look like this:
If you need more detailed help, please post some more details about the web element in question (the best would be Ranorex Snapshot), your Ranorex version, etc...
Generally speaking, yes, it's possible to get the value of an element via C# code. For example, you can use GetAttributeValueText method to do this. The code could look like this:
Code: Select all
test = repo.Element.GetAttributeValueText("Value");
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: get element from web page
this all what i have.
IList<Ranorex.WebDocument> webList = Host.Local.Find<Ranorex.WebDocument>("/dom[@domain='test4.wersystem.com']");
from here have i can use this instance and take information from the web page?
IList<Ranorex.WebDocument> webList = Host.Local.Find<Ranorex.WebDocument>("/dom[@domain='test4.wersystem.com']");
from here have i can use this instance and take information from the web page?
Re: get element from web page
I'm afraid, there is not enough info to help you. The code you showed is in my opinion not enough to do what you want. You need an element, from which you want to get the text. Your code points to whole webdocument, not the element containing the "date". Please post the Ranorex snapshot of element in question.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: get element from web page
i try to explain,
i open chrome with ranorex and open website.
i want to parse this website. i tried to use in HtmlAgilityPack. but because this webpage load with JavaScript i HtmlAgilityPack not being help full for me. so, i search for a way to parse the webpage after is load or in another work to parse the "development tool" (F12) of chrome.
i open chrome with ranorex and open website.
i want to parse this website. i tried to use in HtmlAgilityPack. but because this webpage load with JavaScript i HtmlAgilityPack not being help full for me. so, i search for a way to parse the webpage after is load or in another work to parse the "development tool" (F12) of chrome.
Re: get element from web page
If I understand you right, you basically need to load entire web page and parse that page to find an element on it? I think there is still not enough information about how exactly you would like to find the element on that page. You see, even with the page loaded, you still need to know something about the element you would like to find, like its xpath, ID, inner text, tagname, tagvalue, etc. Simply anything that would help to identify the element on page. But maybe I'm misunderstand something?
Anyway, I think you need to use the code like this to load the page:
http://www.ranorex.com/support/user-gui ... mples.html
Anyway, I think you need to use the code like this to load the page:
WebDocument webDoc = "/dom[@domain='www.ranorex.com']";Now to find something on that page, you will have to use any of available "Find" methods (Find, FindSingle, FindDescendants, etc). Check this page with many "Find" samples...
http://www.ranorex.com/support/user-gui ... mples.html
Last edited by odklizec on Tue May 26, 2015 1:50 pm, edited 1 time in total.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: get element from web page
I think part of the problem is that you are trying to re-invent the wheel here. Ranorex already parses the page for you. Learn how Ranorex works and how to use RanoreXPath and I think it will be more clear to you.
http://www.ranorex.com/support/user-guide-20.html
http://www.ranorex.com/support/user-guide-20.html
Shortcuts usually aren't...